summary refs log tree commit diff
path: root/src/UserSettingsPage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 00:49:14 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 00:49:28 +0100
commit6ae1a5e8ad4753d90b5adc11fb49216f8bf2b8e1 (patch)
tree9ba45f3ec312b00f8aa0f640242ecb49606e39af /src/UserSettingsPage.cpp
parentAllow users to hide rooms with specific tags (diff)
downloadnheko-6ae1a5e8ad4753d90b5adc11fb49216f8bf2b8e1.tar.xz
Persist hidden tags
Diffstat (limited to 'src/UserSettingsPage.cpp')
-rw-r--r--src/UserSettingsPage.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp
index f90938c9..0e3bd667 100644
--- a/src/UserSettingsPage.cpp
+++ b/src/UserSettingsPage.cpp
@@ -81,6 +81,7 @@ UserSettings::load(std::optional<QString> profile)
         hasAlertOnNotification_  = settings.value("user/alert_on_notification", false).toBool();
         startInTray_             = settings.value("user/window/start_in_tray", false).toBool();
         groupView_               = settings.value("user/group_view", true).toBool();
+        hiddenTags_              = settings.value("user/hidden_tags", QStringList{}).toStringList();
         buttonsInTimeline_       = settings.value("user/timeline/buttons", true).toBool();
         timelineMaxWidth_        = settings.value("user/timeline/max_width", 0).toInt();
         messageHoverHighlight_ =
@@ -185,6 +186,13 @@ UserSettings::setGroupView(bool state)
 }
 
 void
+UserSettings::setHiddenTags(QStringList hiddenTags)
+{
+        hiddenTags_ = hiddenTags;
+        save();
+}
+
+void
 UserSettings::setMarkdown(bool state)
 {
         if (state == markdown_)
@@ -538,6 +546,7 @@ UserSettings::save()
         settings.setValue("minor_events", sortByImportance_);
         settings.setValue("read_receipts", readReceipts_);
         settings.setValue("group_view", groupView_);
+        settings.setValue("hidden_tags", hiddenTags_);
         settings.setValue("markdown_enabled", markdown_);
         settings.setValue("desktop_notifications", hasDesktopNotifications_);
         settings.setValue("alert_on_notification", hasAlertOnNotification_);