fix: remove messages when leaving a channel to avoid duplication when rejoining a chat
This commit is contained in:
parent
2bd3932cec
commit
2183cabad5
|
@ -25,7 +25,7 @@ proc handleChatEvents(self: ChatController) =
|
|||
self.view.setActiveChannel(channel.chat.id)
|
||||
|
||||
self.status.events.on("channelLeft") do(e: Args):
|
||||
discard self.view.chats.removeChatItemFromList(self.view.activeChannel.chatItem.id)
|
||||
self.view.removeChat(self.view.activeChannel.chatItem.id)
|
||||
|
||||
self.status.events.on("activeChannelChanged") do(e: Args):
|
||||
self.view.setActiveChannel(ChatIdArg(e).chatId)
|
||||
|
|
|
@ -195,6 +195,11 @@ QtObject:
|
|||
proc leaveActiveChat*(self: ChatsView) {.slot.} =
|
||||
self.status.chat.leave(self.activeChannel.id)
|
||||
|
||||
proc removeChat*(self: ChatsView, chatId: string) =
|
||||
discard self.chats.removeChatItemFromList(chatId)
|
||||
self.messageList[chatId].delete
|
||||
self.messageList.del(chatId)
|
||||
|
||||
proc clearChatHistory*(self: ChatsView, id: string) {.slot.} =
|
||||
self.status.chat.clearHistory(id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue