X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FAPDelivery.php;h=ce82db249af324d5881d7c98d9a8458c37cf286d;hb=7458d793ed6c5eaa9220bf14e05fa8cb76c122f1;hp=039cdfbb3b6acec830bd6270a378b5825115eb88;hpb=13c5bc807bf9c14ce810e661a2274c989ef8f051;p=friendica.git diff --git a/src/Worker/APDelivery.php b/src/Worker/APDelivery.php index 039cdfbb3b..ce82db249a 100644 --- a/src/Worker/APDelivery.php +++ b/src/Worker/APDelivery.php @@ -5,6 +5,8 @@ namespace Friendica\Worker; use Friendica\BaseObject; +use Friendica\Core\Logger; +use Friendica\Core\Worker; use Friendica\Protocol\ActivityPub; use Friendica\Model\Item; use Friendica\Util\HTTPSignature; @@ -21,20 +23,27 @@ class APDelivery extends BaseObject */ public static function execute($cmd, $item_id, $inbox, $uid) { - logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG); + Logger::log('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, Logger::DEBUG); + + $success = true; if ($cmd == Delivery::MAIL) { } elseif ($cmd == Delivery::SUGGESTION) { + $success = ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $item_id); } elseif ($cmd == Delivery::RELOCATION) { } elseif ($cmd == Delivery::REMOVAL) { - ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox); + $success = ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox); } elseif ($cmd == Delivery::PROFILEUPDATE) { - ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox); + $success = ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox); } else { $data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id); if (!empty($data)) { - HTTPSignature::transmit($data, $inbox, $uid); + $success = HTTPSignature::transmit($data, $inbox, $uid); } } + + if (!$success) { + Worker::defer(); + } } }