]> git.mxchange.org Git - friendica.git/commitdiff
Fix: updateFromProbe failed when updating non-federated networks
authorMichael <heluecht@pirati.ca>
Fri, 20 Sep 2019 21:01:52 +0000 (21:01 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 20 Sep 2019 21:01:52 +0000 (21:01 +0000)
src/Model/Contact.php

index 23d4ec62d6f00116771d8d39688973deec511a22..6f0de5acd960e2c9bcf9db98f3f84c2eebb32e0b 100644 (file)
@@ -1463,7 +1463,6 @@ class Contact extends BaseObject
 
                if (empty($data)) {
                        $data = Probe::uri($url, "", $uid);
-
                        // Ensure that there is a gserver entry
                        if (!empty($data['baseurl']) && ($data['network'] != Protocol::PHANTOM)) {
                                PortableContact::checkServer($data['baseurl']);
@@ -2022,9 +2021,8 @@ class Contact extends BaseObject
                        return true;
                }
 
-               // If Probe::uri fails the network code will be different (mostly "feed" or "unkn")
-               if (!in_array($ret['network'], Protocol::NATIVE_SUPPORT) ||
-                       (in_array($ret['network'], [Protocol::FEED, Protocol::PHANTOM]) && ($ret['network'] != $contact['network']))) {
+               // If Probe::uri fails the network code will be different ("feed" or "unkn")
+               if (in_array($ret['network'], [Protocol::FEED, Protocol::PHANTOM]) && ($ret['network'] != $contact['network'])) {
                        if ($force && ($uid == 0)) {
                                self::updateContact($id, $uid, $ret['url'], ['last-update' => $updated, 'failure_update' => $updated]);
                        }
@@ -2064,7 +2062,7 @@ class Contact extends BaseObject
                        }
                }
 
-               if ($ret['network'] != Protocol::FEED) {
+               if (!empty($ret['photo']) && ($ret['network'] != Protocol::FEED)) {
                        self::updateAvatar($ret['photo'], $uid, $id, $update || $force);
                }