From bd23288a527bbbe0f8dcdf2a6ad3a585e4aed740 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 18 Dec 2018 11:24:44 +0100 Subject: 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. --- app/lib/user_settings_decorator.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/lib/user_settings_decorator.rb') 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 -- cgit