Add ID to Like and Undo

This commit is contained in:
Diogo Cordeiro 2018-08-01 00:50:31 +01:00
parent 83f5c513b4
commit aac82c7b2a
2 changed files with 11 additions and 5 deletions

View File

@ -55,6 +55,7 @@ class Activitypub_like extends Managed_DataObject
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => common_root_url().'like_from_'.urlencode($actor).'_to_'.urlencode($object),
"type" => "Like",
"actor" => $actor,
"object" => $object

View File

@ -49,11 +49,16 @@ class Activitypub_undo extends Managed_DataObject
*/
public static function undo_to_array($object)
{
$res = array("@context" => "https://www.w3.org/ns/activitystreams",
"type" => "Undo",
"actor" => $object["actor"],
"object" => $object
);
$res = [
'@context' => [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
],
'id' => $object['id'].'/undo',
'type' => 'Undo',
'actor' => $object['actor'],
'object' => $object
];
return $res;
}
}