Remove community from list after being kicked/banned from it

Fixes #2517
This commit is contained in:
Richard Ramos 2021-06-02 10:36:48 -04:00 committed by Iuri Matias
parent 386625209d
commit 78f7bddb36
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,10 @@ proc handleChatEvents(self: ChatController) =
self.view.reactions.push(evArgs.emojiReactions)
if (evArgs.communities.len > 0):
for community in evArgs.communities:
if self.view.communities.isUserMemberOfCommunity(community.id) and not community.admin and not community.isMember:
discard self.view.communities.leaveCommunity(community.id)
continue
self.view.communities.addCommunityToList(community)
if (self.view.communities.activeCommunity.active and self.view.communities.activeCommunity.communityItem.id == community.id):
if (self.view.activeChannel.chatItem != nil):