From 45199b498d4f958206c8de9226fc990545308bda Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 22 Mar 2022 12:28:47 +0000 Subject: [PATCH 1/2] Prevent further processing of incoming posts when thay are rejected --- src/Protocol/ActivityPub/Processor.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 5651343cb5..4399de191a 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -164,6 +164,10 @@ class Processor if (!DBA::isResult($item)) { Logger::warning('No existing item, item will be created', ['uri' => $activity['id']]); $item = self::createItem($activity); + if (empty($item)) { + return; + } + self::postItem($activity, $item); return; } @@ -416,6 +420,10 @@ class Processor public static function createActivity($activity, $verb) { $item = self::createItem($activity); + if (empty($item)) { + return; + } + $item['verb'] = $verb; $item['thr-parent'] = $activity['object_id']; $item['gravity'] = GRAVITY_ACTIVITY; @@ -584,6 +592,7 @@ class Processor // The checks are split to improve the support when searching why a message was accepted. if (count($activity['receiver']) != 1) { // The message has more than one receiver, so it is wanted. + if (!isset($item['uri-id'])) Logger::info('Blubb', ['callstack' => System::callstack(20), 'receiver' => $activity['receiver']]); Logger::debug('Message has got several receivers - accepted', ['uri-id' => $item['uri-id'], 'guid' => $item['guid'], 'url' => $item['uri']]); return true; } From 53ba68e22209d82a0a39e423e0371965404f3488 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 22 Mar 2022 12:31:14 +0000 Subject: [PATCH 2/2] Remove "blubb" --- src/Protocol/ActivityPub/Processor.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 4399de191a..4a64a0f693 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -592,7 +592,6 @@ class Processor // The checks are split to improve the support when searching why a message was accepted. if (count($activity['receiver']) != 1) { // The message has more than one receiver, so it is wanted. - if (!isset($item['uri-id'])) Logger::info('Blubb', ['callstack' => System::callstack(20), 'receiver' => $activity['receiver']]); Logger::debug('Message has got several receivers - accepted', ['uri-id' => $item['uri-id'], 'guid' => $item['guid'], 'url' => $item['uri']]); return true; }