]> git.mxchange.org Git - friendica.git/commitdiff
Delivery of reshares
authorMichael <heluecht@pirati.ca>
Fri, 6 Dec 2019 06:39:50 +0000 (06:39 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 6 Dec 2019 06:39:50 +0000 (06:39 +0000)
src/Protocol/ActivityPub/Transmitter.php
src/Worker/Delivery.php

index 5bb03a8517138f752194171a9aecf487cbd3adf2..0b7784848e5024954a690350c1badc1ee4508d24 100644 (file)
@@ -363,7 +363,7 @@ class Transmitter
                        }
                }
 
-               if (Config::get('debug', 'total_ap_delivery')) {
+               if (self::isAnnounce($item) || Config::get('debug', 'total_ap_delivery')) {
                        // Will be activated in a later step
                        $networks = Protocol::FEDERATED;
                } else {
@@ -1423,6 +1423,23 @@ class Transmitter
                return ['object' => $reshared_item, 'actor' => $profile, 'comment' => $reshared['comment']];
        }
 
+       /**
+        * Checks if the provided item array is an announce
+        *
+        * @param array $item
+        *
+        * @return boolean
+        */
+       public static function isAnnounce($item)
+       {
+               $announce = self::getAnnounceArray($item);
+               if (empty($announce)) {
+                       return false;
+               }
+
+               return empty($announce['comment']);
+       }
+
        /**
         * Creates an activity id for a given contact id
         *
index d9a2109ba3882d912c6278e163fb53899c788a83..e59ea37aad35a4d0bd7c678de53e512c0c327677 100644 (file)
@@ -251,6 +251,17 @@ class Delivery extends BaseObject
         */
        private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
        {
+/*
+               if (Diaspora::isReshare($target_item['body'])) {
+                       // Transmit Diaspora reshares only via Diaspora
+                       self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
+                       return;
+               }
+
+               if (ActivityPub\Transmitter::::isAnnounce($target_item) && getby) {
+                       return;
+               }
+*/
                Logger::info('Deliver ' . (($target_item['guid'] ?? '') ?: $target_item['id']) . ' via DFRN to ' . (($contact['addr'] ?? '') ?: $contact['url']));
 
                if ($cmd == self::MAIL) {