X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FAPContact.php;h=b519655e13bbe97e57377a5e12ae3505957bac40;hb=f059e56e0f82e64024da7dcbb1ecac20ad84c1b5;hp=0a9d45f3538d6fdc9abb51915f2ad55433be5ee8;hpb=a1ee75eba7a4d712adfbcdf578e4aca94789be6a;p=friendica.git diff --git a/src/Model/APContact.php b/src/Model/APContact.php index 0a9d45f353..b519655e13 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -1,6 +1,6 @@ $url]); return []; } @@ -178,8 +180,12 @@ class APContact } if (Network::isLocalLink($url) && ($local_uid = User::getIdForURL($url))) { - $data = Transmitter::getProfile($local_uid); - $local_owner = User::getOwnerDataById($local_uid); + try { + $data = Transmitter::getProfile($local_uid); + $local_owner = User::getOwnerDataById($local_uid); + } catch(HTTPException\NotFoundException $e) { + $data = null; + } } if (empty($data)) { @@ -234,6 +240,18 @@ class APContact $apcontact['about'] = HTML::toBBCode(JsonLD::fetchElement($compacted, 'as:summary', '@value')); + $ims = JsonLD::fetchElementArray($compacted, 'vcard:hasInstantMessage'); + if (!empty($ims)) { + foreach ($ims as $link) { + if (substr($link, 0, 5) == 'xmpp:') { + $apcontact['xmpp'] = substr($link, 5); + } + if (substr($link, 0, 7) == 'matrix:') { + $apcontact['matrix'] = substr($link, 7); + } + } + } + $apcontact['photo'] = JsonLD::fetchElement($compacted, 'as:icon', '@id'); if (is_array($apcontact['photo']) || !empty($compacted['as:icon']['as:url']['@id'])) { $apcontact['photo'] = JsonLD::fetchElement($compacted['as:icon'], 'as:url', '@id');