]> git.mxchange.org Git - friendica.git/commitdiff
Avoid loops when fetching replies
authorMichael <heluecht@pirati.ca>
Tue, 2 Jul 2024 21:36:32 +0000 (21:36 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 3 Jul 2024 02:29:16 +0000 (02:29 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php

index 7a9ad827cb5b7ea7ecffbbe0c969dd618e709cff..923e46b473aaba15645b15e3b66c1b8c18a03215 100644 (file)
@@ -515,7 +515,7 @@ class Processor
                        }
                }
 
-               if (DI::config()->get('system', 'decoupled_receiver')) {
+               if (DI::config()->get('system', 'decoupled_receiver') && ($activity['completion-mode'] ?? Receiver::COMPLETION_NONE != Receiver::COMPLETION_REPLIES)) {
                        $replies = [$item['thr-parent']];
                        if (!empty($item['parent-uri'])) {
                                $replies[] = $item['parent-uri'];
@@ -1780,7 +1780,7 @@ class Processor
                                }
                                if (parse_url($id, PHP_URL_HOST) == parse_url($url, PHP_URL_HOST)) {
                                        Logger::debug('Incluced activity will be processed', ['replies' => $url, 'id' => $id]);
-                                       self::processActivity($reply, $id, $child, '', Receiver::COMPLETION_AUTO);
+                                       self::processActivity($reply, $id, $child, '', Receiver::COMPLETION_REPLIES);
                                        ++$fetched;
                                        continue;
                                }
@@ -1795,7 +1795,7 @@ class Processor
                                Logger::debug('Activity is already queued', ['replies' => $url, 'id' => $id]);
                        } else {
                                Logger::debug('Missing Activity will be fetched and processed', ['replies' => $url, 'id' => $id]);
-                               self::fetchMissingActivity($id, $child, '', Receiver::COMPLETION_AUTO);
+                               self::fetchMissingActivity($id, $child, '', Receiver::COMPLETION_REPLIES);
                                ++$fetched;
                        }
                }
index c81c569b6f5bfab4c8617760f76d36374e46d5c1..de105af8cb589743d8e88036fe1f1752e43c585c 100644 (file)
@@ -81,6 +81,7 @@ class Receiver
        const COMPLETION_MANUAL   = 3;
        const COMPLETION_AUTO     = 4;
        const COMPLETION_ASYNC    = 5;
+       const COMPLETION_REPLIES  = 6;
 
        /**
         * Checks incoming message from the inbox