X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FDelivery.php;h=6e97b0b92731bcb237636fc596dd8fb3cf837de5;hb=b1e4c0931af6a1c937ea713cf70a5dbc742f30db;hp=6f9272be0842a00775181caee2e345010fbc5600;hpb=b1a2de5cb5b3f30b15a0b60e12cd70232d8f7620;p=friendica.git diff --git a/src/Protocol/ActivityPub/Delivery.php b/src/Protocol/ActivityPub/Delivery.php index 6f9272be08..6e97b0b927 100644 --- a/src/Protocol/ActivityPub/Delivery.php +++ b/src/Protocol/ActivityPub/Delivery.php @@ -144,6 +144,11 @@ class Delivery if (!empty($actor)) { $drop = !ActivityPub\Transmitter::sendRelayFollow($actor); Logger::notice('Resubscribed to relay', ['url' => $actor, 'success' => !$drop]); + } elseif ($cmd = WorkerDelivery::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. + $drop = true; } } @@ -162,9 +167,9 @@ class Delivery self::setSuccess($receivers, $success); - Logger::debug('Delivered', ['uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox, 'success' => $success]); + 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 && in_array($cmd, [WorkerDelivery::POST])) { + if (($success || $drop) && in_array($cmd, [WorkerDelivery::POST])) { Post\DeliveryData::incrementQueueDone($uri_id, Post\DeliveryData::ACTIVITYPUB); } @@ -179,7 +184,9 @@ class Delivery */ private static function fetchActorForRelayInbox(string $inbox): string { - return DBA::selectFirst('apcontact', ['url'], ['sharedinbox' => $inbox, 'type' => 'Application']) ?: ''; + $apcontact = DBA::selectFirst('apcontact', ['url'], ["`sharedinbox` = ? AND `type` = ? AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", + $inbox, 'Application', 0, Contact::FRIEND]); + return $apcontact['url'] ?? ''; } /**