aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boot.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 3e07bcaaf..b20acb18f 100644
--- a/boot.php
+++ b/boot.php
@@ -1928,7 +1928,18 @@ function notice($s) {
}
}
- $x = get_xconfig($hash, 'sse', 'notifications', []);
+ $x = null;
+
+ $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+
+ if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
+ set_xconfig($hash, 'sse', 'notifications', []);
+ $x = [];
+ }
+
+ if ($x === null) {
+ $x = get_xconfig($hash, 'sse', 'notifications', []);
+ }
if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) {
return;
@@ -1980,7 +1991,18 @@ function info($s) {
}
}
- $x = get_xconfig($hash, 'sse', 'notifications', []);
+ $x = null;
+
+ $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+
+ if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
+ set_xconfig($hash, 'sse', 'notifications', []);
+ $x = [];
+ }
+
+ if ($x === null) {
+ $x = get_xconfig($hash, 'sse', 'notifications', []);
+ }
if (isset($x['info']) && in_array($s, $x['info']['notifications'])) {
return;