]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
the detected language was not stored during user creation
[friendica.git] / src / Model / Contact.php
index d5f63554fb3636c620472156e6108fc1ef873fca..bbfb399238df47f38b8c69ad5b9ae2c91430b00a 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) {
@@ -1039,7 +1049,7 @@ class Contact extends BaseObject
 
                $contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
 
-               $r = q(item_query() . " AND `item`.`" . $contact . "` = %d AND " . $sql .
+               $r = q(item_query(local_user()) . " AND `item`.`" . $contact . "` = %d AND " . $sql .
                        " AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d",
                        intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST),
                        intval($a->pager['start']), intval($a->pager['itemspage'])