diff options
author | Mario <mario@mariovavti.com> | 2021-03-22 12:37:01 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-22 13:43:00 +0100 |
commit | 8c1617185579ed2aacbc5083dcd9c6119cc119ed (patch) | |
tree | 6856f0887ba3d03c50356e8068187f1b77ddb980 /Zotlabs | |
parent | 2e47ef38a9b18a49d6e13256309519deed3683b4 (diff) | |
download | volse-hubzilla-8c1617185579ed2aacbc5083dcd9c6119cc119ed.tar.gz volse-hubzilla-8c1617185579ed2aacbc5083dcd9c6119cc119ed.tar.bz2 volse-hubzilla-8c1617185579ed2aacbc5083dcd9c6119cc119ed.zip |
sse: make sure to also bootstrap info and notice
(cherry picked from commit 598c3aa336ac12a867be2f1ec38a3ce00f937a94)
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Sse.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Sse_bs.php | 32 |
2 files changed, 28 insertions, 5 deletions
diff --git a/Zotlabs/Module/Sse.php b/Zotlabs/Module/Sse.php index 46b4a8d87..8bea65207 100644 --- a/Zotlabs/Module/Sse.php +++ b/Zotlabs/Module/Sse.php @@ -47,7 +47,6 @@ class Sse extends Controller { self::$vnotify = get_pconfig(self::$uid, 'system', 'vnotify'); - $sys = get_sys_channel(); $sleep_seconds = 3; self::$sse_enabled = get_config('system', 'sse_enabled', 0); diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index 3b39d5b49..3384810e1 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -6,6 +6,7 @@ use App; use Zotlabs\Lib\Apps; use Zotlabs\Web\Controller; use Zotlabs\Lib\Enotify; +use Zotlabs\Lib\XConfig; class Sse_bs extends Controller { @@ -101,12 +102,13 @@ class Sse_bs extends Controller { self::bs_files(), self::bs_mail(), self::bs_all_events(), - self::bs_register() + self::bs_register(), + self::bs_info_notice() ); - set_xconfig(self::$ob_hash, 'sse', 'timestamp', datetime_convert()); - set_xconfig(self::$ob_hash, 'sse', 'notifications', []); // reset the cache - set_xconfig(self::$ob_hash, 'sse', 'language', App::$language); + XConfig::Set(self::$ob_hash, 'sse', 'notifications', []); + XConfig::Set(self::$ob_hash, 'sse', 'timestamp', datetime_convert()); + XConfig::Set(self::$ob_hash, 'sse', 'language', App::$language); json_return_and_die($result); } @@ -703,4 +705,26 @@ class Sse_bs extends Controller { } + function bs_info_notice() { + + $result['notice']['notifications'] = []; + $result['notice']['count'] = 0; + $result['notice']['offset'] = -1; + $result['info']['notifications'] = []; + $result['info']['count'] = 0; + $result['info']['offset'] = -1; + + $r = XConfig::Get(self::$ob_hash, 'sse', 'notifications', []); + + if(isset($r['notice'])) + $result['notice']['notifications'] = $r['notice']['notifications']; + + if(isset($r['info'])) + $result['info']['notifications'] = $r['info']['notifications']; + + return $result; + + } + + } |