diff options
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index 4704ca344..6ad3f193d 100755 --- a/include/items.php +++ b/include/items.php @@ -98,17 +98,25 @@ function post_activity_item($arr) { $ret = array('success' => false); + $is_comment = false; + if((($arr['parent']) && $arr['parent'] != $arr['id']) || (($arr['parent_mid']) && $arr['parent_mid'] != $arr['mid'])) + $is_comment = true; + if(! x($arr,'item_flags')) { - $arr['item_flags'] = ITEM_ORIGIN | ITEM_WALL | ITEM_THREAD_TOP; + if($is_comment) + $arr['item_flags'] = ITEM_ORIGIN; + else + $arr['item_flags'] = ITEM_ORIGIN | ITEM_WALL | ITEM_THREAD_TOP; } + $channel = get_app()->get_channel(); $observer = get_app()->get_observer(); $arr['aid'] = ((x($arr,'aid')) ? $arr['aid'] : $channel['channel_account_id']); $arr['uid'] = ((x($arr,'uid')) ? $arr['uid'] : $channel['channel_id']); - if(! perm_is_allowed($arr['uid'],$observer['xchan_hash'],(($arr['parent']) ? 'post_comment' : 'post_wall'))) { + if(! perm_is_allowed($arr['uid'],$observer['xchan_hash'],(($is_comment) ? 'post_comments' : 'post_wall'))) { $ret['message'] = t('Permission denied'); return $ret; } |