|
|
@@ -116,6 +116,13 @@ export default function createRoomLocker (room) {
|
|
116
|
116
|
let password;
|
|
117
|
117
|
let dialog = null;
|
|
118
|
118
|
|
|
|
119
|
+ /**
|
|
|
120
|
+ * If the room was locked from someone other than us, we indicate it with
|
|
|
121
|
+ * this property in order to have correct roomLocker state of isLocked.
|
|
|
122
|
+ * @type {boolean} whether room is locked, but not from us.
|
|
|
123
|
+ */
|
|
|
124
|
+ let lockedElsewhere = false;
|
|
|
125
|
+
|
|
119
|
126
|
function lock (newPass) {
|
|
120
|
127
|
return room.lock(newPass).then(function () {
|
|
121
|
128
|
password = newPass;
|
|
|
@@ -135,13 +142,30 @@ export default function createRoomLocker (room) {
|
|
135
|
142
|
*/
|
|
136
|
143
|
return {
|
|
137
|
144
|
get isLocked () {
|
|
138
|
|
- return !!password;
|
|
|
145
|
+ return !!password || lockedElsewhere;
|
|
139
|
146
|
},
|
|
140
|
147
|
|
|
141
|
148
|
get password () {
|
|
142
|
149
|
return password;
|
|
143
|
150
|
},
|
|
144
|
151
|
|
|
|
152
|
+ /**
|
|
|
153
|
+ * Sets that the room is locked from another user, not us.
|
|
|
154
|
+ * @param {boolean} value locked/unlocked state
|
|
|
155
|
+ */
|
|
|
156
|
+ set lockedElsewhere (value) {
|
|
|
157
|
+ lockedElsewhere = value;
|
|
|
158
|
+ },
|
|
|
159
|
+
|
|
|
160
|
+ /**
|
|
|
161
|
+ * Whether room is locked from someone else.
|
|
|
162
|
+ * @returns {boolean} whether room is not locked locally,
|
|
|
163
|
+ * but it is still locked.
|
|
|
164
|
+ */
|
|
|
165
|
+ get lockedElsewhere () {
|
|
|
166
|
+ return lockedElsewhere;
|
|
|
167
|
+ },
|
|
|
168
|
+
|
|
145
|
169
|
/**
|
|
146
|
170
|
* Allows to remove password from the conference (asks user first).
|
|
147
|
171
|
* @returns {Promise}
|
|
|
@@ -206,7 +230,7 @@ export default function createRoomLocker (room) {
|
|
206
|
230
|
dialog = null;
|
|
207
|
231
|
};
|
|
208
|
232
|
|
|
209
|
|
- if (password) {
|
|
|
233
|
+ if (this.isLocked) {
|
|
210
|
234
|
dialog = APP.UI.messageHandler
|
|
211
|
235
|
.openMessageDialog(null, "dialog.passwordError",
|
|
212
|
236
|
null, null, closeCallback);
|