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/Module/Sse_bs.php | |
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/Module/Sse_bs.php')
-rw-r--r-- | Zotlabs/Module/Sse_bs.php | 32 |
1 files changed, 28 insertions, 4 deletions
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; + + } + + } |