X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=bbfb399238df47f38b8c69ad5b9ae2c91430b00a;hb=9ea6d4b26d4375502c567276705dff2ff678122e;hp=b7bb0fd53a021921b42f047071dea8d5eb82ead1;hpb=288b508e2a0b985fb7308f2f07a9a3d16d4302c7;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index b7bb0fd53a..bbfb399238 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -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']) @@ -1294,7 +1304,7 @@ class Contact extends BaseObject if (($network != '') && ($ret['network'] != $network)) { logger('Expected network ' . $network . ' does not match actual network ' . $ret['network']); - return result; + return $result; } // check if we already have a contact