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 --- doc/hook/can_comment_on_post.bb | 13 +++++++++++++ doc/hooklist.bb | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 doc/hook/can_comment_on_post.bb (limited to 'doc') diff --git a/doc/hook/can_comment_on_post.bb b/doc/hook/can_comment_on_post.bb new file mode 100644 index 000000000..2cfd3b2da --- /dev/null +++ b/doc/hook/can_comment_on_post.bb @@ -0,0 +1,13 @@ +[h3]can_comment_on_post[/h3] + +Called when deciding whether or not to display a comment box for a post. + + +Hook data (array): + observer_hash => xchan_hash of current observer + item => posted item + allowed => 'unset' + + +To over-ride the default behaviour, change allowed to true or false + diff --git a/doc/hooklist.bb b/doc/hooklist.bb index ab9c0529d..da4d9596b 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -82,6 +82,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/build_pagehead]build_pagehead[/zrl] Called when creating the HTML page header +[zrl=[baseurl]/help/hook/can_comment_on_post]can_comment_on_post[/zrl] + Called when deciding whether or not to present a comment box for a post + [zrl=[baseurl]/help/hook/change_channel]change_channel[/zrl] Called when logging in to a channel (either during login or afterward through the channel manager) -- cgit v1.2.3