Merge pull request #10466 from annando/local-follow
Ensure that the network is set for "self" contacts
This commit is contained in:
commit
638723ea1c
2 changed files with 3 additions and 3 deletions
|
@ -630,7 +630,7 @@ class Contact
|
||||||
{
|
{
|
||||||
$fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'avatar', 'prvkey', 'pubkey',
|
$fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'avatar', 'prvkey', 'pubkey',
|
||||||
'xmpp', 'contact-type', 'forum', 'prv', 'avatar-date', 'url', 'nurl', 'unsearchable',
|
'xmpp', 'contact-type', 'forum', 'prv', 'avatar-date', 'url', 'nurl', 'unsearchable',
|
||||||
'photo', 'thumb', 'micro', 'addr', 'request', 'notify', 'poll', 'confirm', 'poco'];
|
'photo', 'thumb', 'micro', 'addr', 'request', 'notify', 'poll', 'confirm', 'poco', 'network'];
|
||||||
$self = DBA::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]);
|
$self = DBA::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]);
|
||||||
if (!DBA::isResult($self)) {
|
if (!DBA::isResult($self)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -655,7 +655,7 @@ class Contact
|
||||||
'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile),
|
'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile),
|
||||||
'about' => $profile['about'], 'keywords' => $profile['pub_keywords'],
|
'about' => $profile['about'], 'keywords' => $profile['pub_keywords'],
|
||||||
'contact-type' => $user['account-type'], 'prvkey' => $user['prvkey'],
|
'contact-type' => $user['account-type'], 'prvkey' => $user['prvkey'],
|
||||||
'pubkey' => $user['pubkey'], 'xmpp' => $profile['xmpp']];
|
'pubkey' => $user['pubkey'], 'xmpp' => $profile['xmpp'], 'network' => Protocol::DFRN];
|
||||||
|
|
||||||
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
|
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
|
||||||
$fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname'];
|
$fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname'];
|
||||||
|
|
|
@ -412,7 +412,7 @@ class User
|
||||||
|
|
||||||
// Check for correct url and normalised nurl
|
// Check for correct url and normalised nurl
|
||||||
$url = DI::baseUrl() . '/profile/' . $owner['nickname'];
|
$url = DI::baseUrl() . '/profile/' . $owner['nickname'];
|
||||||
$repair = ($owner['url'] != $url) || ($owner['nurl'] != Strings::normaliseLink($owner['url']));
|
$repair = empty($owner['network']) || ($owner['url'] != $url) || ($owner['nurl'] != Strings::normaliseLink($owner['url']));
|
||||||
|
|
||||||
if (!$repair) {
|
if (!$repair) {
|
||||||
// Check if "addr" is present and correct
|
// Check if "addr" is present and correct
|
||||||
|
|
Loading…
Reference in a new issue