X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FAddContact.php;h=b27c54ed76f885d889f61cc5d3687aecc1ad210a;hb=f61fd93db02bc2d66e1473ca34dc1154e77217a3;hp=700802ca8bd6d7548f944c4a3e9fde01e30e2a10;hpb=13a10b8f20ac7c5927c39d9e80e1a7d515385736;p=friendica.git diff --git a/src/Worker/AddContact.php b/src/Worker/AddContact.php index 700802ca8b..b27c54ed76 100644 --- a/src/Worker/AddContact.php +++ b/src/Worker/AddContact.php @@ -1,6 +1,6 @@ $uid, 'url' => $url, 'result' => $result]); + try { + if ($uid == 0) { + // Adding public contact + $result = Contact::getIdForURL($url); + DI::logger()->info('Added public contact', ['url' => $url, 'result' => $result]); + return; + } + + $result = Contact::createFromProbeForUser($uid, $url); + DI::logger()->info('Added contact for user', ['uid' => $uid, 'url' => $url, 'result' => $result]); + } catch (InternalServerErrorException $e) { + DI::logger()->warning('Internal server error.', ['exception' => $e, 'uid' => $uid, 'url' => $url]); + } catch (NotFoundException $e) { + DI::logger()->notice('uid not found.', ['exception' => $e, 'uid' => $uid, 'url' => $url]); + } catch (\ImagickException $e) { + DI::logger()->notice('Imagick not found.', ['exception' => $e, 'uid' => $uid, 'url' => $url]); + } } }