$success = true;
if ($cmd == Delivery::MAIL) {
+ $data = ActivityPub\Transmitter::createActivityFromMail($target_id);
+ if (!empty($data)) {
+ $success = HTTPSignature::transmit($data, $inbox, $uid);
+ }
} elseif ($cmd == Delivery::SUGGESTION) {
$success = ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $target_id);
} elseif ($cmd == Delivery::RELOCATION) {
+ // @todo Implementation pending
+ } elseif ($cmd == Delivery::POKE) {
+ // Implementation not planned
} elseif ($cmd == Delivery::REMOVAL) {
$success = ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox);
} elseif ($cmd == Delivery::PROFILEUPDATE) {
if (!empty($data)) {
$success = HTTPSignature::transmit($data, $inbox, $uid);
}
-
- if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) {
- ItemDeliveryData::incrementQueueDone($target_id);
- }
}
- if (!$success) {
- Worker::defer();
+ if (!$success && !Worker::defer() && in_array($cmd, [Delivery::POST])) {
+ ItemDeliveryData::incrementQueueFailed($target_id);
+ } elseif ($success && in_array($cmd, [Delivery::POST])) {
+ ItemDeliveryData::incrementQueueDone($target_id, ItemDeliveryData::ACTIVITYPUB);
}
}
}