Profile redirect notes (#5746)
* Serialize moved accounts into REST and ActivityPub APIs * Parse federated moved accounts from ActivityPub * Add note about moved accounts to public profiles * Add moved account message to web UI * Fix code style issues
This commit is contained in:
parent
6be72a3ec6
commit
58cede4808
18 changed files with 238 additions and 5 deletions
|
@ -74,6 +74,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@account.statuses_count = outbox_total_items if outbox_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.moved_to_account = moved_account if @json['movedTo'].present?
|
||||
end
|
||||
|
||||
def after_protocol_change!
|
||||
|
@ -137,6 +138,12 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@collections[type] = nil
|
||||
end
|
||||
|
||||
def moved_account
|
||||
account = ActivityPub::TagManager.instance.uri_to_resource(@json['movedTo'], Account)
|
||||
account ||= ActivityPub::FetchRemoteAccountService.new.call(@json['movedTo'], id: true)
|
||||
account
|
||||
end
|
||||
|
||||
def skip_download?
|
||||
@account.suspended? || domain_block&.reject_media?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue