add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy

This commit is contained in:
zotlabs
2017-06-12 16:17:23 -07:00
parent 6ce9eedb5f
commit 5b3e863323
3 changed files with 21 additions and 0 deletions

View File

@@ -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;