aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-08 20:35:08 +0000
committerMario <mario@mariovavti.com>2024-07-08 20:35:08 +0000
commit5cbae0fb81078a60c9fa507be9c725856d7ecb29 (patch)
tree32bcec63c1b3d13feb1576f4512e73ba1cca14ef /boot.php
parent2ddc0875128e17a9e36393974d721f19ccbe64e3 (diff)
downloadvolse-hubzilla-5cbae0fb81078a60c9fa507be9c725856d7ecb29.tar.gz
volse-hubzilla-5cbae0fb81078a60c9fa507be9c725856d7ecb29.tar.bz2
volse-hubzilla-5cbae0fb81078a60c9fa507be9c725856d7ecb29.zip
improve handling of sse especially in relation with page reloads
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php28
1 files changed, 6 insertions, 22 deletions
diff --git a/boot.php b/boot.php
index 52c222b0a..88482cf2d 100644
--- a/boot.php
+++ b/boot.php
@@ -1928,19 +1928,11 @@ function notice($s) {
}
}
- $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+ $x = get_xconfig($hash, 'sse', 'notifications', []);
- if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
- set_xconfig($hash, 'sse', 'notifications', []);
- }
-
- $x = get_xconfig($hash, 'sse', 'notifications');
-
- if ($x === false)
- $x = [];
-
- if (isset($x['notice']) && in_array($s, $x['notice']['notifications']))
+ if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) {
return;
+ }
if (App::$interactive) {
$x['notice']['notifications'][] = $s;
@@ -1988,19 +1980,11 @@ function info($s) {
}
}
- $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+ $x = get_xconfig($hash, 'sse', 'notifications', []);
- if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
- set_xconfig($hash, 'sse', 'notifications', []);
- }
-
- $x = get_xconfig($hash, 'sse', 'notifications');
-
- if ($x === false)
- $x = [];
-
- if (isset($x['info']) && in_array($s, $x['info']['notifications']))
+ if (isset($x['info']) && in_array($s, $x['info']['notifications'])) {
return;
+ }
if (App::$interactive) {
$x['info']['notifications'][] = $s;