[ActivityPub] Handle DELETE-Person activity

ActivityPubPlugin:
- update grab_notice_from_url to make online grab optional
- subscribe events of user and profile deletion
- bump minor version number

Activitypub_inbox_handler:
- separate handle_delete for delete-note and delete-person

Activitypub_postman:
- add delete-person logic

Activitypub_delete:
- update validation method to check for the "Person" type
- update to_array method to target the activity
This commit is contained in:
tenma
2019-08-27 15:37:01 +01:00
committed by Diogo Cordeiro
parent f79cd8cee3
commit c06182c38f
4 changed files with 141 additions and 32 deletions

View File

@@ -48,10 +48,11 @@ class Activitypub_delete
{
$res = [
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => $object.'/delete',
'type' => 'Delete',
'actor' => $actor,
'object' => $object
'id' => $object.'/delete',
'type' => 'Delete',
'to' => ['https://www.w3.org/ns/activitystreams#Public'],
'actor' => $actor,
'object' => $object
];
return $res;
}
@@ -73,10 +74,10 @@ class Activitypub_delete
} else {
if (!isset($object['type'])) {
throw new Exception('Object type was not specified for Delete Activity.');
} else if ($object['type'] !== "Tombstone") {
}
if ($object['type'] !== "Tombstone" && $object['type'] !== "Person") {
throw new Exception('Invalid Object type for Delete Activity.');
}
if (!isset($object['id'])) {
throw new Exception('Object id was not specified for Delete Activity.');
}