]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Add more Cookie tests (create new StaticCookie class for mocking setcookie())
[friendica.git] / src / Model / Contact.php
index 2742e49dfac63989624efae3a33318b5a0143ed9..765c44064666c208e3d60478a74b903e29b423f5 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\Protocol\Diaspora;
 use Friendica\Protocol\OStatus;
 use Friendica\Protocol\Salmon;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Images;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
 
@@ -719,7 +720,7 @@ class Contact extends BaseObject
                        }
 
                        // Creating the path to the avatar, beginning with the file suffix
-                       $types = Image::supportedTypes();
+                       $types = Images::supportedTypes();
                        if (isset($types[$avatar['type']])) {
                                $file_suffix = $types[$avatar['type']];
                        }
@@ -1458,11 +1459,15 @@ class Contact extends BaseObject
                        $contact_id = $contact["id"];
 
                        // Update the contact every 7 days
-                       $update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
+                       if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
+                               $update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
 
-                       // We force the update if the avatar is empty
-                       if (empty($contact['avatar'])) {
-                               $update_contact = true;
+                               // We force the update if the avatar is empty
+                               if (empty($contact['avatar'])) {
+                                       $update_contact = true;
+                               }
+                       } else {
+                               $update_contact = false;
                        }
 
                        // Update the contact in the background if needed but it is called by the frontend