aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-28 04:41:12 -0700
committerfriendica <info@friendica.com>2013-09-28 04:41:12 -0700
commit110974eb55d58db26f1312d19ae4cdf09bbc796f (patch)
tree271663f4117bbef5cd26ab45cbad773aaaaa7698 /include/items.php
parent8fe557546921661e83a4cf1b0ba31e8bd3b26880 (diff)
downloadvolse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.tar.gz
volse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.tar.bz2
volse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.zip
fix can_comment_on_post when viewing wall-to-wall
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 79229acfe..b58b4415e 100755
--- a/include/items.php
+++ b/include/items.php
@@ -83,9 +83,20 @@ function collect_recipients($item,&$private) {
}
-
+/**
+ * @function can_comment_on_post($observer_xchan,$item);
+ *
+ * This function examines the comment_policy attached to an item and decides if the current observer has
+ * sufficient privileges to comment. This will normally be called on a remote site where perm_is_allowed()
+ * will not be suitable because the post owner does not have a local channel_id.
+ * Generally we should look at the item - in particular the author['book_flags'] and see if ABOOK_FLAG_SELF is set.
+ * If it is, you should be able to use perm_is_allowed( ... 'post_comments'), and if it isn't you need to call
+ * can_comment_on_post()
function can_comment_on_post($observer_xchan,$item) {
+
+// logger('can_comment_on_post: comment_policy: ' . $item['comment_policy'], LOGGER_DEBUG);
+
if(! $observer_xchan)
return false;
if($item['comment_policy'] === 'none')
@@ -98,10 +109,10 @@ function can_comment_on_post($observer_xchan,$item) {
return true;
break;
case 'public':
- # We don't allow public comments yet, until a policy
- # for dealing with anonymous comments is in place with
- # a means to moderate comments. Until that time, return
- # false.
+ // We don't allow public comments yet, until a policy
+ // for dealing with anonymous comments is in place with
+ // a means to moderate comments. Until that time, return
+ // false.
return false;
break;
case 'contacts':