mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 20:15:10 +01:00
Add missing reject_media check before avatar download via ActivityPub (#4862)
This commit is contained in:
parent
3c45d3963a
commit
9e15eeec63
@ -48,14 +48,14 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||||||
@account.url = url || @uri
|
@account.url = url || @uri
|
||||||
@account.display_name = @json['name'] || ''
|
@account.display_name = @json['name'] || ''
|
||||||
@account.note = @json['summary'] || ''
|
@account.note = @json['summary'] || ''
|
||||||
@account.avatar_remote_url = image_url('icon')
|
@account.avatar_remote_url = image_url('icon') unless skip_download?
|
||||||
@account.header_remote_url = image_url('image')
|
@account.header_remote_url = image_url('image') unless skip_download?
|
||||||
@account.public_key = public_key || ''
|
@account.public_key = public_key || ''
|
||||||
@account.locked = @json['manuallyApprovesFollowers'] || false
|
@account.locked = @json['manuallyApprovesFollowers'] || false
|
||||||
@account.statuses_count = outbox_total_items if outbox_total_items.present?
|
@account.statuses_count = outbox_total_items if outbox_total_items.present?
|
||||||
@account.following_count = following_total_items if following_total_items.present?
|
@account.following_count = following_total_items if following_total_items.present?
|
||||||
@account.followers_count = followers_total_items if followers_total_items.present?
|
@account.followers_count = followers_total_items if followers_total_items.present?
|
||||||
@account.save!
|
@account.save_with_optional_media!
|
||||||
end
|
end
|
||||||
|
|
||||||
def upgrade_account
|
def upgrade_account
|
||||||
@ -115,6 +115,10 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||||||
@collections[type] = nil
|
@collections[type] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def skip_download?
|
||||||
|
@account.suspended? || domain_block&.reject_media?
|
||||||
|
end
|
||||||
|
|
||||||
def auto_suspend?
|
def auto_suspend?
|
||||||
domain_block && domain_block.suspend?
|
domain_block && domain_block.suspend?
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user