X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=480c8483dba657f5a2beba3644183cf25dde0edf;hb=7d6b1264ec038bc9c3917bc933ba8d02bedadcbc;hp=644662e4ecb8dc91de48dc4c72faa18ae98812b8;hpb=e83e31a968f2965e452d1ee109d31b61da0f0ac2;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 644662e4ec..480c8483db 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -220,6 +220,11 @@ class Contact extends BaseObject // Update the public contact as well dba::update('contact', $fields, ['uid' => 0, 'nurl' => $self['nurl']]); + + // Update the profile + $fields = ['photo' => System::baseUrl() . '/photo/profile/' .$uid . '.jpg', + 'thumb' => System::baseUrl() . '/photo/avatar/' . $uid .'.jpg']; + dba::update('profile', $fields, ['uid' => $uid, 'is-default' => true]); } } @@ -418,7 +423,7 @@ class Contact extends BaseObject // Fetch the data from the gcontact table if (!DBM::is_result($r)) { $s = dba::p("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`, - `keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self` + `keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, 0 AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self` FROM `gcontact` WHERE `nurl` = ?", normalise_link($url)); $r = dba::inArray($s); } @@ -799,7 +804,7 @@ class Contact extends BaseObject $data = Probe::uri($url, "", $uid); // Last try in gcontact for unsupported networks - if (!in_array($data["network"], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_PUMPIO, NETWORK_MAIL])) { + if (!in_array($data["network"], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_PUMPIO, NETWORK_MAIL, NETWORK_FEED])) { if ($uid != 0) { return 0; } @@ -1477,6 +1482,11 @@ class Contact extends BaseObject } // send email notification to owner? } else { + if (dba::exists('contact', ['nurl' => normalise_link($url), 'uid' => $importer['uid'], 'pending' => true])) { + logger('ignoring duplicated connection request from pending contact ' . $url); + return; + } + // create contact record q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`, `blocked`, `readonly`, `pending`, `writable`)