Merge pull request #1551 from friendica/Bugfix-Empty-Reshare

Bugfix: Empty reshares in Diaspora
This commit is contained in:
Hauke Altmann 2015-05-20 15:08:47 +02:00
commit beb4980f02

View file

@ -1075,7 +1075,7 @@ function diaspora_reshare($importer,$xml,$msg) {
$create_original_post = false; $create_original_post = false;
// Do we already have this item? // 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($orig_guid),
dbesc(NETWORK_DIASPORA) dbesc(NETWORK_DIASPORA)
); );
@ -1087,8 +1087,15 @@ function diaspora_reshare($importer,$xml,$msg) {
require_once('include/api.php'); require_once('include/api.php');
if (api_share_as_retweet($r[0])) if (api_share_as_retweet($r[0]))
$r = array(); $r = array();
else else {
$orig_url = $a->get_baseurl().'/display/'.$orig_guid; $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)) { if (!count($r)) {