]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5079 from annando/fix-self
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 18 May 2018 12:54:00 +0000 (08:54 -0400)
committerGitHub <noreply@github.com>
Fri, 18 May 2018 12:54:00 +0000 (08:54 -0400)
Fix: Sometimes the contact endpoints seem to be wrong

src/Model/Contact.php

index d5f63554fb3636c620472156e6108fc1ef873fca..03f5a36db1b4a4cab2d3fedefd21e15df69c8e4c 100644 (file)
@@ -206,6 +206,16 @@ class Contact extends BaseObject
                $fields['forum'] = $user['page-flags'] == PAGE_COMMUNITY;
                $fields['prv'] = $user['page-flags'] == PAGE_PRVGROUP;
 
+               // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
+               $fields['url'] = System::baseUrl() . '/profile/' . $user['nickname'];
+               $fields['nurl'] = normalise_link($fields['url']);
+               $fields['addr'] = $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
+               $fields['request'] = System::baseUrl() . '/dfrn_request/' . $user['nickname'];
+               $fields['notify'] = System::baseUrl() . '/dfrn_notify/'  . $user['nickname'];
+               $fields['poll'] = System::baseUrl() . '/dfrn_poll/'    . $user['nickname'];
+               $fields['confirm'] = System::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
+               $fields['poco'] = System::baseUrl() . '/poco/'         . $user['nickname'];
+
                $update = false;
 
                foreach ($fields as $field => $content) {