mirror of
https://github.com/friendica/friendica
synced 2025-05-05 22:24:11 +02:00
Don't transmit to archived inboxes
This commit is contained in:
parent
61ff99c410
commit
e4e9a20ac8
7 changed files with 70 additions and 19 deletions
|
@ -42,7 +42,16 @@ class APDelivery
|
|||
*/
|
||||
public static function execute($cmd, $target_id, $inbox, $uid)
|
||||
{
|
||||
Logger::log('Invoked: ' . $cmd . ': ' . $target_id . ' to ' . $inbox, Logger::DEBUG);
|
||||
if (ActivityPub\Transmitter::archivedInbox($inbox)) {
|
||||
Logger::info('Inbox is archived', ['cmd' => $cmd, 'inbox' => $inbox, 'id' => $target_id, 'uid' => $uid]);
|
||||
if (in_array($cmd, [Delivery::POST])) {
|
||||
$item = Item::selectFirst(['uri-id'], ['id' => $target_id]);
|
||||
Post\DeliveryData::incrementQueueFailed($item['uri-id'] ?? 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::info('Invoked', ['cmd' => $cmd, 'inbox' => $inbox, 'id' => $target_id, 'uid' => $uid]);
|
||||
|
||||
$success = true;
|
||||
|
||||
|
|
|
@ -193,9 +193,9 @@ class Delivery
|
|||
return;
|
||||
}
|
||||
|
||||
// We don't deliver our items to blocked or pending contacts, and not to ourselves either
|
||||
// We don't deliver our items to blocked, archived or pending contacts, and not to ourselves either
|
||||
$contact = DBA::selectFirst('contact', [],
|
||||
['id' => $contact_id, 'blocked' => false, 'pending' => false, 'self' => false]
|
||||
['id' => $contact_id, 'archive' => false, 'blocked' => false, 'pending' => false, 'self' => false]
|
||||
);
|
||||
if (!DBA::isResult($contact)) {
|
||||
self::setFailedQueue($cmd, $target_item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue