diff options
author | Mario <mario@mariovavti.com> | 2021-03-22 13:37:01 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-22 13:37:01 +0100 |
commit | 598c3aa336ac12a867be2f1ec38a3ce00f937a94 (patch) | |
tree | f8739f6200acae1a84a85dd5d383875083c61010 | |
parent | 74610aca6fd24169d401dec1f3b43450d17c2015 (diff) | |
download | volse-hubzilla-598c3aa336ac12a867be2f1ec38a3ce00f937a94.tar.gz volse-hubzilla-598c3aa336ac12a867be2f1ec38a3ce00f937a94.tar.bz2 volse-hubzilla-598c3aa336ac12a867be2f1ec38a3ce00f937a94.zip |
sse: make sure to also bootstrap info and notice
-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 237becc09..6ba5b0b15 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); } @@ -702,4 +704,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; + + } + + } |