]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Receiver.php
Issue 12977: Ensure to fetch quoted posts
[friendica.git] / src / Protocol / ActivityPub / Receiver.php
index a18a1092848a366bd878408dc1568d577f007d00..a5286761639fcdb91df0ca546a42f10f358f9198 100644 (file)
@@ -630,7 +630,7 @@ class Receiver
                        $object_data['object_activity'] = $activity;
                }
 
-               if (($type == 'as:Create') && $trust_source) {
+               if (($type == 'as:Create') && $trust_source && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE])) {
                        if (self::hasArrived($object_data['object_id'])) {
                                Logger::info('The activity already arrived.', ['id' => $object_data['object_id']]);
                                return true;
@@ -641,6 +641,8 @@ class Receiver
                                Logger::info('The activity is already added.', ['id' => $object_data['object_id']]);
                                return true;
                        }
+               } elseif (($type == 'as:Create') && $trust_source && !self::hasArrived($object_data['object_id'])) {
+                       self::addArrivedId($object_data['object_id']);
                }
 
                $decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE]);
@@ -1181,7 +1183,7 @@ class Receiver
                self::switchContacts($receivers, $actor);
 
                // "birdsitelive" is a service that mirrors tweets into the fediverse
-               // These posts can be fetched without authentification, but are not marked as public
+               // These posts can be fetched without authentication, but are not marked as public
                // We treat them as unlisted posts to be able to handle them.
                if (empty($receivers) && $fetch_unlisted && Contact::isPlatform($actor, 'birdsitelive')) {
                        $receivers[0]  = ['uid' => 0, 'type' => self::TARGET_GLOBAL];
@@ -1370,7 +1372,7 @@ class Receiver
        }
 
        /**
-        * Fetches the object data from external ressources if needed
+        * Fetches the object data from external resources if needed
         *
         * @param string  $object_id    Object ID of the provided object
         * @param array   $object       The provided object array