Changes the padlock to locked when a participant is entering a locked room and still haven't entered the key. We show padlock locked whenever the room requires a key to enter.

This commit is contained in:
Damian Minkov 2014-10-28 14:46:06 +02:00
parent 0f431eec5d
commit de04bb8ef1
2 changed files with 10 additions and 3 deletions

6
app.js
View File

@ -719,9 +719,6 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {
focus.addNewParticipant(jid);
}
}
else if (sharedKey) {
Toolbar.updateLockButton();
}
});
$(document).bind('left.muc', function (event, jid) {
@ -860,6 +857,9 @@ $(document).bind('presence.status.muc', function (event, jid, info, pres) {
$(document).bind('passwordrequired.muc', function (event, jid) {
console.log('on password required', jid);
// password is required
Toolbar.lockLockButton();
messageHandler.openTwoButtonDialog(null,
'<h2>Password required</h2>' +
'<input id="lockKey" type="text" placeholder="password" autofocus>',

View File

@ -209,6 +209,13 @@ var Toolbar = (function (my) {
my.updateLockButton = function() {
buttonClick("#lockIcon", "icon-security icon-security-locked");
};
/**
* Updates the lock button state to locked.
*/
my.lockLockButton = function() {
if($("#lockIcon").hasClass("icon-security"))
buttonClick("#lockIcon", "icon-security icon-security-locked");
};
// Shows or hides the 'recording' button.
my.showRecordingButton = function (show) {