dkforest

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

commit 04b21f42ece1b0fc97335c4be6f0ddc532ebc5a7
parent 38d1247c22ff44ee5c412ebcc40b503187972f9c
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 11 Feb 2023 01:15:49 -0800

do not update presence when chatting in moderators channel

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

diff --git a/pkg/web/handlers/api/v1/msgInterceptor.go b/pkg/web/handlers/api/v1/msgInterceptor.go @@ -45,7 +45,7 @@ func (i MsgInterceptor) InterceptMsg(cmd *Command) { // Update user activity isPM := cmd.toUser != nil - updateUserActivity(isPM, cmd.room, cmd.authUser) + updateUserActivity(isPM, cmd.modMsg, cmd.room, cmd.authUser) } func generalRoomKarma(authUser *database.User) { @@ -157,9 +157,9 @@ func sendInboxes(room database.ChatRoom, authUser, toUser *database.User, msgID } } -func updateUserActivity(isPM bool, room database.ChatRoom, authUser *database.User) { - // We do not update user presence when they send private messages - if isPM { +func updateUserActivity(isPM, modMsg bool, room database.ChatRoom, authUser *database.User) { + // We do not update user presence when they send private messages or moderators group message + if isPM || modMsg { return } now := time.Now()