commit 88b76fd29140797c374cab740b6a454ef11d1e0f
parent 508d46fc0f1b4e90a47d9b4d97e9a8c3a788bffb
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 15 Jan 2024 00:03:19 -0800
Fix pm upload
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go
@@ -983,7 +983,8 @@ func handlePMCmd(c *command.Command) (handled bool) {
return handlePm0(c, newMsg)
}
- if strings.TrimSpace(newMsg) == "" {
+ // Hack to have 1 on 1 chat with the user
+ if strings.TrimSpace(newMsg) == "" && c.Upload == nil {
redirectPmUsernameQP := command.RedirectPmUsernameQP
newURL := fmt.Sprintf("/api/v1/chat/messages/%s/stream?%s=%s", c.Room.Name, redirectPmUsernameQP, username)
database.MsgPubSub.Pub("refresh_"+string(c.AuthUser.Username), database.ChatMessageType{Typ: database.Redirect, NewURL: newURL})