aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-12 15:31:36 +1000
committerredmatrix <redmatrix@redmatrix.me>2015-08-12 15:31:36 +1000
commitad02d5589dfea6ea2b587aeabfb0ef5fe4fef67c (patch)
treed146c5b876514f8cd75923f96bda2c78b747e738
parenteae88b081534a407ae39297b6608911112f95666 (diff)
parent36b5f6acfed95b6af5474e391d024d2e1eb968ac (diff)
downloadvolse-hubzilla-ad02d5589dfea6ea2b587aeabfb0ef5fe4fef67c.tar.gz
volse-hubzilla-ad02d5589dfea6ea2b587aeabfb0ef5fe4fef67c.tar.bz2
volse-hubzilla-ad02d5589dfea6ea2b587aeabfb0ef5fe4fef67c.zip
Merge pull request #383 from solstag/commentpermgood
Require comment perms only for own posts, allow senders to deliver co…
-rw-r--r--include/zot.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index a677da808..b88bf72c3 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1560,7 +1560,17 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
$tag_delivery = tgroup_check($channel['channel_id'],$arr);
- $perm = (($arr['mid'] == $arr['parent_mid']) ? 'send_stream' : 'post_comments');
+ if ($arr['mid'] == $arr['parent_mid']){
+ $perm = 'send_stream';
+ }
+ else{
+ $r = q("select item_owner from item where item.mid == '%s' limit 1",
+ dbesc($arr['parent_mid']));
+ if($channel['channel_hash'] == $r[0]['item_owner'])
+ $perm = 'post_comments';
+ else
+ $perm = 'send_stream';
+ }
// This is our own post, possibly coming from a channel clone