From 3e6088c6142d1dabbfdbb8b5df276ae942bd3554 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 27 Mar 2017 15:49:48 -0700 Subject: add 'author_is_pmable()' function with plugin hooks to control whether or not to display a 'send mail' link in the thread author menu. --- doc/hook/author_is_pmable.bb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/hook/author_is_pmable.bb (limited to 'doc/hook') diff --git a/doc/hook/author_is_pmable.bb b/doc/hook/author_is_pmable.bb new file mode 100644 index 000000000..708350673 --- /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, '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. + + + -- cgit v1.2.3 From 9fb08fb5022c9eaf6368a9d3ac07bb1dcf856c20 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 5 Apr 2017 19:08:43 -0700 Subject: make legal_webbie() pluggable - * this should not be merged with federated projects unless the federation drivers make use of the hooks. --- doc/hook/legal_webbie.bb | 10 ++++++++++ doc/hook/legal_webbie_text.bb | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 doc/hook/legal_webbie.bb create mode 100644 doc/hook/legal_webbie_text.bb (limited to 'doc/hook') 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 -- cgit v1.2.3 From 35debe46bc0a10f3bad21303e127cb29526c94a2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 31 May 2017 18:14:12 -0700 Subject: a slight tweak to author_is_pmable hook to make it useful --- doc/hook/author_is_pmable.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/hook') diff --git a/doc/hook/author_is_pmable.bb b/doc/hook/author_is_pmable.bb index 708350673..11d1185f3 100644 --- a/doc/hook/author_is_pmable.bb +++ b/doc/hook/author_is_pmable.bb @@ -6,7 +6,7 @@ By default author_is_pmable() returns true for 'zot' xchans, and false for all o The plugin is passed an array - [ 'xchan' => $author_xchan, 'result' => 'unset' ] + [ '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. -- cgit v1.2.3 From 9c26ee122e0867fcd00b62fa475501b5d5e1c781 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 10 Jun 2017 16:00:21 -0700 Subject: missed this hook page when the hook was added --- doc/hook/connection_remove.bb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/hook/connection_remove.bb (limited to 'doc/hook') 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 -- cgit v1.2.3 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 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/hook/can_comment_on_post.bb (limited to 'doc/hook') 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 + -- cgit v1.2.3