diff options
author | anaqreon <tamanning@zoho.com> | 2014-12-30 16:06:35 -0600 |
---|---|---|
committer | anaqreon <tamanning@zoho.com> | 2014-12-30 16:06:35 -0600 |
commit | b78a545a1056e6db9f4b6b4f262182b0a5c56e67 (patch) | |
tree | 515c2f742a5a39e18b00debf1849ee9703fa4a42 /include/zot.php | |
parent | d67c5a6ffd134602084a6dcb37b316bf768bf715 (diff) | |
parent | 43671a0a323afa758df56c06822ce3c46da026df (diff) | |
download | volse-hubzilla-b78a545a1056e6db9f4b6b4f262182b0a5c56e67.tar.gz volse-hubzilla-b78a545a1056e6db9f4b6b4f262182b0a5c56e67.tar.bz2 volse-hubzilla-b78a545a1056e6db9f4b6b4f262182b0a5c56e67.zip |
Merge pull request #1 from friendica/master
Pull from upstream
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php index 3b8584509..c88b2a369 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1417,8 +1417,9 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque return; } } - + foreach($deliveries as $d) { + $local_public = $public; $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($d['hash']) ); @@ -1432,8 +1433,18 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque $channel = $r[0]; // allow public postings to the sys channel regardless of permissions - if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private'])) - $public = true; + if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private'])) { + $local_public = true; + + $r = q("select xchan_flags from xchan where xchan_hash = '%s' limit 1", + dbesc($sender['hash']) + ); + // don't import sys channel posts from selfcensored authors + if($r && ($r[0]['xchan_flags'] & XCHAN_FLAGS_SELFCENSORED)) { + $local_public = false; + continue; + } + } $tag_delivery = tgroup_check($channel['channel_id'],$arr); @@ -1452,7 +1463,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque } } - if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $public)) { + if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $local_public)) { logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}"); $result[] = array($d['hash'],'permission denied',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); continue; @@ -1487,7 +1498,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque // the top level post is unlikely to be imported and // this is just an exercise in futility. - if((! $relay) && (! $request) && (! $public) + if((! $relay) && (! $request) && (! $local_public) && perm_is_allowed($channel['channel_id'],$sender['hash'],'send_stream')) { proc_run('php', 'include/notifier.php', 'request', $channel['channel_id'], $sender['hash'], $arr['parent_mid']); } |