Removes toggle lock icon, just lock or unlock it, depending the status returned by the server.
This commit is contained in:
parent
f9daa25a6c
commit
5ce2ce8db6
2
app.js
2
app.js
|
@ -1413,8 +1413,6 @@ function lockRoom(lock) {
|
|||
connection.emuc.lockRoom(sharedKey);
|
||||
else
|
||||
connection.emuc.lockRoom('');
|
||||
|
||||
Toolbar.updateLockButton();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
15
muc.js
15
muc.js
|
@ -263,19 +263,31 @@ Strophe.addConnectionPlugin('emuc', {
|
|||
// FIXME: is muc#roomconfig_passwordprotectedroom required?
|
||||
this.connection.sendIQ(formsubmit,
|
||||
function (res) {
|
||||
console.log('set room password');
|
||||
// password is required
|
||||
if (sharedKey)
|
||||
{
|
||||
console.log('set room password');
|
||||
Toolbar.lockLockButton();
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('removed room password');
|
||||
Toolbar.unlockLockButton();
|
||||
}
|
||||
},
|
||||
function (err) {
|
||||
console.warn('setting password failed', err);
|
||||
messageHandler.showError('Lock failed',
|
||||
'Failed to lock conference.',
|
||||
err);
|
||||
setSharedKey('');
|
||||
}
|
||||
);
|
||||
} else {
|
||||
console.warn('room passwords not supported');
|
||||
messageHandler.showError('Warning',
|
||||
'Room passwords are currently not supported.');
|
||||
setSharedKey('');
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -284,6 +296,7 @@ Strophe.addConnectionPlugin('emuc', {
|
|||
messageHandler.showError('Lock failed',
|
||||
'Failed to lock conference.',
|
||||
err);
|
||||
setSharedKey('');
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
|
@ -204,10 +204,11 @@ var Toolbar = (function (my) {
|
|||
}
|
||||
};
|
||||
/**
|
||||
* Updates the lock button state.
|
||||
* Unlocks the lock button state.
|
||||
*/
|
||||
my.updateLockButton = function() {
|
||||
buttonClick("#lockIcon", "icon-security icon-security-locked");
|
||||
my.unlockLockButton = function() {
|
||||
if($("#lockIcon").hasClass("icon-security-locked"))
|
||||
buttonClick("#lockIcon", "icon-security icon-security-locked");
|
||||
};
|
||||
/**
|
||||
* Updates the lock button state to locked.
|
||||
|
|
Loading…
Reference in New Issue