aboutsummaryrefslogtreecommitdiffstats
path: root/doc/en/hook/collect_public_recipients.bb
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-04-30 06:59:20 +0000
committerMario <mario@mariovavti.com>2024-04-30 06:59:20 +0000
commitce15852b9a57a6c77531186ed24a389ebce8524e (patch)
treead04cef0d545c5e5e24e76060b6c32d65363d48e /doc/en/hook/collect_public_recipients.bb
parent48cec945051d259a06871d937ad998a1bd3e22ec (diff)
parent7c34a3676d294c9a1acc69f71ab3061074509160 (diff)
downloadvolse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.gz
volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.bz2
volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.zip
Merge branch 'rework-help-module' into 'dev'
Rework Help module + begin tests for Setup module See merge request hubzilla/core!2120
Diffstat (limited to 'doc/en/hook/collect_public_recipients.bb')
-rw-r--r--doc/en/hook/collect_public_recipients.bb42
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/en/hook/collect_public_recipients.bb b/doc/en/hook/collect_public_recipients.bb
new file mode 100644
index 000000000..de3f4049e
--- /dev/null
+++ b/doc/en/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