aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-11 21:41:45 -0700
committerfriendica <info@friendica.com>2014-09-11 21:41:45 -0700
commit6ec12c66c394b48fa0a319ec3ca938eaa2cf4f43 (patch)
treedbc973247eb1fa278a64d26484bb2b97417a8c16 /include
parent3e97f71b33c6c05473410af350d287ee3981bcb5 (diff)
downloadvolse-hubzilla-6ec12c66c394b48fa0a319ec3ca938eaa2cf4f43.tar.gz
volse-hubzilla-6ec12c66c394b48fa0a319ec3ca938eaa2cf4f43.tar.bz2
volse-hubzilla-6ec12c66c394b48fa0a319ec3ca938eaa2cf4f43.zip
red group/collection query calls for api
Diffstat (limited to 'include')
-rw-r--r--include/api.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/api.php b/include/api.php
index c0f54af19..47de945db 100644
--- a/include/api.php
+++ b/include/api.php
@@ -582,10 +582,43 @@ require_once('include/items.php');
api_register_func('api/red/photos','api_photos', true);
+ function api_group_members(&$a,$type) {
+ if(api_user() === false)
+ return false;
+
+ if($_REQUEST['group_id']) {
+ $r = q("select * from groups where uid = %d and id = %d limit 1",
+ intval(api_user()),
+ intval($_REQUEST['group_id'])
+ );
+ if($r) {
+ $x = q("select * from group_member left join xchan on group_member.xchan = xchan.xchan_hash
+ left join abook on abook_xchan = xchan_hash where gid = %d",
+ intval($_REQUEST['group_id'])
+ );
+ json_return_and_die($x);
+ }
+ }
+ }
+
+ api_register_func('api/red/group_members','api_group_members', true);
+ function api_group(&$a,$type) {
+ if(api_user() === false)
+ return false;
+
+ $r = q("select * from groups where uid = %d",
+ intval(api_user())
+ );
+ json_return_and_die($r);
+ }
+ api_register_func('api/red/group','api_group', true);
+
+
+
function api_statuses_mediap(&$a, $type) {
if (api_user() === false) {