Browse Source

Fix "enable_matterbridge" initial state not set for guests

The RightSidebar component always checks the value, so even if the
setting does not apply for guests it should be explicitly disabled in
that case.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/4173/head
Daniel Calviño Sánchez 5 years ago
parent
commit
1fbbc7b56f
  1. 1
      lib/Controller/PageController.php
  2. 10
      lib/TInitialState.php

1
lib/Controller/PageController.php

@ -249,7 +249,6 @@ class PageController extends Controller {
}
$this->publishInitialStateForUser($user, $this->rootFolder, $this->appManager);
$this->initialStateService->provideInitialState('talk', 'enable_matterbridge', $this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1');
if (class_exists(LoadViewer::class)) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());

10
lib/TInitialState.php

@ -102,6 +102,11 @@ trait TInitialState {
'talk', 'attachment_folder',
$attachmentFolder
);
$this->initialStateService->provideInitialState(
'talk', 'enable_matterbridge',
$this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1'
);
}
protected function publishInitialStateForGuest(): void {
@ -121,5 +126,10 @@ trait TInitialState {
'talk', 'attachment_folder',
''
);
$this->initialStateService->provideInitialState(
'talk', 'enable_matterbridge',
false
);
}
}
Loading…
Cancel
Save