Skip to content
Snippets Groups Projects
Verified Commit eb2c87f0 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Unset hidden space when space is left

parent e49a65e6
No related branches found
No related tags found
No related merge requests found
Pipeline #5311 passed
......@@ -556,6 +556,11 @@ CommunitiesModel::sync(const mtx::responses::Sync &sync_)
(void)room;
if (spaces_.count(QString::fromStdString(roomid)))
tagsUpdated = true;
if (hiddenTagIds_.contains(QString::fromStdString("space:" + roomid))) {
hiddenTagIds_.removeAll(QString::fromStdString("space:" + roomid));
UserSettings::instance()->setHiddenTags(hiddenTagIds_);
tagsUpdated = true;
}
}
for (const auto &e : sync_.account_data.events) {
if (auto event =
......@@ -633,6 +638,12 @@ CommunitiesModel::toggleTagId(QString tagId)
hiddenTagIds_.removeOne(tagId);
else
hiddenTagIds_.push_back(tagId);
// sanity check to remove stale spaces
hiddenTagIds_.removeIf([this](const QString &value) {
return value.startsWith("space:") && !spaces_.contains(value.mid(6));
});
UserSettings::instance()->setHiddenTags(hiddenTagIds_);
if (tagId.startsWith(QLatin1String("tag:"))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment