From 110974eb55d58db26f1312d19ae4cdf09bbc796f Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 28 Sep 2013 04:41:12 -0700 Subject: fix can_comment_on_post when viewing wall-to-wall --- mod/item.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index 813bcf283..f1fbd53b3 100644 --- a/mod/item.php +++ b/mod/item.php @@ -161,20 +161,26 @@ function item_post(&$a) { if($parent) { logger('mod_item: item_post parent=' . $parent); - if(! can_comment_on_post($observer['xchan_hash'],$parent_item)) { + $can_comment = false; + if((array_key_exists('owner',$parent_item)) && ($parent_item['owner']['abook_flags'] & ABOOK_FLAG_SELF)) + $can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments'); + else + $can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item); + + if(! $can_comment) { notice( t('Permission denied.') . EOL) ; if(x($_REQUEST,'return')) goaway($a->get_baseurl() . "/" . $return_path ); killme(); } } - - - if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],(($parent) ? 'post_comments' : 'post_wall'))) { - notice( t('Permission denied.') . EOL) ; - if(x($_REQUEST,'return')) - goaway($a->get_baseurl() . "/" . $return_path ); - killme(); + else { + if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_wall')) { + notice( t('Permission denied.') . EOL) ; + if(x($_REQUEST,'return')) + goaway($a->get_baseurl() . "/" . $return_path ); + killme(); + } } -- cgit v1.2.3