dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 80c0c1086e2d8923abde6dd5b1ce2353cca60513
parent 5e0682cbdd6b6f486b83ac43c8d6f643a30e9b29
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 23 May 2023 04:03:35 -0700

add /afk command

Diffstat:
Mpkg/web/handlers/api/v1/slashInterceptor.go | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -88,6 +88,7 @@ func handleUserCmd(c *Command) (handled bool) { handleChoiceCmd(c) || handleListMemes(c) || handleSuccessCmd(c) || + handleAfkCmd(c) || handleErrorCmd(c) } @@ -1513,6 +1514,16 @@ func handleToggleAutocomplete(c *Command) (handled bool) { return } +func handleAfkCmd(c *Command) (handled bool) { + if c.message == "/afk" { + c.authUser.AFK = !c.authUser.AFK + c.authUser.DoSave(c.db) + c.err = ErrRedirect + return true + } + return +} + func handleSuccessCmd(c *Command) (handled bool) { if c.message == "/success" { c.err = NewErrSuccess("success message")