Bug 1248465 - Ensure chat tab monitor is registered even if chat core is not initialized yet. r=clokep a=jorgk DONTBUILD
authoraleth <aleth@instantbird.org>
Mon, 15 Feb 2016 21:08:26 +0100
changeset 26793 ca51a47145518c1cdc2cb1a7fc45365a33d41c6f
parent 26792 b72d062cc0edee6b2847a5653feb57a9ebb41549
child 26794 b491a878367bff30297f1967e388caa113502b80
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersclokep, jorgk
bugs1248465
Bug 1248465 - Ensure chat tab monitor is registered even if chat core is not initialized yet. r=clokep a=jorgk DONTBUILD
mail/components/im/content/chat-messenger-overlay.js
--- a/mail/components/im/content/chat-messenger-overlay.js
+++ b/mail/components/im/content/chat-messenger-overlay.js
@@ -131,23 +131,25 @@ var chatTabType = {
       chatHandler._onTabActivated();
   },
   _onWindowDeactivated() {
     let tabmail = document.getElementById("tabmail");
     if (tabmail.currentTabInfo.mode.name == "chat")
       chatHandler._onTabDeactivated();
   },
   openTab: function(aTab, aArgs) {
-    if (!this.hasBeenOpened && imServices.core.initialized) {
-      let convs = imServices.conversations.getUIConversations();
-      if (convs.length != 0) {
-        convs.sort((a, b) =>
-                   a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
-        for (let conv of convs)
-          chatHandler._addConversation(conv);
+    if (!this.hasBeenOpened) {
+      if (chatHandler.ChatCore && chatHandler.ChatCore.initialized) {
+        let convs = imServices.conversations.getUIConversations();
+        if (convs.length != 0) {
+          convs.sort((a, b) =>
+                     a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
+          for (let conv of convs)
+            chatHandler._addConversation(conv);
+        }
       }
 
       // The tab monitor will inform us when a different tab is selected.
       let tabmail = document.getElementById("tabmail");
       tabmail.registerTabMonitor(this.tabMonitor);
       window.addEventListener("deactivate", chatTabType._onWindowDeactivated);
       window.addEventListener("activate", chatTabType._onWindowActivated);
     }