[ActivityPub] Tombstones now have datetimes

This commit is contained in:
Diogo Cordeiro
2020-08-29 22:18:00 +01:00
parent 3f70ac5cde
commit c8e9cbdbb8
4 changed files with 10 additions and 7 deletions

View File

@@ -39,16 +39,19 @@ class Activitypub_tombstone
/**
* Generates an ActivityPub representation of a Tombstone
*
* @param string $id Activity id
* @param int $id Activity id
* @return array pretty array to be used in a response
* @author Diogo Cordeiro <diogo@fc.up.pt>
*/
public static function tombstone_to_array(string $id): array
public static function tombstone_to_array(int $id): array
{
$dead = Deleted_notice::getByID($id);
$res = [
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => $id,
'type' => 'Tombstone'
'id' => Activitypub_notice::getUri($id),
'type' => 'Tombstone',
'created' => str_replace(' ', 'T', $dead->act_created) . 'Z',
'deleted' => str_replace(' ', 'T', $dead->created) . 'Z'
];
return $res;
}