]> git.mxchange.org Git - friendica.git/commitdiff
Prevent further processing of incoming posts when thay are rejected
authorMichael <heluecht@pirati.ca>
Tue, 22 Mar 2022 12:28:47 +0000 (12:28 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 22 Mar 2022 12:28:47 +0000 (12:28 +0000)
src/Protocol/ActivityPub/Processor.php

index 5651343cb5f79ec4a1274a48f9d5384f24e9c3dd..4399de191a8c8f37c34e9f7c704457f4fb1c8686 100644 (file)
@@ -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;
                }