aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-01-21 17:08:39 -0800
committerzotlabs <mike@macgirvin.com>2018-01-21 17:08:39 -0800
commitd4c81d8e0e4cea191009da66c1a4374e6537fc61 (patch)
treec962a68dbf7874e326f4ca268fe0183ac184ea12 /include
parent89aa882c95b4d01bd7bf6ff461c1dcefdedea7bd (diff)
parent1709dbd376af3171815f25b7055fb41da53924cb (diff)
downloadvolse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.tar.gz
volse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.tar.bz2
volse-hubzilla-d4c81d8e0e4cea191009da66c1a4374e6537fc61.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include')
-rw-r--r--include/api_zot.php24
-rwxr-xr-xinclude/dba/dba_pdo.php4
-rw-r--r--include/features.php26
3 files changed, 40 insertions, 14 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) {
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index f119d8926..7b58561a7 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -15,7 +15,7 @@ class dba_pdo extends dba_driver {
$dsn = $server;
}
else {
- $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? '' : ';port=' . $port);
+ $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? ';port=' . $port : '');
}
$dsn .= ';dbname=' . $db;
@@ -154,4 +154,4 @@ class dba_pdo extends dba_driver {
return 'pdo';
}
-} \ No newline at end of file
+}
diff --git a/include/features.php b/include/features.php
index 36eb74a9d..839faff67 100644
--- a/include/features.php
+++ b/include/features.php
@@ -190,6 +190,16 @@ function get_features($filtered = true) {
feature_level('event_tz_select',2),
],
+
+ [
+ 'premium_channel',
+ t('Premium Channel'),
+ t('Allows you to set restrictions and terms on those that connect with your channel'),
+ false,
+ get_config('feature_lock','premium_channel'),
+ feature_level('premium_channel',4),
+ ],
+
[
'advanced_dirsearch',
t('Advanced Directory Search'),
@@ -438,16 +448,10 @@ function get_features($filtered = true) {
],
];
+ $x = [ 'features' => $arr, ];
+ call_hooks('get_features',$x);
- $arr['general'][] = [
- 'premium_channel',
- t('Premium Channel'),
- t('Allows you to set restrictions and terms on those that connect with your channel'),
- false,
- get_config('feature_lock','premium_channel'),
- feature_level('premium_channel',4),
- ];
-
+ $arr = $x['features'];
$techlevel = get_account_techlevel();
@@ -482,7 +486,5 @@ function get_features($filtered = true) {
$narr = $arr;
}
- $x = [ 'features' => $narr, 'filtered' => $filtered, 'techlevel' => $techlevel ];
- call_hooks('get_features',$x);
- return $x['features'];
+ return $narr;
}