about summary refs log tree commit diff
path: root/app/lib/user_settings_decorator.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-12-18 11:24:44 +0100
committerThibG <thib@sitedethib.com>2018-12-20 14:51:12 +0100
commitbd23288a527bbbe0f8dcdf2a6ad3a585e4aed740 (patch)
tree0b40dfba4acd77911e91a685ff1290dd6e9f150a /app/lib/user_settings_decorator.rb
parent9e04b2e8a4fa6cb45f59000faf2902a727973add (diff)
Add a per-user setting to hide followers count
This is only available if the instance-wide setting isn't set and allows
people to hide their own followers count. This does not hide others' to
them.
Diffstat (limited to 'app/lib/user_settings_decorator.rb')
-rw-r--r--app/lib/user_settings_decorator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb
index 559e00d20..569255f6e 100644
--- a/app/lib/user_settings_decorator.rb
+++ b/app/lib/user_settings_decorator.rb
@@ -30,6 +30,7 @@ class UserSettingsDecorator
     user.settings['reduce_motion']       = reduce_motion_preference if change?('setting_reduce_motion')
     user.settings['system_font_ui']      = system_font_ui_preference if change?('setting_system_font_ui')
     user.settings['noindex']             = noindex_preference if change?('setting_noindex')
+    user.settings['hide_followers_count']= hide_followers_count_preference if change?('setting_hide_followers_count')
     user.settings['flavour']             = flavour_preference if change?('setting_flavour')
     user.settings['skin']                = skin_preference if change?('setting_skin')
     user.settings['hide_network']        = hide_network_preference if change?('setting_hide_network')
@@ -92,6 +93,10 @@ class UserSettingsDecorator
     boolean_cast_setting 'setting_noindex'
   end
 
+  def hide_followers_count_preference
+    boolean_cast_setting 'setting_hide_followers_count'
+  end
+
   def flavour_preference
     settings['setting_flavour']
   end