fix(@desktop/chat): mentions badge cleanup

This commit is contained in:
Andrei Smirnov 2021-07-16 08:48:56 +03:00 committed by Iuri Matias
parent 1acbc76cc9
commit 011b7804ef
1 changed files with 2 additions and 0 deletions

View File

@ -341,6 +341,7 @@ proc markAllChannelMessagesRead*(self: ChatModel, chatId: string): JsonNode =
result = parseJson(response) result = parseJson(response)
if self.channels.hasKey(chatId): if self.channels.hasKey(chatId):
self.channels[chatId].unviewedMessagesCount = 0 self.channels[chatId].unviewedMessagesCount = 0
self.channels[chatId].mentionsCount = 0
self.events.emit("channelUpdate", ChatUpdateArgs(messages: @[], chats: @[self.channels[chatId]], contacts: @[])) self.events.emit("channelUpdate", ChatUpdateArgs(messages: @[], chats: @[self.channels[chatId]], contacts: @[]))
proc markMessagesSeen*(self: ChatModel, chatId: string, messageIds: seq[string]): JsonNode = proc markMessagesSeen*(self: ChatModel, chatId: string, messageIds: seq[string]): JsonNode =
@ -348,6 +349,7 @@ proc markMessagesSeen*(self: ChatModel, chatId: string, messageIds: seq[string])
result = parseJson(response) result = parseJson(response)
if self.channels.hasKey(chatId): if self.channels.hasKey(chatId):
self.channels[chatId].unviewedMessagesCount = 0 self.channels[chatId].unviewedMessagesCount = 0
self.channels[chatId].mentionsCount = 0
self.events.emit("channelUpdate", ChatUpdateArgs(messages: @[], chats: @[self.channels[chatId]], contacts: @[])) self.events.emit("channelUpdate", ChatUpdateArgs(messages: @[], chats: @[self.channels[chatId]], contacts: @[]))
proc confirmJoiningGroup*(self: ChatModel, chatId: string) = proc confirmJoiningGroup*(self: ChatModel, chatId: string) =