aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-21 23:06:55 -0700
committerredmatrix <git@macgirvin.com>2016-07-21 23:06:55 -0700
commit7d897a3f03bd57ed556433eb84a41963ba44e02e (patch)
tree595fb74ec9ea0bc7130d18bd7993d719a222d343 /Zotlabs
parent2c1b4326132e5387d50fbe32096daf21bf520b69 (diff)
downloadvolse-hubzilla-7d897a3f03bd57ed556433eb84a41963ba44e02e.tar.gz
volse-hubzilla-7d897a3f03bd57ed556433eb84a41963ba44e02e.tar.bz2
volse-hubzilla-7d897a3f03bd57ed556433eb84a41963ba44e02e.zip
more work on #453
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Like.php31
1 files changed, 15 insertions, 16 deletions
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 1ca37d646..170349509 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -264,23 +264,22 @@ class Like extends \Zotlabs\Web\Controller {
logger('like: no item ' . $item_id);
killme();
}
-
-
+
+
+ xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
+
$item = $r[0];
- $owner_uid = $item['uid'];
- $owner_aid = $item['aid'];
-
-
- $sys = get_sys_channel();
-
-
- // if this is a "discover" item, (item['uid'] is the sys channel),
- // fallback to the item comment policy, which should've been
- // respected when generating the conversation thread.
- // Even if the activity is rejected by the item owner, it should still get attached
- // to the local discover conversation on this site.
-
- if(($owner_uid != $sys['channel_id']) && (! perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_comments'))) {
+
+ $owner_uid = $r[0]['uid'];
+ $owner_aid = $r[0]['aid'];
+
+ $can_comment = false;
+ if((array_key_exists('owner',$item)) && intval($item['owner']['abook_self']))
+ $can_comment = perm_is_allowed($item['uid'],$observer['xchan_hash'],'post_comments');
+ else
+ $can_comment = can_comment_on_post($observer['xchan_hash'],$item);
+
+ if(! $can_comment) {
notice( t('Permission denied') . EOL);
killme();
}