diff --git a/app/lib/overrides/extended_account_statuses_filter.rb b/app/lib/overrides/extended_account_statuses_filter.rb index 68e2242..0118159 100644 --- a/app/lib/overrides/extended_account_statuses_filter.rb +++ b/app/lib/overrides/extended_account_statuses_filter.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true module Overrides::ExtendedAccountStatusesFilter + include Redisable + KEYS = %i( pinned tagged @@ -22,6 +24,7 @@ def results scope.merge!(hashtag_scope) if tagged? scope.merge!(only_rebogs_scope) if only_reblogs? scope.merge!(no_direct_statuses_scope) if exclude_direct_statuses? + scope.merge!(custom_scope) if no_boost_channel? scope end @@ -51,4 +54,14 @@ def exclude_original_statuses? def exclude_direct_statuses? truthy_param?(:exclude_direct_statuses) end + + def no_boost_channel? + ServerSetting.find_by(name: "No-Boost")&.value == true + end + + # for custom timelines + def custom_scope + status_ids = redis.zrange(FeedManager.instance.key(:custom, @account.id), 0, -1) + Status.where(id: status_ids).joins(:account).merge(Account.without_suspended.without_silenced) + end end