mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-29 02:50:46 +00:00
Fix blocked accounts not being automatically removed from trending statuses (#34891)
This commit is contained in:
parent
4632be68eb
commit
980c336ca4
|
|
@ -106,7 +106,15 @@ class Trends::Statuses < Trends::Base
|
|||
private
|
||||
|
||||
def eligible?(status)
|
||||
status.created_at.past? && status.public_visibility? && status.account.discoverable? && !status.account.silenced? && !status.account.sensitized? && status.spoiler_text.blank? && !status.sensitive? && !status.reply? && valid_locale?(status.language)
|
||||
status.created_at.past? &&
|
||||
status.public_visibility? &&
|
||||
status.account.discoverable? &&
|
||||
!status.account.silenced? &&
|
||||
!status.account.sensitized? &&
|
||||
status.spoiler_text.blank? &&
|
||||
!status.sensitive? &&
|
||||
!status.reply? &&
|
||||
valid_locale?(status.language)
|
||||
end
|
||||
|
||||
def calculate_scores(statuses, at_time)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class SuspendAccountService < BaseService
|
|||
unmerge_from_home_timelines!
|
||||
unmerge_from_list_timelines!
|
||||
privatize_media_attachments!
|
||||
remove_from_trends!
|
||||
end
|
||||
|
||||
private
|
||||
|
|
@ -101,6 +102,10 @@ class SuspendAccountService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
def remove_from_trends!
|
||||
StatusTrend.where(account: @account).delete_all
|
||||
end
|
||||
|
||||
def signed_activity_json
|
||||
@signed_activity_json ||= Oj.dump(serialize_payload(@account, ActivityPub::UpdateSerializer, signer: @account))
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user