From: Claire Date: Mon, 11 Jan 2021 10:55:42 +0000 (+0100) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=33d30632fb627ba1742eff3e0c5fc84ccd156cdb;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - `app/models/public_feed.rb`: Upstream refactored a bit, glitch-soc had specific code for local-only statuses. Updated glitch-soc's specific code accordingly. --- 33d30632fb627ba1742eff3e0c5fc84ccd156cdb diff --cc app/models/public_feed.rb index 2839da5cb,5e4c3e1ce..2528ef1b6 --- a/app/models/public_feed.rb +++ b/app/models/public_feed.rb @@@ -35,12 -33,10 +35,14 @@@ class PublicFee private + attr_reader :account, :options + + def allow_local_only? - local_account? && (local_only? || @options[:allow_local_only]) ++ local_account? && (local_only? || options[:allow_local_only]) + end + def with_reblogs? - @options[:with_reblogs] + options[:with_reblogs] end def with_replies? @@@ -56,15 -52,11 +58,15 @@@ end def account? - @account.present? + account.present? end + def local_account? - @account&.local? ++ account&.local? + end + def media_only? - @options[:only_media] + options[:only_media] end def public_scope @@@ -91,14 -83,10 +93,14 @@@ Status.joins(:media_attachments).group(:id) end + def without_local_only_scope + Status.not_local_only + end + def account_filters_scope - Status.not_excluded_by_account(@account).tap do |scope| - scope.merge!(Status.not_domain_blocked_by_account(@account)) unless local_only? - scope.merge!(Status.in_chosen_languages(@account)) if @account.chosen_languages.present? + Status.not_excluded_by_account(account).tap do |scope| + scope.merge!(Status.not_domain_blocked_by_account(account)) unless local_only? + scope.merge!(Status.in_chosen_languages(account)) if account.chosen_languages.present? end end end