Changes the state of room locker if room was locked not by current user.
This commit is contained in:
parent
7eb85fe7aa
commit
f9a5b62326
|
@ -1202,6 +1202,7 @@ export default {
|
|||
console.log("Received channel password lock change: ", state,
|
||||
error);
|
||||
APP.UI.markRoomLocked(state);
|
||||
roomLocker.lockedElsewhere = true;
|
||||
});
|
||||
|
||||
room.on(ConferenceEvents.USER_STATUS_CHANGED, function (id, status) {
|
||||
|
|
|
@ -116,6 +116,13 @@ export default function createRoomLocker (room) {
|
|||
let password;
|
||||
let dialog = null;
|
||||
|
||||
/**
|
||||
* If the room was locked from someone other than us, we indicate it with
|
||||
* this property in order to have correct roomLocker state of isLocked.
|
||||
* @type {boolean} whether room is locked, but not from us.
|
||||
*/
|
||||
let lockedElsewhere = false;
|
||||
|
||||
function lock (newPass) {
|
||||
return room.lock(newPass).then(function () {
|
||||
password = newPass;
|
||||
|
@ -135,13 +142,30 @@ export default function createRoomLocker (room) {
|
|||
*/
|
||||
return {
|
||||
get isLocked () {
|
||||
return !!password;
|
||||
return !!password || lockedElsewhere;
|
||||
},
|
||||
|
||||
get password () {
|
||||
return password;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets that the room is locked from another user, not us.
|
||||
* @param {boolean} value locked/unlocked state
|
||||
*/
|
||||
set lockedElsewhere (value) {
|
||||
lockedElsewhere = value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Whether room is locked from someone else.
|
||||
* @returns {boolean} whether room is not locked locally,
|
||||
* but it is still locked.
|
||||
*/
|
||||
get lockedElsewhere () {
|
||||
return lockedElsewhere;
|
||||
},
|
||||
|
||||
/**
|
||||
* Allows to remove password from the conference (asks user first).
|
||||
* @returns {Promise}
|
||||
|
@ -206,7 +230,7 @@ export default function createRoomLocker (room) {
|
|||
dialog = null;
|
||||
};
|
||||
|
||||
if (password) {
|
||||
if (this.isLocked) {
|
||||
dialog = APP.UI.messageHandler
|
||||
.openMessageDialog(null, "dialog.passwordError",
|
||||
null, null, closeCallback);
|
||||
|
|
Loading…
Reference in New Issue