System::jsonExit($data, 'application/activity+json');\r
} elseif (DBA::exists('userd', ['username' => self::$which])) {\r
// Known deleted user\r
- $data = [\r
- '@context' => ActivityPub::CONTEXT,\r
- 'id' => self::getApp()->getBaseUrl() . '/profile/' . self::$which,\r
- 'type' => 'Tombstone',\r
- 'published' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),\r
- 'updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),\r
- 'deleted' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),\r
- ];\r
+ $data = ActivityPub\Transmitter::getDeletedUser(self::$which);\r
\r
System::jsonError(410, $data);\r
} else {\r
return $data;
}
+ /**
+ * @param string $username
+ * @return array
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ */
+ public static function getDeletedUser($username)
+ {
+ return [
+ '@context' => ActivityPub::CONTEXT,
+ 'id' => System::baseUrl() . '/profile/' . $username,
+ 'type' => 'Tombstone',
+ 'published' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
+ 'updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
+ 'deleted' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
+ ];
+ }
+
/**
* Returns an array with permissions of a given item array
*