aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-04 20:07:13 -0700
committerfriendica <info@friendica.com>2013-06-04 20:07:13 -0700
commit8321a2e41a09ba77749b288cca003413fe6a9ebb (patch)
tree7a124d6754aa05654b94b80c1be44e7fdf740da6 /include
parent0deec983b475f30269cbf34606ec93fbad36a4a5 (diff)
downloadvolse-hubzilla-8321a2e41a09ba77749b288cca003413fe6a9ebb.tar.gz
volse-hubzilla-8321a2e41a09ba77749b288cca003413fe6a9ebb.tar.bz2
volse-hubzilla-8321a2e41a09ba77749b288cca003413fe6a9ebb.zip
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.
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php12
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;
}