From 62bfb8199cff3ad41bea6bd38d2d58856b34c523 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Wed, 15 Sep 1999 04:57:24 +0000 Subject: [PATCH] minor cleanup to make onloadmessenger easier to read --- .../resources/content/msgMail3PaneWindow.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mailnews/base/resources/content/msgMail3PaneWindow.js b/mailnews/base/resources/content/msgMail3PaneWindow.js index e98049cde401..607ccba581b1 100644 --- a/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -64,13 +64,7 @@ function OnLoadMessenger() loadStartFolder(); - var mailSession = Components.classes['component://netscape/messenger/services/session'].getService(); - if(mailSession) - { - mailSession = mailSession.QueryInterface(Components.interfaces.nsIMsgMailSession); - if(mailSession) - mailSession.AddFolderListener(folderListener); - } + getFolderListener(); } function OnUnloadMessenger() @@ -155,6 +149,18 @@ function loadStartFolder() } +function getFolderListener() +{ + try { + var mailSession = Components.classes['component://netscape/messenger/services/session'].getService(Components.interfaces.nsIMsgMailSession); + + mailSession.AddFolderListener(folderListener); + } catch (ex) { + dump("Error adding folder listener\n"); + } +} + + function AddDataSources() {