aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-25 15:51:10 -0800
committerfriendica <info@friendica.com>2014-01-25 15:51:10 -0800
commit339a0f69c194d098333ed4d81b86cbc12f1339f3 (patch)
tree7753ba518e64ff5e4f876b5b99e85ba86e5cec42 /include/api.php
parent6911439f0e5bce19cdefb722378d695f5f7db65e (diff)
downloadvolse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.tar.gz
volse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.tar.bz2
volse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.zip
some tweaks to items_fetch for the api
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/include/api.php b/include/api.php
index 45deb15d7..dc270167b 100644
--- a/include/api.php
+++ b/include/api.php
@@ -1243,6 +1243,8 @@ require_once('include/items.php');
$sql_extra = '';
if ($user_info['self']==1) $sql_extra .= " AND `item`.`wall` = 1 ";
+
+//FIXME - this isn't yet implemented
if ($exclude_replies > 0) $sql_extra .= ' AND `item`.`parent` = `item`.`id`';
// $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
@@ -1263,23 +1265,20 @@ require_once('include/items.php');
// intval($since_id),
// intval($start), intval($count)
// );
- if ($user_info['self']==1) {
- $r = items_fetch(array(
- 'uid' => api_user(),
- 'cid' => $user_info['id'],
- 'since_id' => $since_id,
- 'start' => $start,
- 'records' => $count,
- 'wall' => 1));
- }
- else {
- $r = items_fetch(array(
- 'uid' => api_user(),
- 'cid' => $user_info['id'],
- 'since_id' => $since_id,
- 'start' => $start,
- 'records' => $count));
- }
+
+ $arr = array(
+ 'uid' => api_user(),
+ 'since_id' => $since_id,
+ 'start' => $start,
+ 'records' => $count);
+
+ if ($user_info['self']==1)
+ $arr['wall'] = 1;
+ else
+ $arr['cid'] = $user_info['id'];
+
+
+ $r = items_fetch($arr,get_app()->get_channel(),get_observer_hash());
$ret = api_format_items($r,$user_info);