From 582fd613e0dc6898ec1d6c4f1624e934a95c9c57 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 4 Jul 2021 14:17:10 +0000 Subject: [PATCH] Ensure that the network is set for "self" contac ts --- src/Model/Contact.php | 4 ++-- src/Model/User.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index a45145d9c..c18c678eb 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -630,7 +630,7 @@ class Contact { $fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'avatar', 'prvkey', 'pubkey', '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]); if (!DBA::isResult($self)) { return false; @@ -655,7 +655,7 @@ class Contact 'avatar-date' => $self['avatar-date'], 'location' => Profile::formatLocation($profile), 'about' => $profile['about'], 'keywords' => $profile['pub_keywords'], '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. $fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname']; diff --git a/src/Model/User.php b/src/Model/User.php index 14f40662b..bc3536acf 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -412,7 +412,7 @@ class User // Check for correct url and normalised nurl $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) { // Check if "addr" is present and correct