From 983fc84f283f34783b281ab047dc47c581cb937c Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 19 Jul 2024 19:35:21 +0000 Subject: more work on sse sys messages --- boot.php | 94 ++++++++++------------------------------------------------------ 1 file changed, 14 insertions(+), 80 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 473de2cef..f205f7a21 100644 --- a/boot.php +++ b/boot.php @@ -1897,57 +1897,22 @@ function can_view_public_stream() { */ function notice($s) { - /* - if(! session_id()) - return; - - if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); - - // ignore duplicated error messages which haven't yet been displayed - // - typically seen as multiple 'permission denied' messages - // as a result of auto-reloading a protected page with &JS=1 - - if(in_array($s, $_SESSION['sysmsg'])) - return; - - 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; - } + if (!session_id()) { + 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 (!isset($_SESSION['sysmsg'])) { + $_SESSION['sysmsg'] = []; } - if ($x === null) { - $x = get_xconfig($hash, 'sse', 'notifications', []); - } + // ignore duplicated error messages which haven't yet been displayed - if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) { + if (in_array($s, $_SESSION['sysmsg'])) { return; } if (App::$interactive) { - $x['notice']['notifications'][] = $s; - set_xconfig($hash, 'sse', 'notifications', $x); + $_SESSION['sysmsg'][] = $s; } } @@ -1964,53 +1929,22 @@ function notice($s) { */ function info($s) { - /* - if(! session_id()) - return; - - if(! x($_SESSION, 'sysmsg_info')) - $_SESSION['sysmsg_info'] = array(); - - if(in_array($s, $_SESSION['sysmsg_info'])) - return; - - 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; - } + if (!session_id()) { + 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 (!isset($_SESSION['sysmsg_info'])) { + $_SESSION['sysmsg_info'] = []; } - if ($x === null) { - $x = get_xconfig($hash, 'sse', 'notifications', []); - } + // ignore duplicated error messages which haven't yet been displayed - if (isset($x['info']) && in_array($s, $x['info']['notifications'])) { + if (in_array($s, $_SESSION['sysmsg_info'])) { return; } if (App::$interactive) { - $x['info']['notifications'][] = $s; - set_xconfig($hash, 'sse', 'notifications', $x); + $_SESSION['sysmsg_info'][] = $s; } } -- cgit v1.2.3 From 5a1079750e5b9fcfe9e86198a4bea119d1cbfc70 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 07:09:27 +0000 Subject: bump version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index f205f7a21..2b9e8ccba 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.2'); +define('STD_VERSION', '9.3.3'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From c22f633ae0d42b5a0076a11dd08952817a613342 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 10:00:47 +0000 Subject: Revert "more work on sse sys messages" This reverts commit 983fc84f283f34783b281ab047dc47c581cb937c --- boot.php | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 14 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 2b9e8ccba..78ad668ca 100644 --- a/boot.php +++ b/boot.php @@ -1897,22 +1897,57 @@ function can_view_public_stream() { */ function notice($s) { - if (!session_id()) { - return; + /* + if(! session_id()) + return; + + if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); + + // ignore duplicated error messages which haven't yet been displayed + // - typically seen as multiple 'permission denied' messages + // as a result of auto-reloading a protected page with &JS=1 + + if(in_array($s, $_SESSION['sysmsg'])) + return; + + 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; + } } - if (!isset($_SESSION['sysmsg'])) { - $_SESSION['sysmsg'] = []; + $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 = []; } - // ignore duplicated error messages which haven't yet been displayed + if ($x === null) { + $x = get_xconfig($hash, 'sse', 'notifications', []); + } - if (in_array($s, $_SESSION['sysmsg'])) { + if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) { return; } if (App::$interactive) { - $_SESSION['sysmsg'][] = $s; + $x['notice']['notifications'][] = $s; + set_xconfig($hash, 'sse', 'notifications', $x); } } @@ -1929,22 +1964,53 @@ function notice($s) { */ function info($s) { - if (!session_id()) { - return; + /* + if(! session_id()) + return; + + if(! x($_SESSION, 'sysmsg_info')) + $_SESSION['sysmsg_info'] = array(); + + if(in_array($s, $_SESSION['sysmsg_info'])) + return; + + 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; + } } - if (!isset($_SESSION['sysmsg_info'])) { - $_SESSION['sysmsg_info'] = []; + $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 = []; } - // ignore duplicated error messages which haven't yet been displayed + if ($x === null) { + $x = get_xconfig($hash, 'sse', 'notifications', []); + } - if (in_array($s, $_SESSION['sysmsg_info'])) { + if (isset($x['info']) && in_array($s, $x['info']['notifications'])) { return; } if (App::$interactive) { - $_SESSION['sysmsg_info'][] = $s; + $x['info']['notifications'][] = $s; + set_xconfig($hash, 'sse', 'notifications', $x); } } -- cgit v1.2.3 From 5f77e9f4ce52e773ad2eca1cb2a51937ac45cb83 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 10:17:12 +0000 Subject: version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 78ad668ca..3f4ea491c 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.3'); +define('STD_VERSION', '9.3.4'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 70212cdb59f5a641893570effbfaca7e48185c11 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 13:07:07 +0000 Subject: Revert "version" This reverts commit 5f77e9f4ce52e773ad2eca1cb2a51937ac45cb83 --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 3f4ea491c..78ad668ca 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.4'); +define('STD_VERSION', '9.3.3'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 3fca63a15f50743952ce87672974145a0c2b4abb Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 13:08:52 +0000 Subject: Revert "Revert "more work on sse sys messages"" This reverts commit c22f633ae0d42b5a0076a11dd08952817a613342 --- boot.php | 94 ++++++++++------------------------------------------------------ 1 file changed, 14 insertions(+), 80 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 78ad668ca..2b9e8ccba 100644 --- a/boot.php +++ b/boot.php @@ -1897,57 +1897,22 @@ function can_view_public_stream() { */ function notice($s) { - /* - if(! session_id()) - return; - - if(! x($_SESSION, 'sysmsg')) $_SESSION['sysmsg'] = array(); - - // ignore duplicated error messages which haven't yet been displayed - // - typically seen as multiple 'permission denied' messages - // as a result of auto-reloading a protected page with &JS=1 - - if(in_array($s, $_SESSION['sysmsg'])) - return; - - 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; - } + if (!session_id()) { + 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 (!isset($_SESSION['sysmsg'])) { + $_SESSION['sysmsg'] = []; } - if ($x === null) { - $x = get_xconfig($hash, 'sse', 'notifications', []); - } + // ignore duplicated error messages which haven't yet been displayed - if (isset($x['notice']) && in_array($s, $x['notice']['notifications'])) { + if (in_array($s, $_SESSION['sysmsg'])) { return; } if (App::$interactive) { - $x['notice']['notifications'][] = $s; - set_xconfig($hash, 'sse', 'notifications', $x); + $_SESSION['sysmsg'][] = $s; } } @@ -1964,53 +1929,22 @@ function notice($s) { */ function info($s) { - /* - if(! session_id()) - return; - - if(! x($_SESSION, 'sysmsg_info')) - $_SESSION['sysmsg_info'] = array(); - - if(in_array($s, $_SESSION['sysmsg_info'])) - return; - - 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; - } + if (!session_id()) { + 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 (!isset($_SESSION['sysmsg_info'])) { + $_SESSION['sysmsg_info'] = []; } - if ($x === null) { - $x = get_xconfig($hash, 'sse', 'notifications', []); - } + // ignore duplicated error messages which haven't yet been displayed - if (isset($x['info']) && in_array($s, $x['info']['notifications'])) { + if (in_array($s, $_SESSION['sysmsg_info'])) { return; } if (App::$interactive) { - $x['info']['notifications'][] = $s; - set_xconfig($hash, 'sse', 'notifications', $x); + $_SESSION['sysmsg_info'][] = $s; } } -- cgit v1.2.3 From 2d0b216a2c36519d0d95ccffb7342a249038f7e4 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 18:01:17 +0000 Subject: version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 2b9e8ccba..9b0c6fb84 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.3'); +define('STD_VERSION', '9.3.5'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 77a6a21ea2568bb50e55f49ed0a481ff5ebaeb9d Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 22 Jul 2024 19:25:26 +0000 Subject: bump version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 9b0c6fb84..f40f5e39d 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); -- cgit v1.2.3 From 241cc1ad634cd7999bcac882b9fc9a5e06873818 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 28 Jul 2024 18:44:07 +0000 Subject: storing info and notice messages in the session has some disadvantages if the functions are called via ajax. revert to storing them in xconfig. --- boot.php | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index f40f5e39d..dcda705f0 100644 --- a/boot.php +++ b/boot.php @@ -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); + } } -- cgit v1.2.3 From cadc7ee29eb7db64c47bf3269b630eeeb8f7185e Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Aug 2024 20:43:51 +0000 Subject: bump version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index dcda705f0..cf5c1c0d6 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.6'); +define('STD_VERSION', '9.3.7'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From f6b9a1dd3cac7487d4d63e6e5131cd9ffb63ce8f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Sep 2024 12:59:36 +0200 Subject: version 9.4RC, strings, autoload dump --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index cf5c1c0d6..d50919e16 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.7'); +define('STD_VERSION', '9.4RC'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 220571d2a99b32ab4b73135400564812e13f6acf Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Sep 2024 13:04:50 +0200 Subject: bump dev version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index d50919e16..66dba84c3 100644 --- a/boot.php +++ b/boot.php @@ -66,7 +66,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '9.4RC'); +define('STD_VERSION', '9.5'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 67d8b977b6f17ad3bad32b46c9f17fee321fa253 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 24 Sep 2024 08:59:26 +0000 Subject: version 9.4RC1 --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 66dba84c3..e141c4e59 100644 --- a/boot.php +++ b/boot.php @@ -66,7 +66,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '9.5'); +define('STD_VERSION', '9.4RC1'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3 From 339e702beb97c46bfcef3306c7c226cf486d7246 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Sep 2024 19:38:12 +0000 Subject: version 9.4 --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index e141c4e59..ed3219186 100644 --- a/boot.php +++ b/boot.php @@ -66,7 +66,7 @@ require_once('include/security.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '9.4RC1'); +define('STD_VERSION', '9.4'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1263); -- cgit v1.2.3