]> git.mxchange.org Git - friendica.git/commitdiff
Remote-self: relocated the code (may now work?)
authorMichael Vogel <icarus@dabo.de>
Mon, 27 Oct 2014 20:44:30 +0000 (21:44 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 27 Oct 2014 20:44:30 +0000 (21:44 +0100)
include/items.php

index 2999a535b43827d49f7f453c3475882f572403d8..d9b4212f7489bb5e653cb72c53759f2d50a5d1b8 100644 (file)
@@ -2619,27 +2619,32 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                                                $notify = true;
                                        }
 
+                                       if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
+                                               $datarray["app"] = network_to_name($contact['network']);
+
                                        if ($contact['network'] === NETWORK_FEED)
                                                $datarray['private'] = 0;
                                        elseif ($notify) {
-                                               // At first store the original post
-                                               $r = item_store($datarray, false, false);
+                                               $datarray2 = $datarray;
 
-                                               // Then create a new guid and uri and post it again as a forwarded post
-                                               $datarray["guid"] = get_guid(32);
-                                               $datarray["uri"] = item_new_uri($a->get_hostname(),$importer['uid']);
+                                               // Create a new guid and uri and post it as a forwarded post
+                                               $datarray2["guid"] = get_guid(32);
+                                               $datarray2["uri"] = item_new_uri($a->get_hostname(),$importer['uid']);
                                                $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", intval($importer['uid']));
                                                if (count($r)) {
-                                                       $datarray['contact-id'] = $r[0]["id"];
+                                                       $datarray2['contact-id'] = $r[0]["id"];
 
-                                                       $datarray['owner-name'] = $r[0]["name"];
-                                                       $datarray['owner-link'] = $r[0]["url"];
-                                                       $datarray['owner-avatar'] = $r[0]["photo"];
+                                                       $datarray2['owner-name'] = $r[0]["name"];
+                                                       $datarray2['owner-link'] = $r[0]["url"];
+                                                       $datarray2['owner-avatar'] = $r[0]["photo"];
                                                }
-                                       }
 
-                                       if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
-                                               $datarray["app"] = network_to_name($contact['network']);
+                                               // Store the forwarded post
+                                               $r = item_store($datarray2, false, true);
+
+                                               // Let the original item just be a regular item
+                                               $notify = false;
+                                       }
                                } else
                                        $notify = false;