aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-28 10:02:05 +0000
committerMario <mario@mariovavti.com>2021-05-28 10:13:25 +0000
commite9088bd52e84f765fc63e030aec6cac771882c61 (patch)
tree59b8dc60df18eb33e7a946a5452b6c172f665206 /Zotlabs
parent92ea7fcfb1b2d10a03e7c157d944e681453e5bbe (diff)
downloadvolse-hubzilla-e9088bd52e84f765fc63e030aec6cac771882c61.tar.gz
volse-hubzilla-e9088bd52e84f765fc63e030aec6cac771882c61.tar.bz2
volse-hubzilla-e9088bd52e84f765fc63e030aec6cac771882c61.zip
notifications: if we have to return early, make sure to set offset to -1 to prevent looping
(cherry picked from commit f72b8ce30fbbcd672f09eaf9de41e8881ec622ad)
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Sse_bs.php30
1 files changed, 23 insertions, 7 deletions
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index cc67c8eb7..109b043ad 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -144,11 +144,15 @@ class Sse_bs extends Controller {
$result['network']['notifications'] = [];
$result['network']['count'] = 0;
- if(! self::$uid)
+ if(! self::$uid) {
+ $result['network']['offset'] = -1;
return $result;
+ }
- if(! (self::$vnotify & VNOTIFY_NETWORK))
+ if(! (self::$vnotify & VNOTIFY_NETWORK)) {
+ $result['network']['offset'] = -1;
return $result;
+ }
$limit = intval(self::$limit);
$offset = self::$offset;
@@ -216,11 +220,15 @@ class Sse_bs extends Controller {
$result['dm']['notifications'] = [];
$result['dm']['count'] = 0;
- if(! self::$uid)
+ if(! self::$uid) {
+ $result['dm']['offset'] = -1;
return $result;
+ }
- if(! (self::$vnotify & VNOTIFY_MAIL))
+ if(! (self::$vnotify & VNOTIFY_MAIL)) {
+ $result['dm']['offset'] = -1;
return $result;
+ }
$limit = intval(self::$limit);
$offset = self::$offset;
@@ -287,11 +295,15 @@ class Sse_bs extends Controller {
$result['home']['notifications'] = [];
$result['home']['count'] = 0;
- if(! self::$uid)
+ if(! self::$uid) {
+ $result['home']['offset'] = -1;
return $result;
+ }
- if(! (self::$vnotify & VNOTIFY_CHANNEL))
+ if(! (self::$vnotify & VNOTIFY_CHANNEL)) {
+ $result['home']['offset'] = -1;
return $result;
+ }
$limit = intval(self::$limit);
$offset = self::$offset;
@@ -359,15 +371,19 @@ class Sse_bs extends Controller {
$result['pubs']['notifications'] = [];
$result['pubs']['count'] = 0;
- if(! (self::$vnotify & VNOTIFY_PUBS))
+ if(! (self::$vnotify & VNOTIFY_PUBS)) {
+ $result['pubs']['offset'] = -1;
return $result;
+ }
if((observer_prohibited(true))) {
+ $result['pubs']['offset'] = -1;
return $result;
}
if(! intval(get_config('system','open_pubstream',1))) {
if(! get_observer_hash()) {
+ $result['pubs']['offset'] = -1;
return $result;
}
}