🐛 Fix related user detection in notification

This commit is contained in:
LittleSheep 2024-08-01 13:02:41 +08:00
parent 583bec1619
commit 47a5f037c8

View File

@ -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)