aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_zot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-01-19 09:16:51 +0100
committerMario Vavti <mario@mariovavti.com>2018-01-19 09:16:51 +0100
commite9f32ef94e5cb188e86a8cf43f9580b462d0ea46 (patch)
tree553feae3fb0c8267262fb605b28857f412e57b41 /include/api_zot.php
parent2cf4381e19a05c98c523422dce39753c7381229d (diff)
parent764d6e3407f75cbe7a6f9635dd40cd2cca0f2b4f (diff)
downloadvolse-hubzilla-e9f32ef94e5cb188e86a8cf43f9580b462d0ea46.tar.gz
volse-hubzilla-e9f32ef94e5cb188e86a8cf43f9580b462d0ea46.tar.bz2
volse-hubzilla-e9f32ef94e5cb188e86a8cf43f9580b462d0ea46.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/api_zot.php')
-rw-r--r--include/api_zot.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 54f905b4c..1d30a0845 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -6,6 +6,8 @@
api_register_func('api/export/basic','api_export_basic', true);
api_register_func('api/red/channel/export/basic','api_export_basic', true);
api_register_func('api/z/1.0/channel/export/basic','api_export_basic', true);
+ api_register_func('api/red/channel/list','api_channel_list', true);
+ api_register_func('api/z/1.0/channel/list','api_channel_list', true);
api_register_func('api/red/channel/stream','api_channel_stream', true);
api_register_func('api/z/1.0/channel/stream','api_channel_stream', true);
api_register_func('api/red/files','api_attach_list', true);
@@ -111,9 +113,31 @@
}
}
+ function api_channel_list($type) {
+ if(api_user() === false) {
+ logger('api_channel_stream: no user');
+ return false;
+ }
+
+ $channel = channelx_by_n(api_user());
+ if(! $channel)
+ return false;
+ $ret = [];
+ $r = q("select channel_address from channel where channel_account_id = %d",
+ intval($channel['channel_account_id'])
+ );
+
+ if($r) {
+ foreach($r as $rv) {
+ $ret[] = $rv['channel_address'];
+ }
+ }
+
+ json_return_and_die($ret);
+ }
function api_channel_stream($type) {