diff --git a/mail/base/content/msgMail3PaneWindow.js b/mail/base/content/msgMail3PaneWindow.js index fb3f90a1cd8e..c4b0fdb0d858 100644 --- a/mail/base/content/msgMail3PaneWindow.js +++ b/mail/base/content/msgMail3PaneWindow.js @@ -34,6 +34,9 @@ const kStandardPaneConfig = 0; const kWidePaneConfig = 1; const kVerticalPaneConfig = 2; +// from nsMsgFolderFlags.h +const MSG_FOLDER_FLAG_ELIDED = 0x10; + var gFolderTree; var gMessagePane; var gThreadTree; @@ -794,26 +797,12 @@ function NotifyObservers(aSubject, aTopic, aData) // PerformExpand() for all servers that are open at startup. function PerformExpandForAllOpenServers() { - var folderTree = GetFolderTree(); - var view = folderTree.treeBoxObject.view; - for (var i = 0; i < view.rowCount; i++) + var servers = accountManager.allServers; + for (var i = 0; i < servers.Count(); i++) { - if (view.isContainer(i)) - { - var folderResource = GetFolderResource(folderTree, i); - var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); - var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer"); - if (isServer == "true") - { - if (view.isContainerOpen(i)) - { - var server = msgFolder.server; - // Don't do this for imap servers. See bug #41943 - if (server.type != "imap") - server.performExpand(msgWindow); - } - } - } + var server = servers.QueryElementAt(i, Components.interfaces.nsIMsgIncomingServer); + if (server.type != "imap" && !server.rootMsgFolder.getFlag(MSG_FOLDER_FLAG_ELIDED)) + server.performExpand(msgWindow); } }