diff --git a/src/app/modules/main/chat_section/model.nim b/src/app/modules/main/chat_section/model.nim index f19baddc8d..55773dfb81 100644 --- a/src/app/modules/main/chat_section/model.nim +++ b/src/app/modules/main/chat_section/model.nim @@ -388,13 +388,13 @@ QtObject: result.hasNotifications = false result.notificationsCount = 0 for i in 0 ..< self.items.len: - # if it's category item type is set to `ChatType.Unknown` - # (in one point of time we may start maintaining notifications per category as well) if(self.items[i].BaseItem.`type` == ChatType.Unknown.int): - continue - - result.hasNotifications = result.hasNotifications or self.items[i].BaseItem.hasUnreadMessages - result.notificationsCount = result.notificationsCount + self.items[i].BaseItem.notificationsCount + for subItem in self.items[i].subItems().items(): + result.hasNotifications = result.hasNotifications or subItem.BaseItem.hasUnreadMessages + result.notificationsCount = result.notificationsCount + subItem.BaseItem.notificationsCount + else: + result.hasNotifications = result.hasNotifications or self.items[i].BaseItem.hasUnreadMessages + result.notificationsCount = result.notificationsCount + self.items[i].BaseItem.notificationsCount proc reorderModel*(self: Model, id: string, position: int) = let index = self.getItemIdxById(id) diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index f1f9a22e0c..f101a8f065 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -343,7 +343,8 @@ method activeItemSubItemSet*(self: Module, itemId: string, subItemId: string) = # notify parent module about active chat/channel self.delegate.onActiveChatChange(self.controller.getMySectionId(), self.controller.getActiveChatId()) # update notifications caused by setting active chat/channel - self.controller.markAllMessagesRead(self.controller.getActiveChatId()) + if singletonInstance.localAccountSensitiveSettings.getActiveSection() == self.controller.getMySectionId(): + self.controller.markAllMessagesRead(self.controller.getActiveChatId()) method getModuleAsVariant*(self: Module): QVariant = return self.viewVariant