]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Issue 8371: More enhanced logging
[friendica.git] / src / Model / Contact.php
index 0e542316dbabbd0d1890fbda2339af5f6142d555..9ae27994c7e33e3f19b899f411a3b11ff831e368 100644 (file)
@@ -1621,6 +1621,9 @@ class Contact
                                // Update the gcontact entry
                                if ($uid == 0) {
                                        GContact::updateFromPublicContactID($contact_id);
+                                       if (($data['network'] == Protocol::ACTIVITYPUB) && in_array(DI::config()->get('system', 'gcontact_discovery'), [GContact::DISCOVERY_DIRECT, GContact::DISCOVERY_RECURSIVE])) {
+                                               GContact::discoverFollowers($data['url']);
+                                       }
                                }
                        }
                } else {
@@ -1911,19 +1914,24 @@ class Contact
         * @param int    $cid    Contact id
         * @param bool   $force  force picture update
         *
-        * @return array Returns array of the different avatar sizes
+        * @return void
         * @throws HTTPException\InternalServerErrorException
+        * @throws HTTPException\NotFoundException
         * @throws \ImagickException
         */
        public static function updateAvatar($avatar, $uid, $cid, $force = false)
        {
                $contact = DBA::selectFirst('contact', ['avatar', 'photo', 'thumb', 'micro', 'nurl'], ['id' => $cid, 'self' => false]);
                if (!DBA::isResult($contact)) {
-                       return false;
-               } else {
-                       $data = [$contact["photo"], $contact["thumb"], $contact["micro"]];
+                       return;
                }
 
+               $data = [
+                       $contact['photo'] ?? '',
+                       $contact['thumb'] ?? '',
+                       $contact['micro'] ?? '',
+               ];
+
                foreach ($data as $image_uri) {
                        $image_rid = Photo::ridFromURI($image_uri);
                        if ($image_rid && !Photo::exists(['resource-id' => $image_rid, 'uid' => $uid])) {
@@ -1946,12 +1954,8 @@ class Contact
                                                DBA::update('contact', $fields, ['id' => $pcontact['id']]);
                                        }
                                }
-
-                               return $photos;
                        }
                }
-
-               return $data;
        }
 
        /**