From 5b3e863323a6b70651454c0972a586e677f55c3d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Jun 2017 16:17:23 -0700 Subject: add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy --- include/items.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 707f07f4a..e79707aeb 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; -- cgit v1.2.3