]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Merge pull request #10621 from tobiasd/2021.09-CHANGELOG
[friendica.git] / src / Model / APContact.php
index d0a0d0d3f6b7eb4eea5045a5f9ddc7ca4f7544eb..13add7e658939fdd92b9d6871eaf537aebe86c4b 100644 (file)
@@ -239,6 +239,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');