]> git.mxchange.org Git - friendica.git/commitdiff
Reshared posts weren't always recognized as such.
authorMichael Vogel <icarus@dabo.de>
Fri, 3 Apr 2015 11:06:19 +0000 (13:06 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 3 Apr 2015 11:06:19 +0000 (13:06 +0200)
include/diaspora.php

index f24487ae51327cde16d68d65f07bc4910c6a0fee..dd877112ba906cc71a371deba3e023fcd1dd4eaf 100755 (executable)
@@ -2512,6 +2512,26 @@ function diaspora_is_reshare($body) {
         if ($body == $attributes)
                 return(false);
 
+        $guid = "";
+        preg_match("/guid='(.*?)'/ism", $attributes, $matches);
+        if ($matches[1] != "")
+                $guid = $matches[1];
+
+        preg_match('/guid="(.*?)"/ism', $attributes, $matches);
+        if ($matches[1] != "")
+                $guid = $matches[1];
+
+       if ($guid != "") {
+               $r = q("SELECT `contact-id` FROM `item` WHERE `guid` = '%s' AND `network` IN ('%s', '%s') LIMIT 1",
+                       dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA);
+               if ($r) {
+                       $ret= array();
+                       $ret["root_handle"] = diaspora_handle_from_contact($r[0]["contact-id"]);
+                       $ret["root_guid"] = $guid;
+                       return($ret);
+               }
+       }
+
         $profile = "";
         preg_match("/profile='(.*?)'/ism", $attributes, $matches);
         if ($matches[1] != "")