use Friendica\Util\Network;
use Friendica\Util\ParseUrl;
use Friendica\Util\Proxy;
+use Friendica\Worker\UpdateContact;
/**
* Photo Module
$scale = intval(substr($photoid, -1, 1));
$photoid = substr($photoid, 0, -2);
}
+
+ if (!empty($this->parameters['size'])) {
+ switch ($this->parameters['size']) {
+ case 'thumb_small':
+ $scale = 2;
+ break;
+ case 'scaled_full':
+ $scale = 1;
+ break;
+ }
+ }
+
$photo = MPhoto::getPhoto($photoid, $scale);
if ($photo === false) {
throw new HTTPException\NotFoundException(DI::l10n()->t('The Photo with id %s is not available.', $photoid));
Logger::debug('Got return code for avatar', ['return code' => $curlResult->getReturnCode(), 'cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
}
if ($update) {
- Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
- Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id);
+ try {
+ UpdateContact::add(Worker::PRIORITY_LOW, $id);
+ Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
+ } catch (\InvalidArgumentException $e) {
+ Logger::notice($e->getMessage(), ['id' => $id, 'contact' => $contact]);
+ }
} else {
Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
}