]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into reshare-delivery
authorMichael <heluecht@pirati.ca>
Sun, 8 Dec 2019 08:49:47 +0000 (08:49 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Dec 2019 08:49:47 +0000 (08:49 +0000)
1  2 
src/Protocol/ActivityPub/Transmitter.php

index 0b7784848e5024954a690350c1badc1ee4508d24,aebf59891271cdc30cce93bbd50b35f63b0ed669..b28ee4452e0c47112147a55b98b91bfd426ee536
@@@ -363,7 -363,7 +363,7 @@@ class Transmitte
                        }
                }
  
 -              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 {
  
                $terms = Term::tagArrayFromItemId($item['id'], [Term::MENTION, Term::IMPLICIT_MENTION]);
  
-               // Directly mention the original author upon a quoted reshare.
-               // Else just ensure that the original author receives the reshare.
-               $announce = self::getAnnounceArray($item);
-               if (!empty($announce['comment'])) {
-                       $data['to'][] = $announce['actor']['url'];
-               } elseif (!empty($announce)) {
-                       $data['cc'][] = $announce['actor']['url'];
-               }
                if (!$item['private']) {
+                       // Directly mention the original author upon a quoted reshare.
+                       // Else just ensure that the original author receives the reshare.
+                       $announce = self::getAnnounceArray($item);
+                       if (!empty($announce['comment'])) {
+                               $data['to'][] = $announce['actor']['url'];
+                       } elseif (!empty($announce)) {
+                               $data['cc'][] = $announce['actor']['url'];
+                       }
                        $data = array_merge($data, self::fetchPermissionBlockFromConversation($item));
  
                        $data['to'][] = ActivityPub::PUBLIC_COLLECTION;
                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
         *