浏览代码

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.

master
Damian Minkov 10 年前
父节点
当前提交
de04bb8ef1
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 3
    3
      app.js
  2. 7
    0
      toolbar.js

+ 3
- 3
app.js 查看文件

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

+ 7
- 0
toolbar.js 查看文件

@@ -209,6 +209,13 @@ var Toolbar = (function (my) {
209 209
     my.updateLockButton = function() {
210 210
         buttonClick("#lockIcon", "icon-security icon-security-locked");
211 211
     };
212
+    /**
213
+     * Updates the lock button state to locked.
214
+     */
215
+    my.lockLockButton = function() {
216
+        if($("#lockIcon").hasClass("icon-security"))
217
+            buttonClick("#lockIcon", "icon-security icon-security-locked");
218
+    };
212 219
 
213 220
     // Shows or hides the 'recording' button.
214 221
     my.showRecordingButton = function (show) {

正在加载...
取消
保存