// 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]);
}
}
// 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);
}
}
// 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`)