aboutsummaryrefslogtreecommitdiffstats
path: root/doc/hook/collect_public_recipients.bb
diff options
context:
space:
mode:
authorDM42.Net (Matt Dent) <dentm42@dm42.net>2019-01-12 22:37:44 -0500
committerDM42.Net (Matt Dent) <dentm42@dm42.net>2019-01-12 22:37:44 -0500
commit598cbf2210ed6c978ff30be58f0909aa9f93a049 (patch)
tree5d59aeeec81a28610c8fda06dfc5390744ceae03 /doc/hook/collect_public_recipients.bb
parentf6f4e40a64c771072d0c2425e9cf2f5f42c6cd3e (diff)
downloadvolse-hubzilla-598cbf2210ed6c978ff30be58f0909aa9f93a049.tar.gz
volse-hubzilla-598cbf2210ed6c978ff30be58f0909aa9f93a049.tar.bz2
volse-hubzilla-598cbf2210ed6c978ff30be58f0909aa9f93a049.zip
Add collect_public_recipients hook
Diffstat (limited to 'doc/hook/collect_public_recipients.bb')
-rw-r--r--doc/hook/collect_public_recipients.bb42
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/hook/collect_public_recipients.bb b/doc/hook/collect_public_recipients.bb
new file mode 100644
index 000000000..de3f4049e
--- /dev/null
+++ b/doc/hook/collect_public_recipients.bb
@@ -0,0 +1,42 @@
+[h2]collect_public_recipients[/h2]
+
+Replace the default list of public recipients (i.e., all contacts).
+
+Allow plugins to create a list of recipients for public messages instead of the default
+of all channel connections.
+
+Called with the following array:
+ [
+ 'recipients' => [],
+ 'item' => $item,
+ 'private_envelope' => $private_envelope,
+ 'include_groups' => $include_groups
+ ];
+
+[code]
+ if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') {
+
+ $hookinfo = [
+ 'recipients' => [],
+ 'item' => $item,
+ 'private_envelope' => $private_envelope,
+ 'include_groups' => $include_groups
+ ];
+
+ call_hooks('collect_public_recipients',$hookinfo);
+
+ if ($hookinfo['recipients']) {
+ $r = $hookinfo['recipients'];
+ } else {
+ $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and abook_pending = 0 and abook_archived = 0 ",
+ intval($item['uid'])
+ );
+ }
+
+ if($r) {
+
+ . . .
+
+[/code]
+
+see: include/item.php