aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-12-07 14:07:31 +0000
committerMario <mario@mariovavti.com>2022-12-07 14:07:31 +0000
commit9f8585914c59117a41cd232435bc1e592ebdc0f1 (patch)
tree7533d0c86818e18742c050cc6f825d98f4ab75b8 /Zotlabs
parent3ba27b9752a38da7d0108bfa181c10b50e5e9383 (diff)
downloadvolse-hubzilla-9f8585914c59117a41cd232435bc1e592ebdc0f1.tar.gz
volse-hubzilla-9f8585914c59117a41cd232435bc1e592ebdc0f1.tar.bz2
volse-hubzilla-9f8585914c59117a41cd232435bc1e592ebdc0f1.zip
sse_bs: respect the site firehose setting
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Sse_bs.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index 4aabcafcb..ca9630c02 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -421,13 +421,19 @@ class Sse_bs extends Controller {
if(self::$xchans)
$sql_extra2 = " AND CASE WHEN verb = '" . ACTIVITY_SHARE . "' THEN owner_xchan ELSE author_xchan END IN (" . self::$xchans . ") ";
+ $uids = " AND uid IN ( " . $sys['channel_id'] . " ) ";
+
+ $site_firehose = get_config('system', 'site_firehose', 0);
+ if($site_firehose) {
+ $uids = " AND uid IN ( " . stream_perms_api_uids(PERMS_PUBLIC) . " ) AND item_private = 0 AND item_wall = 1 ";
+ }
+
$item_normal = item_normal();
if ($notifications) {
$items = q("SELECT * FROM item
- WHERE uid = %d
+ WHERE true $uids
AND created <= '%s'
- AND item_unseen = 1
AND obj_type NOT IN ('Document', 'Video', 'Audio', 'Image')
AND author_xchan != '%s'
AND created > '%s'
@@ -435,7 +441,6 @@ class Sse_bs extends Controller {
$sql_extra
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
- intval($sys['channel_id']),
dbescdate($_SESSION['sse_loadtime']),
dbesc(self::$ob_hash),
dbescdate($_SESSION['static_loadtime'])
@@ -454,17 +459,14 @@ class Sse_bs extends Controller {
else {
$result['pubs']['offset'] = -1;
}
-
-
}
$r = q("SELECT id FROM item
- WHERE uid = %d AND item_unseen = 1
+ WHERE true $uids
AND created > '%s'
$item_normal
$sql_extra
AND author_xchan != '%s' LIMIT 100",
- intval($sys['channel_id']),
dbescdate($_SESSION['static_loadtime']),
dbesc(self::$ob_hash)
);