mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
Don't force signaling mode when HPB trial is used
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
764805f017
commit
d3d0af7541
3 changed files with 9 additions and 6 deletions
|
|
@ -93,7 +93,7 @@ class CheckHostedSignalingServer extends TimedJob {
|
|||
if ($oldStatus !== $newStatus) {
|
||||
if ($oldStatus === 'active') {
|
||||
// remove signaling servers if account is not active anymore
|
||||
$this->config->setAppValue('spreed', 'signaling_mode', 'internal');
|
||||
$this->config->deleteAppValue('spreed', 'signaling_mode');
|
||||
$this->config->deleteAppValue('spreed', 'signaling_servers');
|
||||
|
||||
$notificationSubject = 'removed';
|
||||
|
|
@ -101,7 +101,7 @@ class CheckHostedSignalingServer extends TimedJob {
|
|||
|
||||
if ($newStatus === 'active') {
|
||||
// add signaling servers if account got active
|
||||
$this->config->setAppValue('spreed', 'signaling_mode', 'external');
|
||||
$this->config->deleteAppValue('spreed', 'signaling_mode');
|
||||
$this->config->setAppValue('spreed', 'signaling_servers', json_encode([
|
||||
'servers' => [
|
||||
[
|
||||
|
|
@ -128,7 +128,6 @@ class CheckHostedSignalingServer extends TimedJob {
|
|||
$oldAccountInfo['signaling']['url'] !== $accountInfo['signaling']['url'] ||
|
||||
$oldAccountInfo['signaling']['secret'] !== $accountInfo['signaling']['secret'])
|
||||
) {
|
||||
$this->config->setAppValue('spreed', 'signaling_mode', 'external');
|
||||
$this->config->setAppValue('spreed', 'signaling_servers', json_encode([
|
||||
'servers' => [
|
||||
[
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class HostedSignalingServerController extends OCSController {
|
|||
$this->config->deleteAppValue('spreed', 'hosted-signaling-server-account-id');
|
||||
|
||||
// remove signaling servers if account is not active anymore
|
||||
$this->config->setAppValue('spreed', 'signaling_mode', 'internal');
|
||||
$this->config->deleteAppValue('spreed', 'signaling_mode');
|
||||
$this->config->deleteAppValue('spreed', 'signaling_servers');
|
||||
|
||||
$this->logger->info('Deleted hosted signaling server account with ID ' . $accountId);
|
||||
|
|
|
|||
|
|
@ -114,10 +114,14 @@ class CheckHostedSignalingServerTest extends TestCase {
|
|||
['spreed', 'hosted-signaling-server-account-id', '', 'my-account-id'],
|
||||
['spreed', 'hosted-signaling-server-account', '{}', '{"status": "pending"}']
|
||||
]));
|
||||
$this->config->expects($this->exactly(4))
|
||||
$this->config->expects($this->once())
|
||||
->method('deleteAppValue')
|
||||
->withConsecutive(
|
||||
['spreed', 'signaling_mode'],
|
||||
);
|
||||
$this->config->expects($this->exactly(3))
|
||||
->method('setAppValue')
|
||||
->withConsecutive(
|
||||
['spreed', 'signaling_mode', 'external'],
|
||||
['spreed', 'signaling_servers', '{"servers":[{"server":"signaling-url","verify":true}],"secret":"signaling-secret"}'],
|
||||
['spreed', 'hosted-signaling-server-account', json_encode($newStatus)],
|
||||
['spreed', 'hosted-signaling-server-account-last-checked', null]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue