aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-08-19 15:09:10 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-08-19 15:09:10 +0200
commitfc9c73da492f97c47ffa15601c2411f58b24c0d3 (patch)
tree8f1fec7e3a4a6f55300e376ec7d888e4313f9068
parent62e939de52acbfbfab1af143b9da2e48d6f4fc27 (diff)
downloadvolse-hubzilla-fc9c73da492f97c47ffa15601c2411f58b24c0d3.tar.gz
volse-hubzilla-fc9c73da492f97c47ffa15601c2411f58b24c0d3.tar.bz2
volse-hubzilla-fc9c73da492f97c47ffa15601c2411f58b24c0d3.zip
API: missing template and small fix for hotot
-rw-r--r--include/api.php21
-rw-r--r--view/api_friends_xml.tpl5
2 files changed, 19 insertions, 7 deletions
diff --git a/include/api.php b/include/api.php
index f2dc8aff1..dd169f833 100644
--- a/include/api.php
+++ b/include/api.php
@@ -796,12 +796,24 @@
/**
* https://dev.twitter.com/docs/api/1/get/statuses/friends
- * This function is deprecated by Twitter
+ * This function is deprecated by Twitter
+ * returns: json, xml
**/
function api_statuses_f(&$a, $type, $qtype) {
if (local_user()===false) return false;
$user_info = api_get_user($a);
+ if (x($_GET,'cursor') && $_GET['cursor']=='undefined'){
+ /* this is to stop Hotot to load friends multiple times
+ * I'm not sure if I'm missing return something or
+ * is a bug in hotot. Workaround, meantime
+ */
+
+ $ret=Array();
+ $data = array('$users' => $ret);
+ return api_apply_template("friends", $type, $data);
+ }
+
if($qtype == 'friends')
$sql_extra = sprintf(" AND ( `rel` = %d OR `rel` = %d ) ", intval(CONTACT_IS_SHARING), intval(CONTACT_IS_FRIEND));
if($qtype == 'followers')
@@ -816,13 +828,8 @@
$ret[] = api_get_user($a, $cid['id']);
}
+
$data = array('$users' => $ret);
- switch($type){
- case "atom":
- case "rss":
- $data = api_rss_extra($a, $data, $user_info);
- }
-
return api_apply_template("friends", $type, $data);
}
diff --git a/view/api_friends_xml.tpl b/view/api_friends_xml.tpl
new file mode 100644
index 000000000..0ea7eb13b
--- /dev/null
+++ b/view/api_friends_xml.tpl
@@ -0,0 +1,5 @@
+<users type="array">
+ {{for $users as $user }}
+ {{inc api_user_xml.tpl }}{{endinc}}
+ {{endfor}}
+</users>