From 0afc55626abd65e2b11587d6e7fd908b180b0d62 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 18 Nov 2020 13:29:28 +0100 Subject: [PATCH] Fix tags and world buttons leaking as communities leaking over the network --- src/CommunitiesList.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/CommunitiesList.cpp b/src/CommunitiesList.cpp index c1d0706f..9af2ea9b 100644 --- a/src/CommunitiesList.cpp +++ b/src/CommunitiesList.cpp @@ -130,6 +130,16 @@ CommunitiesList::addCommunity(const std::string &group_id) communities_.emplace(id, QSharedPointer(list_item)); contentsLayout_->insertWidget(contentsLayout_->count() - 1, list_item); + connect(list_item, + &CommunitiesListItem::clicked, + this, + &CommunitiesList::highlightSelectedCommunity); + + if (group_id.empty() || group_id.front() != '+') + return; + + nhlog::ui()->debug("Add community: {}", group_id); + connect(this, &CommunitiesList::groupProfileRetrieved, this, @@ -152,10 +162,6 @@ CommunitiesList::addCommunity(const std::string &group_id) communities_.at(id)->setRooms(rooms); }); - connect(list_item, - &CommunitiesListItem::clicked, - this, - &CommunitiesList::highlightSelectedCommunity); http::client()->group_profile( group_id, [id, this](const mtx::responses::GroupProfile &res, mtx::http::RequestErr err) {