aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-22 00:25:46 -0700
committerfriendica <info@friendica.com>2012-06-22 00:25:46 -0700
commit99000382cd6cf13a2a4d5eb23c63490700bd7d4c (patch)
treeb0f9ac77900885fd16af5a51fd7f9b8fc87762e0
parenteeceecc9baf6b8e8f238158439b34e2b465fee1a (diff)
parent2961e6efaf66aa0d1020e0742880756ba371865d (diff)
downloadvolse-hubzilla-99000382cd6cf13a2a4d5eb23c63490700bd7d4c.tar.gz
volse-hubzilla-99000382cd6cf13a2a4d5eb23c63490700bd7d4c.tar.bz2
volse-hubzilla-99000382cd6cf13a2a4d5eb23c63490700bd7d4c.zip
Merge https://github.com/friendica/friendica into pull
-rw-r--r--include/api.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/include/api.php b/include/api.php
index 691543907..b77156dfa 100644
--- a/include/api.php
+++ b/include/api.php
@@ -864,6 +864,8 @@
logger('API: api_statuses_show: '.$id);
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+ //$sql_extra = "";
+ if ($_GET["conversation"] == "true") $sql_extra .= " AND `item`.`parent` = %d ORDER BY `received` ASC "; else $sql_extra .= " AND `item`.`id` = %d";
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@@ -874,19 +876,24 @@
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra
- AND `item`.`id`=%d",
+ ",
intval($id)
);
-
+//var_dump($r);
$ret = api_format_items($r,$user_info);
-
- $data = array('$status' => $ret[0]);
- /*switch($type){
- case "atom":
- case "rss":
- $data = api_rss_extra($a, $data, $user_info);
- }*/
- return api_apply_template("status", $type, $data);
+//var_dump($ret);
+ if ($_GET["conversation"] == "true") {
+ $data = array('$statuses' => $ret);
+ return api_apply_template("timeline", $type, $data);
+ } else {
+ $data = array('$status' => $ret[0]);
+ /*switch($type){
+ case "atom":
+ case "rss":
+ $data = api_rss_extra($a, $data, $user_info);
+ }*/
+ return api_apply_template("status", $type, $data);
+ }
}
api_register_func('api/statuses/show','api_statuses_show', true);