aboutsummaryrefslogtreecommitdiffstats
path: root/doc/hook
diff options
context:
space:
mode:
Diffstat (limited to 'doc/hook')
-rw-r--r--doc/hook/author_is_pmable.bb14
-rw-r--r--doc/hook/can_comment_on_post.bb13
-rw-r--r--doc/hook/channel_links.bb12
-rw-r--r--doc/hook/connection_remove.bb9
-rw-r--r--doc/hook/legal_webbie.bb10
-rw-r--r--doc/hook/legal_webbie_text.bb7
-rw-r--r--doc/hook/probe_well_known.bb3
-rw-r--r--doc/hook/update_unseen.bb9
8 files changed, 74 insertions, 3 deletions
diff --git a/doc/hook/author_is_pmable.bb b/doc/hook/author_is_pmable.bb
new file mode 100644
index 000000000..11d1185f3
--- /dev/null
+++ b/doc/hook/author_is_pmable.bb
@@ -0,0 +1,14 @@
+[h2]author_is_pmable[/h2]
+
+Called from thread action menu before returning a 'send mail' link for the post author. Not all authors will be able to receive private mail, for instance those on other networks with incompatible mail systems.
+
+By default author_is_pmable() returns true for 'zot' xchans, and false for all others.
+
+The plugin is passed an array
+
+ [ 'xchan' => $author_xchan, 'abook' => abook record, 'result' => 'unset' ]
+
+A plugin which sets the 'result' to something besides 'unset' will over-ride the default behaviour. A value of true will enable the 'send mail' link and the private mail recipient will be set to the author's xchan_hash. A value of false will disable the 'send mail' link.
+
+
+
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/hook/channel_links.bb b/doc/hook/channel_links.bb
new file mode 100644
index 000000000..c0243dac6
--- /dev/null
+++ b/doc/hook/channel_links.bb
@@ -0,0 +1,12 @@
+[h2]channel_links[/h2]
+
+Called when generating the Link HTTP header for the channel page. Different protocol stacks can add links to this header.
+
+Hook data = array
+ 'channel_address' => channel nickname, no checking is done to see if it is valid
+ 'channel_links' => array of channel links in the format
+ 'url' => url of resource
+ 'rel' => link relation
+ 'type' => MIME type
+
+All fields are required \ No newline at end of file
diff --git a/doc/hook/connection_remove.bb b/doc/hook/connection_remove.bb
new file mode 100644
index 000000000..bd13ae5f2
--- /dev/null
+++ b/doc/hook/connection_remove.bb
@@ -0,0 +1,9 @@
+[h3]connection_remove[/h3]
+
+Called when deleting a connection.
+
+
+Passed parameter array:
+
+ 'channel_id' => channel_id of the channel removing the connection
+ 'abook_id' => abook_id of the connection being removed
diff --git a/doc/hook/legal_webbie.bb b/doc/hook/legal_webbie.bb
new file mode 100644
index 000000000..8c7d32d56
--- /dev/null
+++ b/doc/hook/legal_webbie.bb
@@ -0,0 +1,10 @@
+[h2]legal_webbie[/h2]
+
+Called when validating a channel address. By default the valid characters are
+a-z,0-9,-,_, and . Uppercase ASCII characters are folded to lower and any invalid characters are stripped.
+
+Some federated networks require more restrictive rules.
+
+The hook is called with an array [ 'input' => (supplied text), 'output' => (validated text) ]
+
+A plugin will generally perform a regex filter or text operation on 'input' and provide the results in 'output'. \ No newline at end of file
diff --git a/doc/hook/legal_webbie_text.bb b/doc/hook/legal_webbie_text.bb
new file mode 100644
index 000000000..32c74c93b
--- /dev/null
+++ b/doc/hook/legal_webbie_text.bb
@@ -0,0 +1,7 @@
+[h2]legal_webbie_text[/h2]
+
+Returns a string describing the text rules applied to legal_webbie().
+
+Called with an array [ 'text' => (descriptive text describing text character limitations) ]
+
+A plugin should return the description of the allowed characters and operation performed in the 'legal_webbie' hook to assist people when creating a new channel. \ No newline at end of file
diff --git a/doc/hook/probe_well_known.bb b/doc/hook/probe_well_known.bb
deleted file mode 100644
index 62898c536..000000000
--- a/doc/hook/probe_well_known.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-[h2]probe_well_known[/h2]
-
-This hook is under construction and not currently used - see include/probe.php \ No newline at end of file
diff --git a/doc/hook/update_unseen.bb b/doc/hook/update_unseen.bb
new file mode 100644
index 000000000..8fb02c239
--- /dev/null
+++ b/doc/hook/update_unseen.bb
@@ -0,0 +1,9 @@
+[h3]update_unseen[/h3]
+
+Called prior to automatically marking items 'seen'; allowing a plugin the choice to not perform this action.
+
+hook data
+
+[ 'channel_id' => local_channel(), 'update' => 'unset' ];
+
+If 'update' is set to 0 or false on return, the update operation is not performed. \ No newline at end of file