aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorSebastian Egbers <sebastian@egbers.info>2012-06-19 16:15:19 +0200
committerSebastian Egbers <sebastian@egbers.info>2012-06-19 16:15:19 +0200
commit43532b74142cfabd0afbf250d052bff99b0d7ef2 (patch)
tree090bed7bd58892ecb36aa44041d735a5278abab8 /include/api.php
parent8b502bb48611a1baa327dea74fd6479e66c1545f (diff)
downloadvolse-hubzilla-43532b74142cfabd0afbf250d052bff99b0d7ef2.tar.gz
volse-hubzilla-43532b74142cfabd0afbf250d052bff99b0d7ef2.tar.bz2
volse-hubzilla-43532b74142cfabd0afbf250d052bff99b0d7ef2.zip
added exclude_replies option to api call statuses/home_timeline.
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/api.php b/include/api.php
index 855e4efa3..a58dd20df 100644
--- a/include/api.php
+++ b/include/api.php
@@ -719,14 +719,18 @@
if ($page<0) $page=0;
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
+ $exclude_replies = (x($_REQUEST,'exclude_replies')?1:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+ $sql_extra = '';
if ($max_id > 0)
- $sql_extra = 'AND `item`.`id` <= '.intval($max_id);
+ $sql_extra .= ' AND `item`.`id` <= '.intval($max_id);
+ if ($exclude_replies > 0)
+ $sql_extra .= ' AND `item`.`parent` = `item`.`id`';
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,