]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Fix phpcbf style errors in part of code I didn't change
[friendica.git] / src / Model / APContact.php
index 1fedfc0c79c9a607b707b519a0f1bf71aa21e4fd..215d7e317dcf4a78b973942c87e1b7acc4e07607 100644 (file)
@@ -169,7 +169,7 @@ class APContact
                $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;
                        }
@@ -358,20 +358,13 @@ class APContact
 
                $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