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
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-10-12 17:51:04 +0300
committerJoas Schilling <coding@schilljs.com>2020-10-30 12:38:07 +0300
commit6ad483c0e5e02298a14a1567afaffc74f6dfa2fb (patch)
tree6994ce5d1f4f2322aac10142cbaf0b41c792cd41 /lib
parentd955555b70b63581dbf946b5d1a973511c80842c (diff)
Add SIP status column to rooms table
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Manager.php1
-rw-r--r--lib/Migration/Version10000Date20201012144235.php56
-rw-r--r--lib/Room.php8
-rw-r--r--lib/Webinary.php3
4 files changed, 68 insertions, 0 deletions
diff --git a/lib/Manager.php b/lib/Manager.php
index 3f1aa022e..25f34826a 100644
--- a/lib/Manager.php
+++ b/lib/Manager.php
@@ -148,6 +148,7 @@ class Manager {
(int) $row['type'],
(int) $row['read_only'],
(int) $row['lobby_state'],
+ (int) $row['sip_status'],
$assignedSignalingServer,
(string) $row['token'],
(string) $row['name'],
diff --git a/lib/Migration/Version10000Date20201012144235.php b/lib/Migration/Version10000Date20201012144235.php
new file mode 100644
index 000000000..f361bf438
--- /dev/null
+++ b/lib/Migration/Version10000Date20201012144235.php
@@ -0,0 +1,56 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2020, Joas Schilling <coding@schilljs.com>
+ *
+ * @author Joas Schilling <coding@schilljs.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Talk\Migration;
+
+use Closure;
+use Doctrine\DBAL\Types\Type;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version10000Date20201012144235 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $table = $schema->getTable('talk_rooms');
+ $table->addColumn('sip_status', Type::SMALLINT, [
+ 'notnull' => true,
+ 'default' => 0,
+ 'unsigned' => true,
+ ]);
+
+ return $schema;
+ }
+
+}
diff --git a/lib/Room.php b/lib/Room.php
index 09d52f69b..8582b19e8 100644
--- a/lib/Room.php
+++ b/lib/Room.php
@@ -125,6 +125,8 @@ class Room {
private $readOnly;
/** @var int */
private $lobbyState;
+ /** @var int */
+ private $sipStatus;
/** @var int|null */
private $assignedSignalingServer;
/** @var \DateTime|null */
@@ -165,6 +167,7 @@ class Room {
int $type,
int $readOnly,
int $lobbyState,
+ int $sipStatus,
?int $assignedSignalingServer,
string $token,
string $name,
@@ -187,6 +190,7 @@ class Room {
$this->type = $type;
$this->readOnly = $readOnly;
$this->lobbyState = $lobbyState;
+ $this->sipStatus = $sipStatus;
$this->assignedSignalingServer = $assignedSignalingServer;
$this->token = $token;
$this->name = $name;
@@ -218,6 +222,10 @@ class Room {
return $this->lobbyState;
}
+ public function getSIPStatus(): int {
+ return $this->sipStatus;
+ }
+
public function getLobbyTimer(): ?\DateTime {
$this->validateTimer();
return $this->lobbyTimer;
diff --git a/lib/Webinary.php b/lib/Webinary.php
index d29866b6a..fecbe44fa 100644
--- a/lib/Webinary.php
+++ b/lib/Webinary.php
@@ -26,4 +26,7 @@ namespace OCA\Talk;
class Webinary {
public const LOBBY_NONE = 0;
public const LOBBY_NON_MODERATORS = 1;
+
+ public const SIP_DISABLED = 0;
+ public const SIP_ENABLED = 1;
}