Bug 1161162 - "Join Chat" doesn't focus the newly joined MUC. r=clokep, a=rkent
authoraleth <aleth@instantbird.org>
Mon, 04 May 2015 22:53:53 +0200
changeset 22303 b1b14a3738a04d2697830aeaf39105e979b76428
parent 22302 e0fa5f7f42889ca73cd704f56f4dffbb0e52d820
child 22304 5a29ac144d71170185c86be9ef3ceddd3f54799f
push idunknown
push userunknown
push dateunknown
reviewersclokep, rkent
bugs1161162
Bug 1161162 - "Join Chat" doesn't focus the newly joined MUC. r=clokep, a=rkent
mail/components/im/content/joinchat.js
--- a/mail/components/im/content/joinchat.js
+++ b/mail/components/im/content/joinchat.js
@@ -111,23 +111,27 @@ var joinChat = {
       return true;
 
     let name;
     if (protoId == "prpl-irc")
       name = values.getValue("channel");
     else
       name = values.getValue("room") + "@" + values.getValue("server");
 
-/*
     let conv = Services.conversations.getConversationByNameAndAccount(name,
                                                                       account,
                                                                       true);
-    if (conv)
-      // TODO: select conv
-*/
+    if (conv) {
+      let mailWindow = Services.wm.getMostRecentWindow("mail:3pane");
+      if (mailWindow) {
+        mailWindow.focus();
+        let tabmail = mailWindow.document.getElementById("tabmail");
+        tabmail.openTab("chat", {convType: "focus", conv: conv});
+      }
+    }
 
     if (document.getElementById("autojoin").checked) {
       // "nick" for JS-XMPP, "handle" for libpurple prpls.
       let nick = values.getValue("nick") || values.getValue("handle");
       if (nick)
         name += "/" + nick;
 
       let prefBranch =