mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
Unsuccessful ActivitiyPub transmission are now deferred
This commit is contained in:
parent
65f29800ff
commit
e3e714a45f
4 changed files with 34 additions and 14 deletions
|
@ -7,6 +7,7 @@ namespace Friendica\Worker;
|
|||
use Friendica\BaseObject;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
|
||||
class APDelivery extends BaseObject
|
||||
|
@ -23,19 +24,25 @@ class APDelivery extends BaseObject
|
|||
{
|
||||
logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
|
||||
|
||||
$success = true;
|
||||
|
||||
if ($cmd == Delivery::MAIL) {
|
||||
} elseif ($cmd == Delivery::SUGGESTION) {
|
||||
ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $item_id);
|
||||
$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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue