]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
No blubb allowed
[friendica.git] / src / Model / Contact.php
index 01ef3d664e35b0d1108f923da7fe7f75ef7be1cd..2c1ca2d4ce279ad1ac63a38ef206f3de34669d74 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)) {