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;
}
}
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);
}
*/
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'] ?? '';
}
/**