diff options
author | David Yip <yipdw@member.fsf.org> | 2018-02-09 09:25:53 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-02-09 09:25:53 -0600 |
commit | 020b40efdb2e4ddac14bea81ad60512d51eb7fe5 (patch) | |
tree | b9afe17c1257490af354f76d6e1c1f1b3788e546 /app/lib | |
parent | 5ba2c300d8ab0e3adc58a380162b66abafbb3bb8 (diff) | |
parent | 235c14c79d620d47012a08425324df222a136457 (diff) |
Merge remote-tracking branch 'origin/master' into merge-upstream
Conflicts: .travis.yml app/lib/user_settings_decorator.rb app/models/user.rb app/serializers/initial_state_serializer.rb app/views/stream_entries/_detailed_status.html.haml app/views/stream_entries/_simple_status.html.haml config/locales/simple_form.en.yml
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/user_settings_decorator.rb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 5f0176f27..c7afdacc2 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -15,20 +15,21 @@ class UserSettingsDecorator private def process_update - user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails') - user.settings['interactions'] = merged_interactions if change?('interactions') - user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy') - user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive') - user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal') - user.settings['boost_modal'] = boost_modal_preference if change?('setting_boost_modal') + user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails') + user.settings['interactions'] = merged_interactions if change?('interactions') + user.settings['default_privacy'] = default_privacy_preference if change?('setting_default_privacy') + user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive') + user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal') + user.settings['boost_modal'] = boost_modal_preference if change?('setting_boost_modal') user.settings['favourite_modal'] = favourite_modal_preference if change?('setting_favourite_modal') - user.settings['delete_modal'] = delete_modal_preference if change?('setting_delete_modal') - user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') - 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['flavour'] = flavour_preference if change?('setting_flavour') - user.settings['skin'] = skin_preference if change?('setting_skin') + user.settings['delete_modal'] = delete_modal_preference if change?('setting_delete_modal') + user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') + user.settings['display_sensitive_media'] = display_sensitive_media_preference if change?('setting_display_sensitive_media') + 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['flavour'] = flavour_preference if change?('setting_flavour') + user.settings['skin'] = skin_preference if change?('setting_skin') end def merged_notification_emails @@ -71,6 +72,10 @@ class UserSettingsDecorator boolean_cast_setting 'setting_auto_play_gif' end + def display_sensitive_media_preference + boolean_cast_setting 'setting_display_sensitive_media' + end + def reduce_motion_preference boolean_cast_setting 'setting_reduce_motion' end |