diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index 57e17008b..b107a3aa0 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -597,9 +597,13 @@ proc updateBadgeNotifications(self: Module, chat: ChatDto, hasUnreadMessages: bo if (self.chatContentModules.contains(chatId)): self.chatContentModules[chatId].onNotificationsUpdated(hasUnreadMessages, unviewedMentionsCount) - if chat.categoryId != "": - let hasUnreadMessages = self.controller.categoryHasUnreadMessages(chat.communityId, chat.categoryId) - self.view.chatsModel().setCategoryHasUnreadMessages(chat.categoryId, hasUnreadMessages) + if self.isCommunity: + let myCommunity = self.controller.getMyCommunity() + let communityChat = myCommunity.getCommunityChat(chatId) + + if communityChat.categoryId != "": + let hasUnreadMessages = self.controller.categoryHasUnreadMessages(communityChat.communityId, communityChat.categoryId) + self.view.chatsModel().setCategoryHasUnreadMessages(communityChat.categoryId, hasUnreadMessages) self.updateParentBadgeNotifications() diff --git a/src/app_service/service/chat/service.nim b/src/app_service/service/chat/service.nim index 5134037c4..7107b8dad 100644 --- a/src/app_service/service/chat/service.nim +++ b/src/app_service/service/chat/service.nim @@ -181,7 +181,7 @@ QtObject: var args = RpcResponseArgs(e) discard self.processMessengerResponse(args.response) - proc asyncGetActiveChat*(self: Service) = + proc asyncGetActiveChats*(self: Service) = let arg = AsyncGetActiveChatsTaskArg( tptr: cast[ByteAddress](asyncGetActiveChatsTask), vptr: cast[ByteAddress](self.vptr), @@ -213,7 +213,7 @@ QtObject: proc init*(self: Service) = self.doConnect() - self.asyncGetActiveChat() + self.asyncGetActiveChats() proc hasChannel*(self: Service, chatId: string): bool = self.chats.hasKey(chatId) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index f7e849551..9c10e4d79 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -2424,6 +2424,7 @@ QtObject: for chat in self.communities[communityId].chats: if chat.categoryId != categoryId: continue - if (not chat.muted and chat.unviewedMessagesCount > 0) or chat.unviewedMentionsCount > 0: + let chatDto = self.chatService.getChatById(chat.id) + if (not chatDto.muted and chatDto.unviewedMessagesCount > 0) or chatDto.unviewedMentionsCount > 0: return true return false