From ee021f1422308bf3f5d1a7f5b1e4f55b6f27ce7f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 9 Jun 2024 13:01:25 +0800 Subject: [PATCH] :bug: Fix push own sent messages --- pkg/services/messages.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/messages.go b/pkg/services/messages.go index 1b1e433..751994f 100644 --- a/pkg/services/messages.go +++ b/pkg/services/messages.go @@ -84,8 +84,8 @@ func NewMessage(message models.Message) (models.Message, error) { }).Preload("Account").Find(&members).Error; err == nil { channel := message.Channel message, _ = GetMessage(message.Channel, message.ID) - doesNotify := true for _, member := range members { + doesNotify := true if member.ID != message.Sender.ID { switch member.Notify { case models.NotifyLevelNone: @@ -105,6 +105,8 @@ func NewMessage(message models.Message) (models.Message, error) { default: break } + } else { + doesNotify = false } if doesNotify {