Skip to content
Snippets Groups Projects
Commit e482595a authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Add ActivityPub handler for Delete->Actor activities (#4761)

parent 9c04fade
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,20 @@
class ActivityPub::Activity::Delete < ActivityPub::Activity
def perform
if @account.uri == object_uri
delete_person
else
delete_note
end
end
private
def delete_person
SuspendAccountService.new.call(@account)
end
def delete_note
status = Status.find_by(uri: object_uri, account: @account)
status ||= Status.find_by(uri: @object['_:atomUri'], account: @account) if @object.is_a?(Hash) && @object['_:atomUri'].present?
......@@ -13,8 +27,6 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
delete_now!(status)
end
private
def forward_for_reblogs(status)
return if @json['signature'].blank?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment