Update the public contact

This commit is contained in:
Michael 2018-03-25 08:20:13 +00:00
parent abb49150db
commit ad3e4b894e
1 changed files with 4 additions and 1 deletions

View File

@ -148,7 +148,7 @@ class Contact extends BaseObject
public static function updateSelfFromUserID($uid, $update_avatar = false) public static function updateSelfFromUserID($uid, $update_avatar = false)
{ {
$fields = ['id', 'name', 'nick', 'location', 'about', 'keywords', 'gender', 'avatar', $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]); $self = dba::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]);
if (!DBM::is_result($self)) { if (!DBM::is_result($self)) {
return; return;
@ -211,6 +211,9 @@ class Contact extends BaseObject
if ($update) { if ($update) {
$fields['name-date'] = DateTimeFormat::utcNow(); $fields['name-date'] = DateTimeFormat::utcNow();
dba::update('contact', $fields, ['id' => $self['id']]); dba::update('contact', $fields, ['id' => $self['id']]);
// Update the public contact as well
dba::update('contact', $fields, ['uid' => 0, 'nurl' => $self['nurl']]);
} }
} }