]> git.mxchange.org Git - friendica.git/commitdiff
Force a directory update if previously published
authorMichael <heluecht@pirati.ca>
Wed, 16 Jun 2021 05:23:43 +0000 (05:23 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 16 Jun 2021 05:23:43 +0000 (05:23 +0000)
src/Model/Contact.php
src/Model/Profile.php

index 1b2dd3c9c142349cdca799a4ef256a3154629f55..f196f6f6a7682c8c79e23f821d0e8a2069183994 100644 (file)
@@ -725,6 +725,7 @@ class Contact
                                'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
                        DBA::update('profile', $fields, ['uid' => $uid]);
                }
+
                return $update;
        }
 
index 63d83a8dab043a2bf53468fa320d7229d7c59b40..03e35c02b010a6bf91ed95afdda927d6e0d0ae8d 100644 (file)
@@ -123,7 +123,7 @@ class Profile
                }
 
                if ($update) {
-                       self::publishUpdate($uid);
+                       self::publishUpdate($uid, ($old_owner['net-publish'] != $owner['net-publish']));
                }
 
                return true;
@@ -131,15 +131,17 @@ class Profile
 
        /**
         * Publish a changed profile
-        * @param int $uid 
+        * @param int  $uid
+        * @param bool $force Force publishing to the directory
         */
-       public static function publishUpdate(int $uid)
+       public static function publishUpdate(int $uid, bool $force = false)
        {
                $owner = User::getOwnerDataById($uid);
                if (empty($owner)) {
                        return;
                }
-               if ($owner['net-publish']) {
+
+               if ($owner['net-publish'] || $force) {
                        // Update global directory in background
                        if (Search::getGlobalDirectory()) {
                                Worker::add(PRIORITY_LOW, 'Directory', $owner['url']);