// These fields aren't updated by this routine:
// 'xmpp', 'sensitive'
- $fields = ['uid', 'avatar', 'header', 'name', 'nick', 'location', 'keywords', 'about', 'subscribe',
- 'manually-approve', 'unsearchable', 'url', 'addr', 'batch', 'notify', 'poll', 'request', 'confirm', 'poco',
+ $fields = ['uid', 'uri-id', 'avatar', 'header', 'name', 'nick', 'location', 'keywords', 'about', 'subscribe',
+ 'manually-approve', 'unsearchable', 'url', 'guid', 'addr', 'batch', 'notify', 'poll', 'request', 'confirm', 'poco',
'network', 'alias', 'baseurl', 'gsid', 'forum', 'prv', 'contact-type', 'pubkey', 'last-item'];
$contact = DBA::selectFirst('contact', $fields, ['id' => $id]);
if (!DBA::isResult($contact)) {
$uid = $contact['uid'];
unset($contact['uid']);
+ $uriid = $contact['uri-id'];
+ unset($contact['uri-id']);
+
$pubkey = $contact['pubkey'];
unset($contact['pubkey']);
unset($ret['last-item']);
}
+ if (empty($uriid)) {
+ $update = true;
+ }
+
if (!empty($ret['photo']) && ($ret['network'] != Protocol::FEED)) {
self::updateAvatar($id, $ret['photo'], $update);
}
return true;
}
+ if (empty($ret['guid'])) {
+ $ret['uri-id'] = ItemURI::getIdByURI($ret['url']);
+ } else {
+ $ret['uri-id'] = ItemURI::insert(['uri' => $ret['uri'], 'guid' => $ret['guid']]);
+ }
+
$ret['nurl'] = Strings::normaliseLink($ret['url']);
- $ret['uri-id'] = ItemURI::getIdByURI($ret['url']);
$ret['updated'] = $updated;
$ret['failed'] = false;