X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FDelivery.php;h=5bb09dfa85c0e73e8a06e04cfa2cca5e7c9de998;hb=5f5298125530857f009ca236139853954511a94e;hp=0e014c703563818c90d3cba0ecbbe278ac92a015;hpb=088a3b6bc429973381e6eb2931c6eacd5b8c8927;p=friendica.git diff --git a/src/Protocol/ActivityPub/Delivery.php b/src/Protocol/ActivityPub/Delivery.php index 0e014c7035..5bb09dfa85 100644 --- a/src/Protocol/ActivityPub/Delivery.php +++ b/src/Protocol/ActivityPub/Delivery.php @@ -1,6 +1,6 @@ $uri_id, 'uid' => [$uid, 0]], ['order' => ['uid' => true]]); if (empty($item['id'])) { @@ -101,24 +112,24 @@ class Delivery $serverfail = false; $drop = false; - if ($cmd == WorkerDelivery::MAIL) { + if ($cmd == ProtocolDelivery::MAIL) { $data = ActivityPub\Transmitter::createActivityFromMail($item_id); if (!empty($data)) { - $success = HTTPSignature::transmit($data, $inbox, $uid); + $success = HTTPSignature::transmit($data, $inbox, $owner); } - } elseif ($cmd == WorkerDelivery::SUGGESTION) { - $success = ActivityPub\Transmitter::sendContactSuggestion($uid, $inbox, $item_id); - } elseif ($cmd == WorkerDelivery::RELOCATION) { + } elseif ($cmd == ProtocolDelivery::SUGGESTION) { + $success = ActivityPub\Transmitter::sendContactSuggestion($owner, $inbox, $item_id); + } elseif ($cmd == ProtocolDelivery::RELOCATION) { // @todo Implementation pending - } elseif ($cmd == WorkerDelivery::REMOVAL) { - $success = ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox); - } elseif ($cmd == WorkerDelivery::PROFILEUPDATE) { - $success = ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox); + } elseif ($cmd == ProtocolDelivery::REMOVAL) { + $success = ActivityPub\Transmitter::sendProfileDeletion($owner, $inbox); + } elseif ($cmd == ProtocolDelivery::PROFILEUPDATE) { + $success = ActivityPub\Transmitter::sendProfileUpdate($owner, $inbox); } else { $data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id); if (!empty($data)) { $timestamp = microtime(true); - $response = HTTPSignature::post($data, $inbox, $uid); + $response = HTTPSignature::post($data, $inbox, $owner); $runtime = microtime(true) - $timestamp; $success = $response->isSuccess(); $serverfail = $response->isTimeout(); @@ -149,7 +160,7 @@ class Delivery if (!empty($actor)) { $drop = !ActivityPub\Transmitter::sendRelayFollow($actor); Logger::notice('Resubscribed to relay', ['url' => $actor, 'success' => !$drop]); - } elseif ($cmd = WorkerDelivery::DELETION) { + } elseif ($cmd = ProtocolDelivery::DELETION) { // Remote systems not always accept our deletion requests, so we drop them if rejected. // Situation is: In Friendica we allow the thread owner to delete foreign comments to their thread. // Most AP systems don't allow this, so they will reject the deletion request. @@ -176,7 +187,7 @@ class Delivery Logger::debug('Delivered', ['uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox, 'success' => $success, 'serverfailure' => $serverfail, 'drop' => $drop]); - if (($success || $drop) && in_array($cmd, [WorkerDelivery::POST])) { + if (($success || $drop) && in_array($cmd, [ProtocolDelivery::POST])) { Post\DeliveryData::incrementQueueDone($uri_id, Post\DeliveryData::ACTIVITYPUB); }