Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-24 12:13:40 +0300
committerJoas Schilling <coding@schilljs.com>2020-08-25 09:47:08 +0300
commit6d0b2c86b730cb23863d74d3fd61306d84eb8150 (patch)
tree7197c049aa72f151d12f30e4625dc0011c9d68a2 /lib/Settings
parent9a94fb30298f287043374c607a7865db65ee119a (diff)
Allow to install the Matterbridge app directly in the Talk settings
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Settings')
-rw-r--r--lib/Settings/Admin/AdminSettings.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Settings/Admin/AdminSettings.php b/lib/Settings/Admin/AdminSettings.php
index 6d19bddeb..194d02306 100644
--- a/lib/Settings/Admin/AdminSettings.php
+++ b/lib/Settings/Admin/AdminSettings.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace OCA\Talk\Settings\Admin;
+use OCA\Talk\BridgeManager;
use OCA\Talk\Config;
use OCA\Talk\Model\Command;
use OCA\Talk\Participant;
@@ -50,6 +51,8 @@ class AdminSettings implements ISettings {
private $initialStateService;
/** @var ICacheFactory */
private $memcacheFactory;
+ /** @var BridgeManager */
+ private $bridgeManager;
/** @var IUser */
private $currentUser;
/** @var IL10N */
@@ -62,6 +65,7 @@ class AdminSettings implements ISettings {
CommandService $commandService,
IInitialStateService $initialStateService,
ICacheFactory $memcacheFactory,
+ BridgeManager $bridgeManager,
IUserSession $userSession,
IL10N $l10n,
IFactory $l10nFactory) {
@@ -70,6 +74,7 @@ class AdminSettings implements ISettings {
$this->commandService = $commandService;
$this->initialStateService = $initialStateService;
$this->memcacheFactory = $memcacheFactory;
+ $this->bridgeManager = $bridgeManager;
$this->currentUser = $userSession->getUser();
$this->l10n = $l10n;
$this->l10nFactory = $l10nFactory;
@@ -82,6 +87,7 @@ class AdminSettings implements ISettings {
$this->initGeneralSettings();
$this->initAllowedGroups();
$this->initCommands();
+ $this->initMatterbridge();
$this->initStunServers();
$this->initTurnServers();
$this->initSignalingServers();
@@ -94,7 +100,6 @@ class AdminSettings implements ISettings {
$this->initialStateService->provideInitialState('talk', 'default_group_notification', (int) $this->serverConfig->getAppValue('spreed', 'default_group_notification', Participant::NOTIFY_MENTION));
$this->initialStateService->provideInitialState('talk', 'conversations_files', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files', '1'));
$this->initialStateService->provideInitialState('talk', 'conversations_files_public_shares', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files_public_shares', '1'));
- $this->initialStateService->provideInitialState('talk', 'enable_matterbridge', (int) $this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0'));
}
protected function initAllowedGroups(): void {
@@ -113,6 +118,18 @@ class AdminSettings implements ISettings {
$this->initialStateService->provideInitialState('talk', 'commands', $result);
}
+ protected function initMatterbridge(): void {
+ $this->initialStateService->provideInitialState(
+ 'talk', 'matterbridge_version',
+ (string) $this->bridgeManager->getCurrentVersionFromBinary()
+ );
+
+ $this->initialStateService->provideInitialState(
+ 'talk', 'matterbridge_enable',
+ $this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1'
+ );
+ }
+
protected function initStunServers(): void {
$this->initialStateService->provideInitialState('talk', 'stun_servers', $this->talkConfig->getStunServers());
$this->initialStateService->provideInitialState('talk', 'has_internet_connection', $this->serverConfig->getSystemValueBool('has_internet_connection', true));