aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php78
1 files changed, 76 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 9b0c6fb84..dcda705f0 100644
--- a/boot.php
+++ b/boot.php
@@ -66,7 +66,7 @@ require_once('include/security.php');
define('PLATFORM_NAME', 'hubzilla');
-define('STD_VERSION', '9.3.5');
+define('STD_VERSION', '9.3.6');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);
@@ -1897,6 +1897,8 @@ function can_view_public_stream() {
*/
function notice($s) {
+/*
+
if (!session_id()) {
return;
}
@@ -1914,6 +1916,42 @@ function notice($s) {
if (App::$interactive) {
$_SESSION['sysmsg'][] = $s;
}
+*/
+
+ $hash = get_observer_hash();
+ $sse_id = false;
+
+ if (!$hash) {
+ if (session_id()) {
+ $sse_id = true;
+ $hash = 'sse_id.' . session_id();
+ }
+ else {
+ return;
+ }
+ }
+
+ $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;
+ }
+
+ if (App::$interactive) {
+ $x['notice']['notifications'][] = $s;
+ set_xconfig($hash, 'sse', 'notifications', $x);
+ }
}
@@ -1928,7 +1966,7 @@ function notice($s) {
* @param string $s Text to display
*/
function info($s) {
-
+/*
if (!session_id()) {
return;
}
@@ -1946,6 +1984,42 @@ function info($s) {
if (App::$interactive) {
$_SESSION['sysmsg_info'][] = $s;
}
+*/
+
+ $hash = get_observer_hash();
+ $sse_id = false;
+
+ if (!$hash) {
+ if (session_id()) {
+ $sse_id = true;
+ $hash = 'sse_id.' . session_id();
+ }
+ else {
+ return;
+ }
+ }
+
+ $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;
+ }
+
+ if (App::$interactive) {
+ $x['info']['notifications'][] = $s;
+ set_xconfig($hash, 'sse', 'notifications', $x);
+ }
}