]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
New option to disable the fetching of parents
[friendica.git] / src / Model / Contact.php
index 01ef3d664e35b0d1108f923da7fe7f75ef7be1cd..c873c3941e8c912519e39aea97e868a661c2f769 100644 (file)
@@ -703,6 +703,7 @@ class Contact
                }
 
                $file_suffix = 'jpg';
+               $url = DI::baseUrl() . '/profile/' . $user['nickname'];
 
                $fields = [
                        'name'         => $profile['name'],
@@ -717,7 +718,10 @@ class Contact
                        'xmpp'         => $profile['xmpp'],
                        'matrix'       => $profile['matrix'],
                        'network'      => Protocol::DFRN,
-                       'url'          => DI::baseUrl() . '/profile/' . $user['nickname'],
+                       'url'          => $url,
+                       // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
+                       'nurl'         => Strings::normaliseLink($url),
+                       'uri-id'       => ItemURI::getIdByURI($url),
                        'addr'         => $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3),
                        'request'      => DI::baseUrl() . '/dfrn_request/' . $user['nickname'],
                        'notify'       => DI::baseUrl() . '/dfrn_notify/' . $user['nickname'],
@@ -726,9 +730,6 @@ class Contact
                        'poco'         => DI::baseUrl() . '/poco/' . $user['nickname'],
                ];
 
-               // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
-               $fields['nurl'] = Strings::normaliseLink($fields['url']);
-               $fields['uri-id'] = ItemURI::getIdByURI($fields['url']);
 
                $avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]);
                if (DBA::isResult($avatar)) {
@@ -2448,7 +2449,7 @@ class Contact
 
                $new_pubkey = $ret['pubkey'] ?? '';
 
-               if ($uid == 0) {
+               if ($uid == 0 && DI::config()->get('system', 'fetch_featured_posts')) {
                        if ($ret['network'] == Protocol::ACTIVITYPUB) {
                                $apcontact = APContact::getByURL($ret['url'], false);
                                if (!empty($apcontact['featured'])) {