- $post = array();
-
- $reshared = diaspora_is_reshare($item[0]["body"]);
-
- if ($reshared) {
- $nodename = "reshare";
- $post["root_diaspora_id"] = $reshared["root_handle"];
- $post["root_guid"] = $reshared["root_guid"];
- $post["guid"] = $item[0]["guid"];
- $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]);
- $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("&", "&", $body);
- $post["guid"] = $item[0]["guid"];
- $post["diaspora_handle"] = diaspora_handle_from_contact($item[0]["contact-id"]);
- $post["public"] = (!$item[0]["private"] ? 'true':'false');
- $post["created_at"] = datetime_convert('UTC','UTC',$item[0]["created"]);
- $post["provider_display_name"] = $item[0]["app"];
+ // Fetch some data from the author (We could combine both queries - but I think this is more readable)
+ $r = q("SELECT `user`.`prvkey`, `contact`.`addr`, `user`.`nickname`, `contact`.`nick` FROM `user`
+ INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid`
+ WHERE `user`.`uid` = %d", intval($item[0]["uid"]));
+ if (!$r) {
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ killme();