From ad3e4b894e7caa37f6fb91fc844477a7be5dbb91 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 25 Mar 2018 08:20:13 +0000 Subject: [PATCH] Update the public contact --- src/Model/Contact.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index dba6f5266c..d184dacdbf 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -148,7 +148,7 @@ class Contact extends BaseObject public static function updateSelfFromUserID($uid, $update_avatar = false) { $fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'gender', 'avatar', - 'xmpp', 'contact-type', 'forum', 'prv', 'avatar-date']; + 'xmpp', 'contact-type', 'forum', 'prv', 'avatar-date', 'nurl']; $self = dba::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]); if (!DBM::is_result($self)) { return; @@ -211,6 +211,9 @@ class Contact extends BaseObject if ($update) { $fields['name-date'] = DateTimeFormat::utcNow(); dba::update('contact', $fields, ['id' => $self['id']]); + + // Update the public contact as well + dba::update('contact', $fields, ['uid' => 0, 'nurl' => $self['nurl']]); } }