From f35e8264859318f170c2cb4aa55ce765fb3bad3f Mon Sep 17 00:00:00 2001
From: Jedi18 <targetakhil@gmail.com>
Date: Sun, 14 Feb 2021 19:57:29 +0530
Subject: [PATCH] Fix room list updating on adding to hidden tag or removing
 tag

---
 src/CommunitiesList.cpp | 3 +++
 src/CommunitiesList.h   | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/CommunitiesList.cpp b/src/CommunitiesList.cpp
index 77e6368a0..8bc71d912 100644
--- a/src/CommunitiesList.cpp
+++ b/src/CommunitiesList.cpp
@@ -65,6 +65,7 @@ CommunitiesList::setCommunities(const mtx::responses::JoinedGroups &response)
                 addCommunity(group);
 
         communities_["world"]->setPressedState(true);
+        selectedCommunity_ = "world";
         emit communityChanged("world");
         sortEntries();
 }
@@ -74,6 +75,7 @@ CommunitiesList::syncTags(const std::map<QString, RoomInfo> &info)
 {
         for (const auto &room : info)
                 setTagsForRoom(room.first, room.second.tags);
+        emit communityChanged(selectedCommunity_);
         sortEntries();
 }
 
@@ -231,6 +233,7 @@ CommunitiesList::highlightSelectedCommunity(const QString &community_id)
                 return;
         }
 
+        selectedCommunity_ = community_id;
         emit communityChanged(community_id);
 
         for (const auto &community : communities_) {
diff --git a/src/CommunitiesList.h b/src/CommunitiesList.h
index d62beb8d0..5113e7edc 100644
--- a/src/CommunitiesList.h
+++ b/src/CommunitiesList.h
@@ -53,6 +53,7 @@ private:
                 return communities_.find(id) != communities_.end();
         }
 
+        QString selectedCommunity_;
         QVBoxLayout *topLayout_;
         QVBoxLayout *contentsLayout_;
         QScrollArea *scrollArea_;
-- 
GitLab