diff options
author | Habeas Codice <habeascodice@federated.social> | 2014-11-19 21:11:11 -0800 |
---|---|---|
committer | Habeas Codice <habeascodice@federated.social> | 2014-11-19 21:11:11 -0800 |
commit | c8af19c69c03b39d5eded833a2d9d8ed9ab5826c (patch) | |
tree | 16ded6330f1baa9d8e889978c9e093f1e90d7d85 /include/zot.php | |
parent | 92d0a9404ff92da23b558f9a73a3150f97b6a08e (diff) | |
parent | 18cae8a78cb3df8ffcd9e4787c3b572c799036da (diff) | |
download | volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.gz volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.bz2 volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php index 3ffc9b43f..3b8584509 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1256,8 +1256,14 @@ function zot_import($arr, $sender_url) { function public_recips($msg) { + + require_once('include/identity.php'); + $check_mentions = false; + $include_sys = false; + if($msg['message']['type'] === 'activity') { + $include_sys = true; $col = 'channel_w_stream'; $field = PERMS_W_STREAM; if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) { @@ -1307,6 +1313,14 @@ function public_recips($msg) { $r = array_merge($r,$x); + //logger('message: ' . print_r($msg['message'],true)); + + if($include_sys && array_key_exists('public_scope',$msg['message']) && $msg['message']['public_scope'] === 'public') { + $sys = get_sys_channel(); + if($sys) + $r[] = array('hash' => $sys['channel_hash']); + } + // look for any public mentions on this site // They will get filtered by tgroup_check() so we don't need to check permissions now @@ -1337,7 +1351,7 @@ function public_recips($msg) { function allowed_public_recips($msg) { - logger('allowed_public_recips: ' . print_r($msg,true)); + logger('allowed_public_recips: ' . print_r($msg,true),LOGGER_DATA); $recips = public_recips($msg); @@ -1414,8 +1428,13 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque continue; } + $channel = $r[0]; + // allow public postings to the sys channel regardless of permissions + if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private'])) + $public = true; + $tag_delivery = tgroup_check($channel['channel_id'],$arr); $perm = (($arr['mid'] == $arr['parent_mid']) ? 'send_stream' : 'post_comments'); |