fix subscribe ui to select the server of the selected folder, patch originally by jcranmer, tweaked by me, r=me, jcranmer 455947
authorDavid Bienvenu <bienvenu@nventure.com>
Thu, 13 Nov 2008 15:27:43 -0800
changeset 1101 71453825e59ac92829e38ddb260aa2b10181b4b1
parent 1100 9346f93d9620f5e7254c4649186df9f37dfd31f2
child 1102 8efc8732d04adc0dd437ad3c8c81ff5d95d0f857
push idunknown
push userunknown
push dateunknown
reviewersme, jcranmer
bugs455947
fix subscribe ui to select the server of the selected folder, patch originally by jcranmer, tweaked by me, r=me, jcranmer 455947
mail/base/content/subscribe.js
--- a/mail/base/content/subscribe.js
+++ b/mail/base/content/subscribe.js
@@ -244,22 +244,18 @@ function SubscribeOnLoad()
   // look in arguments[0] for parameters
   if (window.arguments && window.arguments[0]) {
     if ( window.arguments[0].okCallback ) {
       top.okCallback = window.arguments[0].okCallback;
     }
   }
 
   gServerURI = null;
-  if (window.arguments[0].preselectedURI) {
-    var uri = window.arguments[0].preselectedURI;
-    //dump("subscribe: got a uri," + uri + "\n");
-    var folder = GetMsgFolderFromUri(uri, true);
-    //dump("folder="+folder+"\n");
-    //dump("folder.server="+folder.server+"\n");
+  let folder = window.arguments[0].folder;
+  if (folder && folder.server instanceof Components.interfaces.nsISubscribableServer) {
     var serverMenu = document.getElementById("serverMenu");
     serverMenu.menupopup.selectFolder(folder.server.rootMsgFolder);
     try {
                         CleanUpSearchView();
       gSubscribableServer = folder.server.QueryInterface(Components.interfaces.nsISubscribableServer);
                         // enable (or disable) the search related UI
                         EnableSearchUI();
       gServerURI = folder.server.serverURI;