Преглед изворни кода

Merge pull request #286 from jitsi/page_reload_overlay

Page reload overlay
dev1
George Politis пре 9 година
родитељ
комит
4cbf19e784
2 измењених фајлова са 14 додато и 9 уклоњено
  1. 7
    4
      JitsiConference.js
  2. 7
    5
      modules/xmpp/ChatRoom.js

+ 7
- 4
JitsiConference.js Прегледај датотеку

562
 
562
 
563
 /**
563
 /**
564
  * Check if local user is moderator.
564
  * Check if local user is moderator.
565
- * @returns {boolean} true if local user is moderator, false otherwise.
565
+ * @returns {boolean|null} true if local user is moderator, false otherwise. If
566
+ * we're no longer in the conference room then <tt>null</tt> is returned.
566
  */
567
  */
567
 JitsiConference.prototype.isModerator = function () {
568
 JitsiConference.prototype.isModerator = function () {
568
-    return this.room.isModerator();
569
+    return this.room ? this.room.isModerator() : null;
569
 };
570
 };
570
 
571
 
571
 /**
572
 /**
1298
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
1299
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
1299
  * focus.
1300
  * focus.
1300
  * @param mucJid the full MUC address of the user to be checked.
1301
  * @param mucJid the full MUC address of the user to be checked.
1301
- * @returns {boolean} <tt>true</tt> if MUC user is the conference focus.
1302
+ * @returns {boolean|null} <tt>true</tt> if MUC user is the conference focus,
1303
+ * <tt>false</tt> when is not. <tt>null</tt> if we're not in the MUC anymore and
1304
+ * are unable to figure out the status or if given <tt>mucJid</tt> is invalid.
1302
  */
1305
  */
1303
 JitsiConference.prototype._isFocus = function (mucJid) {
1306
 JitsiConference.prototype._isFocus = function (mucJid) {
1304
-    return this.room.isFocus(mucJid);
1307
+    return this.room ? this.room.isFocus(mucJid) : null;
1305
 };
1308
 };
1306
 
1309
 
1307
 /**
1310
 /**

+ 7
- 5
modules/xmpp/ChatRoom.js Прегледај датотеку

75
     this.joined = false;
75
     this.joined = false;
76
     this.role = null;
76
     this.role = null;
77
     this.focusMucJid = null;
77
     this.focusMucJid = null;
78
-    this.bridgeIsDown = false;
78
+    this.noBridgeAvailable = false;
79
     this.options = options || {};
79
     this.options = options || {};
80
     this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
80
     this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
81
         settings, {connection: this.xmpp.options, conference: this.options});
81
         settings, {connection: this.xmpp.options, conference: this.options});
366
                     }
366
                     }
367
                 }
367
                 }
368
                 break;
368
                 break;
369
-            case "bridgeIsDown":
370
-                if (member.isFocus && !this.bridgeIsDown) {
371
-                    this.bridgeIsDown = true;
369
+            case "bridgeNotAvailable":
370
+                if (member.isFocus && !this.noBridgeAvailable) {
371
+                    this.noBridgeAvailable = true;
372
                     this.eventEmitter.emit(XMPPEvents.BRIDGE_DOWN);
372
                     this.eventEmitter.emit(XMPPEvents.BRIDGE_DOWN);
373
                 }
373
                 }
374
                 break;
374
                 break;
669
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
669
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
670
  * focus.
670
  * focus.
671
  * @param mucJid the full MUC address of the user to be checked.
671
  * @param mucJid the full MUC address of the user to be checked.
672
- * @returns {boolean} <tt>true</tt> if MUC user is the conference focus.
672
+ * @returns {boolean|null} <tt>true</tt> if MUC user is the conference focus or
673
+ * <tt>false</tt> if is not. When given <tt>mucJid</tt> does not exist in
674
+ * the MUC then <tt>null</tt> is returned.
673
  */
675
  */
674
 ChatRoom.prototype.isFocus = function (mucJid) {
676
 ChatRoom.prototype.isFocus = function (mucJid) {
675
     var member = this.members[mucJid];
677
     var member = this.members[mucJid];

Loading…
Откажи
Сачувај