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://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1' 'https://w3id.org/security/v1'
], ],
'id' => common_root_url().'like_from_'.urlencode($actor).'_to_'.urlencode($object),
"type" => "Like", "type" => "Like",
"actor" => $actor, "actor" => $actor,
"object" => $object "object" => $object

View File

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