]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: Empty reshares in Diaspora
authorMichael Vogel <icarus@dabo.de>
Sun, 10 May 2015 08:08:29 +0000 (10:08 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 10 May 2015 08:08:29 +0000 (10:08 +0200)
This bugfix was already accepted for the Develop-branch. The bug is very annoying on larger systems. (Single user systems aren't affected by this).

include/diaspora.php

index dd877112ba906cc71a371deba3e023fcd1dd4eaf..9ca30563d775bbeeaa120d97de0538c393b5f598 100755 (executable)
@@ -1075,7 +1075,7 @@ function diaspora_reshare($importer,$xml,$msg) {
        $create_original_post = false;
 
        // Do we already have this item?
-       $r = q("SELECT `body`, `tag`, `app`, `author-link`, `plink` FROM `item` WHERE `guid` = '%s' AND `visible` AND NOT `deleted` AND `body` != '' LIMIT 1",
+       $r = q("SELECT `body`, `tag`, `app`, `created`, `author-link`, `plink` FROM `item` WHERE `guid` = '%s' AND `visible` AND NOT `deleted` AND `body` != '' LIMIT 1",
                dbesc($orig_guid),
                dbesc(NETWORK_DIASPORA)
        );
@@ -1087,8 +1087,15 @@ function diaspora_reshare($importer,$xml,$msg) {
                require_once('include/api.php');
                if (api_share_as_retweet($r[0]))
                        $r = array();
-               else
-                       $orig_url = $a->get_baseurl().'/display/'.$orig_guid;
+               else {
+                       $body = $r[0]["body"];
+                       $str_tags = $r[0]["tag"];
+                       $app = $r[0]["app"];
+                       $orig_created = $r[0]["created"];
+                       $orig_author = $r[0]["author-link"];
+                       $create_original_post = ($body != "");
+                       $orig_url = $a->get_baseurl()."/display/".$orig_guid;
+               }
        }
 
        if (!count($r)) {