about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorMatt Sweetman <webroo@gmail.com>2018-09-24 04:44:01 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-09-24 05:44:01 +0200
commit1889526e23ce41a37395fdcf89bd415bb2f7546f (patch)
tree0f8f33d2f0502041855db7b943a28250a97196be /app/lib
parentc39183cc628ea9556db53af5059656d6b63609ba (diff)
Add user preference to always expand toots marked with content warnings (#8762)
Diffstat (limited to 'app/lib')
-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 833959397..7239dc194 100644
--- a/app/lib/user_settings_decorator.rb
+++ b/app/lib/user_settings_decorator.rb
@@ -25,6 +25,7 @@ class UserSettingsDecorator
     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['expand_spoilers']         = expand_spoilers_preference if change?('setting_expand_spoilers')
     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')
@@ -72,6 +73,10 @@ class UserSettingsDecorator
     boolean_cast_setting 'setting_display_sensitive_media'
   end
 
+  def expand_spoilers_preference
+    boolean_cast_setting 'setting_expand_spoilers'
+  end
+
   def reduce_motion_preference
     boolean_cast_setting 'setting_reduce_motion'
   end