]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/APContact.php
Merge branch 'develop' into task/mod_hostxrd
[friendica.git] / src / Model / APContact.php
index 161a231f00d89ec958245694a6c4fe243d687099..47bbe7d59f137d21d1c17ad38ccd7a3d19823f41 100644 (file)
@@ -89,12 +89,12 @@ class APContact extends BaseObject
                                $apcontact = DBA::selectFirst('apcontact', [], ['addr' => $url]);
                        }
 
-                       if (DBA::isResult($apcontact) && ($apcontact['updated'] > $ref_update)) {
+                       if (DBA::isResult($apcontact) && ($apcontact['updated'] > $ref_update) && !empty($apcontact['pubkey'])) {
                                return $apcontact;
                        }
 
                        if (!is_null($update)) {
-                               return false;
+                               return DBA::isResult($apcontact) ? $apcontact : false;
                        }
                }
 
@@ -118,7 +118,7 @@ class APContact extends BaseObject
 
                $apcontact = [];
                $apcontact['url'] = $compacted['@id'];
-               $apcontact['uuid'] = JsonLD::fetchElement($compacted, 'diaspora:guid');
+               $apcontact['uuid'] = JsonLD::fetchElement($compacted, 'diaspora:guid', '@value');
                $apcontact['type'] = str_replace('as:', '', JsonLD::fetchElement($compacted, '@type'));
                $apcontact['following'] = JsonLD::fetchElement($compacted, 'as:following', '@id');
                $apcontact['followers'] = JsonLD::fetchElement($compacted, 'as:followers', '@id');