Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/lib/overrides/extended_account_statuses_filter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true
module Overrides::ExtendedAccountStatusesFilter
include Redisable

KEYS = %i(
pinned
tagged
Expand All @@ -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
Expand Down Expand Up @@ -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