From 8321a2e41a09ba77749b288cca003413fe6a9ebb Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 4 Jun 2013 20:07:13 -0700 Subject: tagging posts now sends out a presumably legal activity message - all that's missing is catching it on the post owner's side, checking if people can tag this stream, and then add the tag to the parent message. --- include/items.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/items.php') 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; } -- cgit v1.2.3