From 47a5f037c866cde40d83282b1e98e5cb1654c0b5 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 1 Aug 2024 13:02:41 +0800 Subject: [PATCH] :bug: Fix related user detection in notification --- pkg/internal/services/events.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/internal/services/events.go b/pkg/internal/services/events.go index 4284480..e48ac13 100644 --- a/pkg/internal/services/events.go +++ b/pkg/internal/services/events.go @@ -114,15 +114,15 @@ func NotifyMessageEvent(members []models.ChannelMember, event models.Event) { case models.NotifyLevelNone: continue case models.NotifyLevelMentioned: - if len(body.RelatedUsers) == 0 || !lo.Contains(body.RelatedUsers, member.AccountID) { + if len(body.RelatedUsers) != 0 && lo.Contains(body.RelatedUsers, member.Account.ExternalID) { metionedUsers = append(metionedUsers, member.Account) - break } + continue default: break } - if lo.Contains(body.RelatedUsers, member.AccountID) { + if lo.Contains(body.RelatedUsers, member.Account.ExternalID) { metionedUsers = append(metionedUsers, member.Account) } else { pendingUsers = append(pendingUsers, member.Account)