From 78f7bddb36352e0012ac0c66461a932923185427 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 2 Jun 2021 10:36:48 -0400 Subject: [PATCH] Remove community from list after being kicked/banned from it Fixes #2517 --- src/app/chat/event_handling.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/chat/event_handling.nim b/src/app/chat/event_handling.nim index 37e6ffd10d..ce6cfc4424 100644 --- a/src/app/chat/event_handling.nim +++ b/src/app/chat/event_handling.nim @@ -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):