aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-05 17:29:35 -0800
committerfriendica <info@friendica.com>2015-02-05 17:29:35 -0800
commitfe8a08a47482dabe1a406ca41a02dc058f25f92a (patch)
treef5b0cf1b2be4e0d20076a188ef69ff8d3a240a56 /include/diaspora.php
parent153719a20a88b8d4e9c562b185f94e1af72de1de (diff)
downloadvolse-hubzilla-fe8a08a47482dabe1a406ca41a02dc058f25f92a.tar.gz
volse-hubzilla-fe8a08a47482dabe1a406ca41a02dc058f25f92a.tar.bz2
volse-hubzilla-fe8a08a47482dabe1a406ca41a02dc058f25f92a.zip
over-ride permissions for sys channel delivery from diaspora
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 0e275a079..736be4f08 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -42,6 +42,7 @@ function diaspora_dispatch_public($msg) {
}
if($sys) {
+ $sys['system'] = true;
logger('diaspora_public: delivering to sys.');
diaspora_dispatch($sys,$msg);
}
@@ -49,10 +50,13 @@ function diaspora_dispatch_public($msg) {
-function diaspora_dispatch($importer,$msg,$attempt=1) {
+function diaspora_dispatch($importer,$msg) {
$ret = 0;
+ if(! array_key_exists('system',$importer))
+ $importer['system'] = false;
+
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod-diaspora: disabled');
@@ -105,7 +109,7 @@ function diaspora_dispatch($importer,$msg,$attempt=1) {
$ret = diaspora_signed_retraction($importer,$xmlbase->relayable_retraction,$msg);
}
elseif($xmlbase->photo) {
- $ret = diaspora_photo($importer,$xmlbase->photo,$msg,$attempt);
+ $ret = diaspora_photo($importer,$xmlbase->photo,$msg);
}
elseif($xmlbase->conversation) {
$ret = diaspora_conversation($importer,$xmlbase->conversation,$msg);
@@ -796,7 +800,7 @@ function diaspora_post($importer,$xml,$msg) {
}
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
logger('diaspora_post: Ignoring this author.');
return 202;
}
@@ -983,7 +987,7 @@ function diaspora_reshare($importer,$xml,$msg) {
if(! $contact)
return;
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
logger('diaspora_reshare: Ignoring this author: ' . $diaspora_handle . ' ' . print_r($xml,true));
return 202;
}
@@ -1150,7 +1154,7 @@ function diaspora_asphoto($importer,$xml,$msg) {
if(! $contact)
return;
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
logger('diaspora_asphoto: Ignoring this author.');
return 202;
}
@@ -1255,7 +1259,7 @@ function diaspora_comment($importer,$xml,$msg) {
return;
}
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments'))) {
logger('diaspora_comment: Ignoring this author.');
return 202;
}
@@ -1732,7 +1736,7 @@ function diaspora_message($importer,$xml,$msg) {
}
-function diaspora_photo($importer,$xml,$msg,$attempt=1) {
+function diaspora_photo($importer,$xml,$msg) {
$a = get_app();
@@ -1760,7 +1764,7 @@ function diaspora_photo($importer,$xml,$msg,$attempt=1) {
return;
}
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
logger('diaspora_photo: Ignoring this author.');
return 202;
}
@@ -1819,7 +1823,7 @@ function diaspora_like($importer,$xml,$msg) {
}
- if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments')) {
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments'))) {
logger('diaspora_like: Ignoring this author.');
return 202;
}