diff --git a/app.js b/app.js index 168d50778..c448b3797 100644 --- a/app.js +++ b/app.js @@ -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, '

Password required

' + '', diff --git a/toolbar.js b/toolbar.js index f7130d074..077dd26db 100644 --- a/toolbar.js +++ b/toolbar.js @@ -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) {