diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-09-05 12:20:06 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-09-05 12:20:06 +0200 |
commit | 6667ba4172188825dd4757758256d9c637a9d405 (patch) | |
tree | e72c444f89bff346779e45cdbcdff0d48f4e15ae /include | |
parent | 75e8aa8aee9c735308ed36bef5648cdceff6351e (diff) | |
parent | a81a1bd5f1cbaf3bad1735ba0a188128c8e54577 (diff) | |
download | volse-hubzilla-6667ba4172188825dd4757758256d9c637a9d405.tar.gz volse-hubzilla-6667ba4172188825dd4757758256d9c637a9d405.tar.bz2 volse-hubzilla-6667ba4172188825dd4757758256d9c637a9d405.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/zot.php | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/include/zot.php b/include/zot.php index 52102e147..e8ac2df02 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1808,13 +1808,28 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ else { $arr['item_wall'] = 0; } - - 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']}"); - $DR->update('permission denied'); - $result[] = $DR->get(); - continue; - } + + + if ((! $tag_delivery) && (! $local_public)) { + $allowed = (perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)); + + if((! $allowed) && $perm == 'post_comments') { + $parent = q("select * from item where mid = '%s' and uid = %d limit 1", + dbesc($arr['parent_mid']), + intval($channel['channel_id']) + ); + if ($parent) { + $allowed = can_comment_on_post($d['hash'],$parent[0]); + } + } + + if (! $allowed) { + logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}"); + $DR->update('permission denied'); + $result[] = $DR->get(); + continue; + } + } if($arr['mid'] != $arr['parent_mid']) { |