{\r
if (ActivityPub::isRequest()) {\r
$user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]);\r
+ $data = [];\r
if (DBA::isResult($user)) {\r
$data = ActivityPub\Transmitter::getProfile($user['uid']);\r
+ }\r
+\r
+ if (!empty($data)) {\r
System::jsonExit($data, 'application/activity+json');\r
} elseif (DBA::exists('userd', ['username' => self::$which])) {\r
// Known deleted user\r
- System::httpExit(410);\r
+ $data = [\r
+ '@context' => ActivityPub::CONTEXT,\r
+ 'id' => System::baseUrl() . '/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
+\r
+ System::jsonError(410, $data);\r
} else {\r
- // Unknown user\r
- System::httpExit(404);\r
+ // Any other case (unknown, blocked, unverified, expired, no profile, no self contact)\r
+ System::jsonError(404, $data);\r
}\r
}\r
}\r