aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-01-14 10:29:19 +0100
committerMario <mario@mariovavti.com>2019-01-14 10:29:19 +0100
commit90f6abfa7c31e278aab45bfaee5b79695e795b69 (patch)
treee795378289ef8d5d5a94687ca15e5dc030594475 /include
parente78fd09e07f8c8be082c7c968969ef2c9a685511 (diff)
parent598cbf2210ed6c978ff30be58f0909aa9f93a049 (diff)
downloadvolse-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 'include')
-rwxr-xr-xinclude/items.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 02d31fcb5..e5f2be003 100755
--- a/include/items.php
+++ b/include/items.php
@@ -95,9 +95,24 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
//$sys = get_sys_channel();
if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') {
- $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 ",
+
+ $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) {
// filter out restrictive public_policy settings from remote networks