about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorふぁぼ原 <ko_kurihara@yahoo.co.jp>2018-09-25 12:09:35 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-09-25 05:09:35 +0200
commitf7a6f9489da9b2a1820366654df47b8a52f5c5bc (patch)
treea0c9017fa701de3e6da02f1b1e3c19671d595fc9 /app/models
parent4b794e134d427dbc716606324adb9a885a74abec (diff)
Add a new preference to always hide all media (#8569)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 541b5a638..69fa0688a 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -95,7 +95,7 @@ class User < ApplicationRecord
   has_many :session_activations, dependent: :destroy
 
   delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal,
-           :reduce_motion, :system_font_ui, :noindex, :theme, :display_sensitive_media, :hide_network,
+           :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network,
            :expand_spoilers, :default_language, to: :settings, prefix: :setting, allow_nil: false
 
   attr_reader :invite_code
@@ -316,6 +316,14 @@ class User < ApplicationRecord
     super
   end
 
+  def show_all_media?
+    setting_display_media == 'show_all'
+  end
+
+  def hide_all_media?
+    setting_display_media == 'hide_all'
+  end
+
   protected
 
   def send_devise_notification(notification, *args)