} else {
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
}
- break;
+ break;
case 'repost':
$item = bluesky_get_header($notification, $uri, $uid, $uid);
} else {
Logger::info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]);
}
- break;
+ break;
case 'follow':
$contact = bluesky_get_contact($notification->author, $uid, $uid);
function bluesky_get_contact_fields(stdClass $author, int $uid, int $fetch_uid, bool $update): array
{
- $nick = $author->handle ?? $author->did;
+ $nick = $author->handle ?: $author->did;
$fields = [
'uid' => $uid,
'network' => Protocol::BLUESKY,
'url' => $author->did,
'nurl' => $author->did,
'alias' => BLUESKY_WEB . '/profile/' . $nick,
- 'name' => $author->displayName ?? $nick,
+ 'name' => $author->displayName ?: $nick,
'nick' => $nick,
'addr' => $nick,
];
$data = bluesky_get(bluesky_get_user_pds($uid) . '/xrpc/' . $url, HttpClientAccept::JSON, [HttpClientOptions::HEADERS => ['Authorization' => ['Bearer ' . bluesky_get_token($uid)]]]);
DI::pConfig()->set($uid, 'bluesky', 'status', is_null($data) ? BLUEKSY_STATUS_API_FAIL : BLUEKSY_STATUS_SUCCESS);
return $data;
-
}
function bluesky_get(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ?stdClass