Просмотр исходного кода

Merge pull request #286 from jitsi/page_reload_overlay

Page reload overlay
dev1
George Politis 9 лет назад
Родитель
Сommit
4cbf19e784
2 измененных файлов: 14 добавлений и 9 удалений
  1. 7
    4
      JitsiConference.js
  2. 7
    5
      modules/xmpp/ChatRoom.js

+ 7
- 4
JitsiConference.js Просмотреть файл

@@ -562,10 +562,11 @@ JitsiConference.prototype.getRole = function () {
562 562
 
563 563
 /**
564 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 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,10 +1299,12 @@ JitsiConference.prototype.sendApplicationLog = function(message) {
1298 1299
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
1299 1300
  * focus.
1300 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 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,7 +75,7 @@ function ChatRoom(connection, jid, password, XMPP, options, settings) {
75 75
     this.joined = false;
76 76
     this.role = null;
77 77
     this.focusMucJid = null;
78
-    this.bridgeIsDown = false;
78
+    this.noBridgeAvailable = false;
79 79
     this.options = options || {};
80 80
     this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
81 81
         settings, {connection: this.xmpp.options, conference: this.options});
@@ -366,9 +366,9 @@ ChatRoom.prototype.onPresence = function (pres) {
366 366
                     }
367 367
                 }
368 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 372
                     this.eventEmitter.emit(XMPPEvents.BRIDGE_DOWN);
373 373
                 }
374 374
                 break;
@@ -669,7 +669,9 @@ ChatRoom.prototype.removePresenceListener = function (name) {
669 669
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
670 670
  * focus.
671 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 676
 ChatRoom.prototype.isFocus = function (mucJid) {
675 677
     var member = this.members[mucJid];

Загрузка…
Отмена
Сохранить