diff options
author | Mario <mario@mariovavti.com> | 2019-01-14 10:29:19 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-01-14 10:29:19 +0100 |
commit | 90f6abfa7c31e278aab45bfaee5b79695e795b69 (patch) | |
tree | e795378289ef8d5d5a94687ca15e5dc030594475 /doc | |
parent | e78fd09e07f8c8be082c7c968969ef2c9a685511 (diff) | |
parent | 598cbf2210ed6c978ff30be58f0909aa9f93a049 (diff) | |
download | volse-hubzilla-90f6abfa7c31e278aab45bfaee5b79695e795b69.tar.gz volse-hubzilla-90f6abfa7c31e278aab45bfaee5b79695e795b69.tar.bz2 volse-hubzilla-90f6abfa7c31e278aab45bfaee5b79695e795b69.zip |
Merge branch 'patch-20190113a' into 'dev'
Add collect_public_recipients hook
See merge request hubzilla/core!1467
Diffstat (limited to 'doc')
-rw-r--r-- | doc/hook/collect_public_recipients.bb | 42 | ||||
-rw-r--r-- | doc/hooklist.bb | 3 |
2 files changed, 45 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 diff --git a/doc/hooklist.bb b/doc/hooklist.bb index afb2cebee..f7dbf3fa0 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -136,6 +136,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/check_siteallowed]check_siteallowed[/zrl] Used to over-ride or bypass the site black/white block lists +[zrl=[baseurl]/help/hook/collect_public_recipients]collect_public_recipients[/zrl] + Used to establish a list of recipients to send a public message to. + [zrl=[baseurl]/help/hook/comment_buttons]comment_buttons[/zrl] Called when rendering the edit buttons for comments |