diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index f9a0df46f..c494aa7a5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -124,7 +124,7 @@ class User < ApplicationRecord :style_wide_media, :publish_in, :unpublish_in, :unpublish_delete, :boost_every, :boost_jitter, :boost_random, :unpublish_on_delete, :rss_disabled, :no_boosts_home, - :filter_unknown, + :filter_unknown, :max_history_public, :max_history_private, to: :settings, prefix: :setting, allow_nil: false attr_reader :invite_code, :sign_in_token_attempt @@ -271,6 +271,14 @@ class User < ApplicationRecord @filters_unknown ||= settings.filter_unknown end + def max_history_private + @max_history_private ||= settings.max_history_private.to_i + end + + def max_history_public + @max_history_public ||= [settings.max_history_public.to_i, max_history_private].min + end + # rubocop:disable Naming/MethodParameterName def token_for_app(a) return nil if a.nil? || a.owner != self |