mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Unset hidden space when space is left
This commit is contained in:
parent
e49a65e69e
commit
eb2c87f060
1 changed files with 11 additions and 0 deletions
|
@ -556,6 +556,11 @@ CommunitiesModel::sync(const mtx::responses::Sync &sync_)
|
||||||
(void)room;
|
(void)room;
|
||||||
if (spaces_.count(QString::fromStdString(roomid)))
|
if (spaces_.count(QString::fromStdString(roomid)))
|
||||||
tagsUpdated = true;
|
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) {
|
for (const auto &e : sync_.account_data.events) {
|
||||||
if (auto event =
|
if (auto event =
|
||||||
|
@ -633,6 +638,12 @@ CommunitiesModel::toggleTagId(QString tagId)
|
||||||
hiddenTagIds_.removeOne(tagId);
|
hiddenTagIds_.removeOne(tagId);
|
||||||
else
|
else
|
||||||
hiddenTagIds_.push_back(tagId);
|
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_);
|
UserSettings::instance()->setHiddenTags(hiddenTagIds_);
|
||||||
|
|
||||||
if (tagId.startsWith(QLatin1String("tag:"))) {
|
if (tagId.startsWith(QLatin1String("tag:"))) {
|
||||||
|
|
Loading…
Reference in a new issue