]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Delivery.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / src / Worker / Delivery.php
index 192c5e815dd2aebd4e805fb599bb89bb750eee7a..eafd0242ba5c57adf486b3b3d5e4f31fb07ea765 100644 (file)
@@ -35,8 +35,8 @@ class Delivery {
                $fsuggest = false;
                $relocate = false;
                $top_level = false;
-               $recipients = array();
-               $url_recipients = array();
+               $recipients = [];
+               $url_recipients = [];
                $followup = false;
 
                $normal_mode = true;
@@ -108,7 +108,7 @@ class Delivery {
                        }
 
                        $icontacts = null;
-                       $contacts_arr = array();
+                       $contacts_arr = [];
                        foreach ($items as $item) {
                                if (!in_array($item['contact-id'],$contacts_arr)) {
                                        $contacts_arr[] = intval($item['contact-id']);
@@ -217,9 +217,14 @@ class Delivery {
                }
                $deliver_status = 0;
 
+               // Transmit via Diaspora if not possible via Friendica
+               if (($item['uid'] == 0) && ($contact['network'] == NETWORK_DFRN)) {
+                       $contact['network'] = NETWORK_DIASPORA;
+               }
+
                logger("main delivery by delivery: followup=$followup mail=$mail fsuggest=$fsuggest relocate=$relocate - network ".$contact['network']);
 
-               switch($contact['network']) {
+               switch ($contact['network']) {
 
                        case NETWORK_DFRN:
                                logger('notifier: '.$target_item["guid"].' dfrndelivery: '.$contact['name']);
@@ -233,7 +238,7 @@ class Delivery {
                                } elseif ($relocate) {
                                        $atom = DFRN::relocate($owner, $uid);
                                } elseif ($followup) {
-                                       $msgitems = array();
+                                       $msgitems = [];
                                        foreach ($items as $item) {  // there is only one item
                                                if (!$item['parent']) {
                                                        return;
@@ -245,7 +250,7 @@ class Delivery {
                                        }
                                        $atom = DFRN::entries($msgitems,$owner);
                                } else {
-                                       $msgitems = array();
+                                       $msgitems = [];
                                        foreach ($items as $item) {
                                                if (!$item['parent']) {
                                                        return;