diff --git a/src/app_service/service/chat/service.nim b/src/app_service/service/chat/service.nim index 4373ac356c..2688afbfb6 100644 --- a/src/app_service/service/chat/service.nim +++ b/src/app_service/service/chat/service.nim @@ -110,9 +110,12 @@ QtObject: # Handling chat updates if (receivedData.chats.len > 0): + var chats: seq[ChatDto] = @[] for chatDto in receivedData.chats: - self.updateOrAddChat(chatDto) - self.events.emit(SIGNAL_CHAT_UPDATE, ChatUpdateArgsNew(messages: receivedData.messages, chats: receivedData.chats)) + if (chatDto.active): + chats.add(chatDto) + self.updateOrAddChat(chatDto) + self.events.emit(SIGNAL_CHAT_UPDATE, ChatUpdateArgsNew(messages: receivedData.messages, chats: chats)) proc init*(self: Service) = self.doConnect() diff --git a/src/app_service/service/message/service.nim b/src/app_service/service/message/service.nim index 080dad3169..a6384ec58d 100644 --- a/src/app_service/service/message/service.nim +++ b/src/app_service/service/message/service.nim @@ -138,6 +138,9 @@ QtObject: error "error: received `chats` array for handling messages update is empty" return + if (not chats[0].active): + return + let chatId = chats[0].id let chatType = chats[0].chatType let unviewedMessagesCount = chats[0].unviewedMessagesCount