commit 208e0e735481897b4d9845e8a81e30737f20f8aa
parent cd7a0530ad55bd2ae1de92b3a5306f54116c8c56
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 29 Dec 2023 21:15:58 -0500
cleanup
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go
@@ -976,9 +976,11 @@ func handlePMCmd(c *command.Command) (handled bool) {
if m := pmRgx.FindStringSubmatch(c.Message); len(m) == 3 {
username := database.Username(m[1])
newMsg := m[2]
+ redirectPmQP := command.RedirectPmQP
// Chat helpers
if username == config.NullUsername {
+ c.RedirectQP.Set(redirectPmQP, config.NullUsername)
return handlePm0(c, newMsg)
}
@@ -995,7 +997,7 @@ func handlePMCmd(c *command.Command) (handled bool) {
return true
}
c.Message = newMsg
- c.RedirectQP.Set(command.RedirectPmQP, string(c.ToUser.Username))
+ c.RedirectQP.Set(redirectPmQP, string(c.ToUser.Username))
if newMsg == "/d" || strings.HasPrefix(newMsg, "/d ") {
handled = handleDeleteMsgCmd(c)
@@ -1020,7 +1022,6 @@ func handlePMCmd(c *command.Command) (handled bool) {
// Handle PMs sent to user 0 (/pm 0 msg)
func handlePm0(c *command.Command, msg string) (handled bool) {
- c.RedirectQP.Set(command.RedirectPmQP, "0")
if msg == "ping" {
c.ZeroMsg("pong")
c.Err = command.ErrRedirect