dkforest

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

commit 405037ac79351d8179eb2ecc17a0316a64c9e870
parent 3567b24a41d6e47363ef37cbc8cc86dd849e1b3c
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat,  3 Dec 2022 04:45:06 -0500

edit system messages

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

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -716,6 +716,8 @@ func handleEditCmd(c *Command) (handled bool) { handleHbmCmd(c) } else if strings.HasPrefix(c.message, "/g ") { handleGroupChatCmd(c) + } else if strings.HasPrefix(c.message, "/system ") || strings.HasPrefix(c.message, "/sys ") { + handleSystemCmd(c) } } } @@ -1297,10 +1299,10 @@ func handleErrorCmd(c *Command) (handled bool) { } func handleSystemCmd(c *Command) (handled bool) { - if strings.HasPrefix(c.message, "/system ") || strings.HasPrefix(c.message, "/sys ") { - if strings.HasPrefix(c.message, "/sys ") { - c.message = strings.Replace(c.message, "/sys ", "/system ", 1) - } + if strings.HasPrefix(c.message, "/sys ") { + c.message = strings.Replace(c.message, "/sys ", "/system ", 1) + } + if strings.HasPrefix(c.message, "/system ") { c.message = strings.TrimPrefix(c.message, "/system ") c.systemMsg = true return true