1
0
Fork 0

We forgot to include the title ...

This commit is contained in:
Michael Vogel 2015-09-06 08:18:55 +02:00
parent c555b1b5cb
commit f918109351

View file

@ -19,7 +19,7 @@ function p_init($a){
$guid = strtolower(substr($guid, 0, -4));
$item = q("SELECT `body`, `guid`, `contact-id`, `private`, `created`, `app` FROM `item` WHERE `uid` = 0 AND `guid` = '%s' AND `network` IN ('%s', '%s') LIMIT 1",
$item = q("SELECT `title`, `body`, `guid`, `contact-id`, `private`, `created`, `app` FROM `item` WHERE `uid` = 0 AND `guid` = '%s' AND `network` IN ('%s', '%s') LIMIT 1",
dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA);
if (!$item) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
@ -39,8 +39,14 @@ function p_init($a){
$post["public"] = (!$item[0]["private"] ? 'true':'false');
$post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]);
} else {
$body = bb2diaspora($item[0]["body"]);
if(strlen($item[0]["title"]))
$body = "## ".html_entity_decode($item[0]["title"])."\n\n".$body;
$nodename = "status_message";
$post["raw_message"] = str_replace("&", "&", bb2diaspora($item[0]["body"]));
$post["raw_message"] = str_replace("&", "&", $body);
$post["guid"] = $item[0]["guid"];
$post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]);
$post["public"] = (!$item[0]["private"] ? 'true':'false');