aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-09 18:50:11 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-09 18:50:11 -0700
commitd08c43d80ceb5fa6c96c328b8b36b59f4bb8e6f6 (patch)
treef7f9213f58af440f50fe572052aa03e414537a0f /include/diaspora.php
parentfaa7f97c25d40e842d3c09b3d7d5710e81a586c4 (diff)
downloadvolse-hubzilla-d08c43d80ceb5fa6c96c328b8b36b59f4bb8e6f6.tar.gz
volse-hubzilla-d08c43d80ceb5fa6c96c328b8b36b59f4bb8e6f6.tar.bz2
volse-hubzilla-d08c43d80ceb5fa6c96c328b8b36b59f4bb8e6f6.zip
toggle diaspora protocol on a per-channel level in addition to the existing per site setting. Default is enabled if the site setting is enabled.
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 25e0027b2..33ad4211b 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -64,6 +64,15 @@ function diaspora_dispatch($importer,$msg) {
return;
}
+ $allowed = get_pconfig($importer['channel_id'],'system','diaspora_allowed');
+ if($allowed === false)
+ $allowed = 1;
+
+ if(! intval($allowed)) {
+ logger('mod-diaspora: disallowed for channel ' . $importer['channel_name']);
+ return;
+ }
+
// php doesn't like dashes in variable names
$msg['message'] = str_replace(
@@ -169,6 +178,16 @@ function diaspora_process_outbound($arr) {
*/
+ $allowed = get_pconfig($arr['channel']['channel_id'],'system','diaspora_allowed');
+ if($allowed === false)
+ $allowed = 1;
+
+ if(! intval($allowed)) {
+ logger('mod-diaspora: disallowed for channel ' . $arr['channel']['channel_name']);
+ return;
+ }
+
+
if($arr['location'])
return;