X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=ee905a80d38afc99b75a004d8fea779e6fa4b6b5;hb=6dbbd081795fa1c8fe57db2248ac162efeeada88;hp=4898ec56783e57368fab52a946457eeacb5f9d1b;hpb=4208535c16f0e8196effe230cc34141551a7be18;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 4898ec5678..ee905a80d3 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1,6 +1,6 @@ $id]); } + /** + * Fetch the first contact with the provided uri-id. + * + * @param integer $uri_id uri-id of the contact + * @param array $fields Array of selected fields, empty for all + * @return array|boolean Contact record if it exists, false otherwise + * @throws \Exception + */ + public static function getByUriId($uri_id, $fields = []) + { + return DBA::selectFirst('contact', $fields, ['uri-id' => $uri_id], ['order' => ['uid']]); + } + /** * Fetches a contact by a given url * @@ -1228,6 +1241,10 @@ class Contact Logger::info('Contact will be updated', ['url' => $url, 'uid' => $uid, 'update' => $update, 'cid' => $contact_id]); } + if ($data['network'] == Protocol::DIASPORA) { + FContact::updateFromProbeArray($data); + } + self::updateFromProbeArray($contact_id, $data); // Don't return a number for a deleted account @@ -2063,6 +2080,11 @@ class Contact } $ret = Probe::uri($contact['url'], $network, $contact['uid']); + + if ($ret['network'] == Protocol::DIASPORA) { + FContact::updateFromProbeArray($ret); + } + return self::updateFromProbeArray($id, $ret); }