aboutsummaryrefslogtreecommitdiffstats
path: root/mod/like.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-07 18:32:22 -0700
committerfriendica <info@friendica.com>2014-04-07 18:32:22 -0700
commitd820fa155bea343f7029e71a6691dc43d03eb138 (patch)
tree6d0627c703fa90b02cfe144fd1ce32b614f09bf4 /mod/like.php
parent28228f58629828c9bcabd5cf6b99180f9fdc9d4a (diff)
downloadvolse-hubzilla-d820fa155bea343f7029e71a6691dc43d03eb138.tar.gz
volse-hubzilla-d820fa155bea343f7029e71a6691dc43d03eb138.tar.bz2
volse-hubzilla-d820fa155bea343f7029e71a6691dc43d03eb138.zip
possible fix for issue #398
Diffstat (limited to 'mod/like.php')
-rwxr-xr-xmod/like.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/mod/like.php b/mod/like.php
index 007d1aee1..a76867422 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -48,12 +48,20 @@ function like_content(&$a) {
$item = $r[0];
+ $sys = get_sys_channel();
+
$owner_uid = $item['uid'];
$owner_aid = $item['aid'];
- if(! perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_comments')) {
- notice( t('Permission denied') . EOL);
- killme();
+ // 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'))) {
+ notice( t('Permission denied') . EOL);
+ killme();
}
$r = q("select * from xchan where xchan_hash = '%s' limit 1",