diff options
author | David Yip <yipdw@member.fsf.org> | 2018-05-18 07:53:04 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-05-18 08:47:10 -0500 |
commit | e0eebba46192e5ef2050347069c4098d33e9ec54 (patch) | |
tree | e58d15f7bd6d5c5f5ce53d880a7ad89bf3faaab2 /app/models | |
parent | 4c0770d6c8dac8177b8891a6fb97ccf440100fc2 (diff) | |
parent | 57b503d4ef0754e4651eae26b628cba60e1ab4e9 (diff) |
Merge remote-tracking branch 'origin/master' into merge-upstream
Conflicts: app/controllers/follower_accounts_controller.rb app/controllers/following_accounts_controller.rb app/controllers/settings/preferences_controller.rb app/lib/user_settings_decorator.rb app/models/user.rb config/locales/simple_form.en.yml
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 1 | ||||
-rw-r--r-- | app/models/user.rb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 06c190446..48f284785 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -139,6 +139,7 @@ class Account < ApplicationRecord :moderator?, :staff?, :locale, + :hides_network?, to: :user, prefix: true, allow_nil: true diff --git a/app/models/user.rb b/app/models/user.rb index d5ca9be36..9bdf8807f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -86,7 +86,7 @@ class User < ApplicationRecord has_many :session_activations, dependent: :destroy delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal, - :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_sensitive_media, + :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_sensitive_media, :hide_network, to: :settings, prefix: :setting, allow_nil: false attr_accessor :invite_code @@ -219,6 +219,10 @@ class User < ApplicationRecord settings.notification_emails['digest'] end + def hides_network? + @hides_network ||= settings.hide_network + end + def token_for_app(a) return nil if a.nil? || a.owner != self Doorkeeper::AccessToken |