2017-08-09 05:52:15 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ActivityPub::Activity::Update < ActivityPub::Activity
|
2018-05-03 00:08:16 +10:00
|
|
|
SUPPORTED_TYPES = %w(Application Group Organization Person Service).freeze
|
|
|
|
|
2017-08-09 05:52:15 +10:00
|
|
|
def perform
|
2018-05-03 00:08:16 +10:00
|
|
|
update_account if equals_or_includes_any?(@object['type'], SUPPORTED_TYPES)
|
2017-08-09 05:52:15 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def update_account
|
|
|
|
return if @account.uri != object_uri
|
2018-09-19 00:45:58 +10:00
|
|
|
|
2018-08-27 04:21:03 +10:00
|
|
|
ActivityPub::ProcessAccountService.new.call(@account.username, @account.domain, @object, signed_with_known_key: true)
|
2017-08-09 05:52:15 +10:00
|
|
|
end
|
|
|
|
end
|