aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-09-05 21:02:06 -0700
committerzotlabs <mike@macgirvin.com>2018-09-05 21:02:06 -0700
commitc5bc4fe24519079664b8f63a5e9082f0a7ffc945 (patch)
tree9039d12215106b92b21f42977abbcdb44b529f65 /include
parentbc4a92b702618aa83991ea65eb24d653cfc6601a (diff)
parentea381d918021a33a73df40de95fd0c57f0edc5c2 (diff)
downloadvolse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.tar.gz
volse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.tar.bz2
volse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge
Diffstat (limited to 'include')
-rw-r--r--include/zot.php29
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']) {