dkforest

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

commit 9734f2b8bb82c75416e36b7ca5b096a20ad14e62
parent e0a298dfeeed2cbfed84941394deb9f1b0038211
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 23 May 2023 16:47:02 -0700

fix notifs

Diffstat:
Mpkg/web/handlers/handlers.go | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -4987,8 +4987,9 @@ Loop: } // Sound notifications - var taggedSound, pmSound bool + var newMessageSound, taggedSound, pmSound bool if msg.User.ID != authUser.ID { + newMessageSound = true if strings.Contains(renderedMsg, "@"+authUser.Username) { taggedSound = true } @@ -4998,7 +4999,7 @@ Loop: } if (authUser.NotifyTagged && taggedSound) || (authUser.NotifyPmmed && pmSound) { _, _ = c.Response().Write([]byte(`<audio src="/public/mp3/sound5.mp3" autoplay></audio>`)) - } else if authUser.NotifyNewMessage { + } else if authUser.NotifyNewMessage && newMessageSound { _, _ = c.Response().Write([]byte(`<audio src="/public/mp3/sound6.mp3" autoplay></audio>`)) }