commit 1dfc3026d9e93aafdd71f74b370c8c9ad37408f5
parent 209bceb18148b83298356ef3f41e4670eeb45d38
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 29 Dec 2023 17:58:15 -0500
cleanup
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go
@@ -977,6 +977,11 @@ func handlePMCmd(c *command.Command) (handled bool) {
username := database.Username(m[1])
newMsg := m[2]
+ // Chat helpers
+ if username == config.NullUsername {
+ return handlePm0(c, newMsg)
+ }
+
if strings.TrimSpace(newMsg) == "" {
newURL := fmt.Sprintf("/api/v1/chat/messages/%s/stream?pmusername=%s", c.Room.Name, username)
database.MsgPubSub.Pub("refresh_"+string(c.AuthUser.Username), database.ChatMessageType{Typ: database.Redirect, NewURL: newURL})
@@ -985,11 +990,6 @@ func handlePMCmd(c *command.Command) (handled bool) {
return true
}
- // Chat helpers
- if username == config.NullUsername {
- return handlePm0(c, newMsg)
- }
-
if err := c.SetToUser(username); err != nil {
return true
}