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

Room.php « Model « lib - github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c654c1f8ebddc4f8d1e6ec0dca6c37a73e3beb19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php

declare(strict_types=1);

/**
 * @copyright Copyright (c) 2022 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\Model;

use OCA\Talk\Participant;
use OCA\Talk\Webinary;
use OCP\AppFramework\Db\Entity;
use OCP\Comments\IComment;

/**
 * @method void setType(int $type)
 * @method int getType()
 * @method void setReadOnly(int $readOnly)
 * @method int getReadOnly()
 * @method void setListable(int $listable)
 * @method int getListable()
 * @method void setMessageExpiration(int $messageExpiration)
 * @method int getMessageExpiration()
 * @method void setLobbyState(int $lobbyState)
 * @method int getLobbyState()
 * @method void setSipEnabled(int $sipEnabled)
 * @method int getSipEnabled()
 * @method void setAssignedSignalingServer(?int $assignedSignalingServer)
 * @method int|null getAssignedSignalingServer()
 * @method void setToken(string $token)
 * @method string getToken()
 * @method void setName(string $name)
 * @method string getName()
 * @method void setDescription(string $description)
 * @method string getDescription()
 * @method void setPassword(string $password)
 * @method string getPassword()
 * @method void setRemoteServer(string $remoteServer)
 * @method string getRemoteServer()
 * @method void setRemoteToken(string $remoteToken)
 * @method string getRemoteToken()
 * @method void setActiveGuests(int $activeGuests)
 * @method int getActiveGuests()
 * @method void setDefaultPermissions(int $defaultPermissions)
 * @method int getDefaultPermissions()
 * @method void setCallPermissions(int $callPermissions)
 * @method int getCallPermissions()
 * @method void setCallFlag(int $callFlag)
 * @method int getCallFlag()
 * @method void setActiveSince(?\DateTime $activeSince)
 * @method \DateTime|null getActiveSince()
 * @method void setLastActivity(?\DateTime $lastActivity)
 * @method \DateTime|null getLastActivity()
 * @method void setLastMessageId(int $lastMessageId)
 * @method int getLastMessageId()
 * @method void setLobbyTimer(?\DateTime $lobbyTimer)
 * @method \DateTime|null getLobbyTimer()
 * @method void setObjectType(string $objectType)
 * @method string getObjectType()
 * @method void setObjectId(string $objectId)
 * @method string getObjectId()
 */
class Room extends Entity {
	/**
	 * Regex that matches SIP incompatible rooms:
	 * 1. duplicate digit: …11…
	 * 2. leading zero: 0…
	 * 3. non-digit: …a…
	 */
	public const SIP_INCOMPATIBLE_REGEX = '/((\d)(?=\2+)|^0|\D)/';

	public const TYPE_UNKNOWN = -1;
	public const TYPE_ONE_TO_ONE = 1;
	public const TYPE_GROUP = 2;
	public const TYPE_PUBLIC = 3;
	public const TYPE_CHANGELOG = 4;

	public const READ_WRITE = 0;
	public const READ_ONLY = 1;

	/**
	 * Only visible when joined
	 */
	public const LISTABLE_NONE = 0;

	/**
	 * Searchable by all regular users and moderators, even when not joined, excluding users from the guest app
	 */
	public const LISTABLE_USERS = 1;

	/**
	 * Searchable by everyone, which includes guest users (from guest app), even when not joined
	 */
	public const LISTABLE_ALL = 2;

	public const START_CALL_EVERYONE = 0;
	public const START_CALL_USERS = 1;
	public const START_CALL_MODERATORS = 2;
	public const START_CALL_NOONE = 3;

	protected int $type = self::TYPE_UNKNOWN;
	protected int $readOnly = self::READ_WRITE;
	protected int $listable = self::LISTABLE_NONE;
	protected int $messageExpiration = 0;
	protected int $lobbyState = Webinary::LOBBY_NONE;
	protected int $sipEnabled = Webinary::SIP_DISABLED;
	protected ?int $assignedSignalingServer = null;
	protected string $token = '';
	protected string $name = '';
	protected string $description = '';
	protected string $password = '';
	protected string $remoteServer = '';
	protected string $remoteToken = '';
	protected int $activeGuests = 0;
	protected int $defaultPermissions = Attendee::PERMISSIONS_DEFAULT;
	protected int $callPermissions = Attendee::PERMISSIONS_DEFAULT;
	protected int $callFlag = Participant::FLAG_DISCONNECTED;
	protected ?\DateTime $activeSince = null;
	protected ?\DateTime $lastActivity = null;
	protected int $lastMessageId = 0;
	protected ?\DateTime $lobbyTimer = null;
	protected string $objectType = '';
	protected string $objectId = '';

	public function __construct() {
		$this->addType('type', 'int');
		$this->addType('readOnly', 'int');
		$this->addType('listable', 'int');
		$this->addType('messageExpiration', 'int');
		$this->addType('lobbyState', 'int');
		$this->addType('sipEnabled', 'int');
		$this->addType('assignedSignalingServer', 'int'); // FIXME nullable?
		$this->addType('token', 'string');
		$this->addType('name', 'string');
		$this->addType('description', 'string');
		$this->addType('password', 'string');
		$this->addType('remoteServer', 'string');
		$this->addType('remoteToken', 'string');
		$this->addType('activeGuests', 'int');
		$this->addType('defaultPermissions', 'int');
		$this->addType('callPermissions', 'int');
		$this->addType('callFlag', 'int');
		$this->addType('activeSince', 'datetime'); // FIXME nullable?
		$this->addType('lastActivity', 'datetime'); // FIXME nullable?
		$this->addType('lastMessageId', 'int');
		// FIXME $this->addType('lastMessage', 'IComment');
		$this->addType('lobbyTimer', 'datetime'); // FIXME nullable?
		$this->addType('objectType', 'string');
		$this->addType('objectId', 'string');
	}
}