aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-01-02 20:38:56 +0100
committerMario Vavti <mario@mariovavti.com>2023-01-02 20:38:56 +0100
commit0e71bfe2224b8fc54a58aff80894e1f22294bd6e (patch)
tree58b5c3079746452592891f7e64d2e52f27007a95
parent37b539eaa56f3f0c6a9278ce31d82d2e4c048e88 (diff)
downloadvolse-hubzilla-0e71bfe2224b8fc54a58aff80894e1f22294bd6e.tar.gz
volse-hubzilla-0e71bfe2224b8fc54a58aff80894e1f22294bd6e.tar.bz2
volse-hubzilla-0e71bfe2224b8fc54a58aff80894e1f22294bd6e.zip
add sys channel to receiveres for public items
-rw-r--r--Zotlabs/Daemon/Notifier.php2
-rw-r--r--include/items.php14
2 files changed, 9 insertions, 7 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index bfccb4099..f51dfab28 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -509,6 +509,7 @@ class Notifier {
// public posts won't make it to the local public stream unless there's a recipient on this site.
// This code block sees if it's a public post and localhost is missing, and if so adds an entry for the local sys channel to the $hubs list
+ /* sys channel is now added in collect recipients
if (!self::$private) {
$found_localhost = false;
if ($hubs) {
@@ -529,6 +530,7 @@ class Notifier {
}
}
}
+ */
if (!$hubs) {
logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE);
diff --git a/include/items.php b/include/items.php
index 88efeb64e..891f16b7f 100644
--- a/include/items.php
+++ b/include/items.php
@@ -97,7 +97,6 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
$private_envelope = false;
require_once('include/channel.php');
- //$sys = get_sys_channel();
if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') {
@@ -114,7 +113,7 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
$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'])
+ intval($item['uid'])
);
}
@@ -141,18 +140,19 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) {
}
}
}
-// we probably want to check that discovery channel delivery is allowed before uncommenting this.
-// if($policy === 'pub')
-// $recipients[] = $sys['xchan_hash'];
}
- // Forward to thread listeners, *unless* there is even a remote hint that the item
- // might have some privacy attached. This could be (for instance) an ActivityPub DM
+ // Forward to thread listeners and pubstream (sys channel), *unless* there is even
+ // a remote hint that the item might have some privacy attached.
+ // This could be (for instance) an ActivityPub DM
// in the middle of a public thread. Unless we can guarantee beyond all doubt that
// this is public, don't allow it to go to thread listeners.
if(! intval($item['item_private'])) {
+ $sys = get_sys_channel();
+ $recipients[] = $sys['xchan_hash'];
+
$r = ThreadListener::fetch_by_target($item['parent_mid']);
if($r) {
foreach($r as $rv) {