aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-12 16:17:23 -0700
committerMario Vavti <mario@mariovavti.com>2017-06-14 16:44:16 +0200
commit7c363310428d8f76356eb1423554cc2de6ebd4a0 (patch)
tree4ad738da079803bdc4115254f5c49ec8f3ea9d93 /include/items.php
parent36cfdd529b51997977340b0de0375af2025bd6d4 (diff)
downloadvolse-hubzilla-7c363310428d8f76356eb1423554cc2de6ebd4a0.tar.gz
volse-hubzilla-7c363310428d8f76356eb1423554cc2de6ebd4a0.tar.bz2
volse-hubzilla-7c363310428d8f76356eb1423554cc2de6ebd4a0.zip
add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 206a97c42..fa61d71de 100755
--- a/include/items.php
+++ b/include/items.php
@@ -219,6 +219,11 @@ function can_comment_on_post($observer_xchan, $item) {
// logger('can_comment_on_post: comment_policy: ' . $item['comment_policy'], LOGGER_DEBUG);
+ $x = [ 'observer_hash' => $observer_xchan, 'item' => $item, 'allowed' => 'unset' ];
+ call_hooks('can_comment_on_post',$x);
+ if($x['allowed'] !== 'unset')
+ return $x['allowed'];
+
if(! $observer_xchan)
return false;