]> git.mxchange.org Git - friendica.git/commitdiff
More often update Diaspora contacts
authorMichael <heluecht@pirati.ca>
Thu, 30 Dec 2021 22:40:52 +0000 (22:40 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 30 Dec 2021 22:40:52 +0000 (22:40 +0000)
src/Model/Contact.php
src/Model/FContact.php

index 8c946502b190fd56c9e4de34bd6300c5320828e3..96ffc53468fa8e968e3819f9a0a13011f331733f 100644 (file)
@@ -1241,6 +1241,10 @@ class Contact
                        Logger::info('Contact will be updated', ['url' => $url, 'uid' => $uid, 'update' => $update, 'cid' => $contact_id]);
                }
 
+               if ($data['network'] == Protocol::DIASPORA) {
+                       FContact::updateFromProbeArray($data);
+               }
+
                self::updateFromProbeArray($contact_id, $data);
 
                // Don't return a number for a deleted account
@@ -2076,6 +2080,11 @@ class Contact
                }
 
                $ret = Probe::uri($contact['url'], $network, $contact['uid']);
+
+               if ($ret['network'] == Protocol::DIASPORA) {
+                       FContact::updateFromProbeArray($ret);
+               }
+
                return self::updateFromProbeArray($id, $ret);
        }
 
index 09ee3fb3d5dbb1d824e3a9376d8f206c46feb91f..f78da626cbb6238dd73c45e0a25e2db44535c87c 100644 (file)
@@ -75,7 +75,7 @@ class FContact
                        // Note that Friendica contacts will return a "Diaspora person"
                        // if Diaspora connectivity is enabled on their server
                        if ($data['network'] ?? '' === Protocol::DIASPORA) {
-                               self::updateFContact($data);
+                               self::updateFromProbeArray($data);
 
                                $person = self::getByURL($handle, false);
                        }
@@ -90,7 +90,7 @@ class FContact
         * @param array $arr The fcontact data
         * @throws \Exception
         */
-       private static function updateFContact($arr)
+       public static function updateFromProbeArray($arr)
        {
                $uriid = ItemURI::insert(['uri' => $arr['url'], 'guid' => $arr['guid']]);