This repository has been archived on 2024-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
2017-08-08 15:52:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ActivityPub::Activity::Update < ActivityPub::Activity
|
2018-05-02 10:08:16 -04:00
|
|
|
SUPPORTED_TYPES = %w(Application Group Organization Person Service).freeze
|
|
|
|
|
2017-08-08 15:52:15 -04:00
|
|
|
def perform
|
2018-05-02 10:08:16 -04:00
|
|
|
update_account if equals_or_includes_any?(@object['type'], SUPPORTED_TYPES)
|
2017-08-08 15:52:15 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def update_account
|
|
|
|
return if @account.uri != object_uri
|
2018-08-26 14:21:03 -04:00
|
|
|
ActivityPub::ProcessAccountService.new.call(@account.username, @account.domain, @object, signed_with_known_key: true)
|
2017-08-08 15:52:15 -04:00
|
|
|
end
|
|
|
|
end
|