fix can_comment_on_post when viewing wall-to-wall

This commit is contained in:
friendica
2013-09-28 04:41:12 -07:00
parent 8fe5575469
commit 110974eb55
4 changed files with 35 additions and 15 deletions

View File

@@ -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();
}
}