$cachekey = 'apcontact:' . ItemURI::getIdByURI($url);
$result = DI::cache()->get($cachekey);
if (!is_null($result)) {
- Logger::notice('Multiple requests for the address', ['url' => $url, 'update' => $update, 'callstack' => System::callstack(20), 'result' => $result]);
+ Logger::info('Multiple requests for the address', ['url' => $url, 'update' => $update, 'callstack' => System::callstack(20), 'result' => $result]);
if (!empty($fetched_contact)) {
return $fetched_contact;
}
$apcontact['discoverable'] = JsonLD::fetchElement($compacted, 'toot:discoverable', '@value');
- // To-Do
+ if (!empty($apcontact['photo'])) {
+ $apcontact['photo'] = Network::addBasePath($apcontact['photo'], $apcontact['url']);
- // Unhandled
- // tag, attachment, image, nomadicLocations, signature, movedTo, liked
-
- // Unhandled from Misskey
- // sharedInbox, isCat
-
- // Unhandled from Kroeg
- // kroeg:blocks, updated
-
- if (!empty($apcontact['photo']) && !Network::isValidHttpUrl($apcontact['photo'])) {
- Logger::info('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
- $apcontact['photo'] = null;
+ if (!Network::isValidHttpUrl($apcontact['photo'])) {
+ Logger::warning('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
+ $apcontact['photo'] = '';
+ }
}
// When the photo is too large, try to shorten it by removing parts