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.

This commit is contained in:
friendica
2013-06-04 20:07:13 -07:00
parent 0deec983b4
commit 8321a2e41a
2 changed files with 23 additions and 68 deletions

View File

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