fix(badge): show badge when mentioned even if channel is muted
Fixes #8723
This commit is contained in:
parent
9825a48eec
commit
9067cc408c
|
@ -719,18 +719,18 @@ method onNewMessagesReceived*(self: Module, sectionIdMsgBelongsTo: string, chatI
|
||||||
|
|
||||||
let chatDetails = self.controller.getChatDetails(chatIdMsgBelongsTo)
|
let chatDetails = self.controller.getChatDetails(chatIdMsgBelongsTo)
|
||||||
|
|
||||||
if (chatDetails.muted):
|
|
||||||
# No need to update the badge nor send a notification
|
|
||||||
return
|
|
||||||
|
|
||||||
# Badge notification
|
# Badge notification
|
||||||
let messageBelongsToActiveSection = sectionIdMsgBelongsTo == self.controller.getMySectionId() and
|
let messageBelongsToActiveSection = sectionIdMsgBelongsTo == self.controller.getMySectionId() and
|
||||||
self.controller.getMySectionId() == self.delegate.getActiveSectionId()
|
self.controller.getMySectionId() == self.delegate.getActiveSectionId()
|
||||||
let messageBelongsToActiveChat = self.controller.getActiveChatId() == chatIdMsgBelongsTo
|
let messageBelongsToActiveChat = self.controller.getActiveChatId() == chatIdMsgBelongsTo
|
||||||
if(not messageBelongsToActiveSection or not messageBelongsToActiveChat):
|
if(not messageBelongsToActiveSection or not messageBelongsToActiveChat):
|
||||||
let hasUnreadMessages = unviewedMessagesCount > 0
|
let hasUnreadMessages = (not chatDetails.muted and unviewedMessagesCount > 0) or unviewedMentionsCount > 0
|
||||||
self.updateBadgeNotifications(chatIdMsgBelongsTo, hasUnreadMessages, unviewedMentionsCount)
|
self.updateBadgeNotifications(chatIdMsgBelongsTo, hasUnreadMessages, unviewedMentionsCount)
|
||||||
|
|
||||||
|
if (chatDetails.muted):
|
||||||
|
# No need to update the badge nor send a notification
|
||||||
|
return
|
||||||
|
|
||||||
# Prepare notification
|
# Prepare notification
|
||||||
let myPK = singletonInstance.userProfile.getPubKey()
|
let myPK = singletonInstance.userProfile.getPubKey()
|
||||||
var notificationType = notification_details.NotificationType.NewMessage
|
var notificationType = notification_details.NotificationType.NewMessage
|
||||||
|
|
Loading…
Reference in New Issue