]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Notifier.php
wrapping up 2019.12
[friendica.git] / src / Worker / Notifier.php
index 8b6be76b50dad5fe3a25da132a798bd4455b0e68..19bd51885667d24de462a575237a6e3bbd37b4b1 100644 (file)
@@ -51,6 +51,8 @@ class Notifier
 
                $delivery_contacts_stmt = null;
                $target_item = [];
+               $parent = [];
+               $thr_parent = [];
                $items = [];
                $delivery_queue_count = 0;
 
@@ -594,6 +596,10 @@ class Notifier
         */
        private static function skipDFRN($contact, $item, $parent, $thr_parent, $cmd)
        {
+               if (empty($parent['network'])) {
+                       return false;
+               }
+
                // Don't skip when the starting post is delivered via Diaspora
                if ($parent['network'] == Protocol::DIASPORA) {
                        return false;
@@ -619,6 +625,11 @@ class Notifier
                        return false;
                }
 
+               // We deliver reshares via AP whenever possible
+               if (ActivityPub\Transmitter::isAnnounce($item)) {
+                       return true;
+               }
+
                // Skip DFRN when the item will be (forcefully) delivered via AP
                if (Config::get('debug', 'total_ap_delivery') && ($contact['network'] == Protocol::DFRN) && !empty(APContact::getByURL($contact['url'], false))) {
                        return true;