From f1116ba56fef158ec45597abd541db19e72989e9 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 20 Apr 1999 22:43:04 +0000 Subject: [PATCH] add accessor for getting the account manager from the mail session --- mailnews/base/public/nsIMsgMailSession.h | 2 ++ mailnews/base/src/nsMsgMailSession.cpp | 9 +++++++++ mailnews/base/src/nsMsgMailSession.h | 1 + 3 files changed, 12 insertions(+) diff --git a/mailnews/base/public/nsIMsgMailSession.h b/mailnews/base/public/nsIMsgMailSession.h index 3a31fd7fef8..a14d0ff1615 100644 --- a/mailnews/base/public/nsIMsgMailSession.h +++ b/mailnews/base/public/nsIMsgMailSession.h @@ -43,6 +43,7 @@ #include "nsIMsgIdentity.h" #include "nsIMsgIncomingServer.h" +#include "nsIMsgAccountManager.h" class nsIMsgMailSession : public nsISupports { @@ -56,6 +57,7 @@ public: NS_IMETHOD GetCurrentIdentity(nsIMsgIdentity ** aIdentity) = 0; NS_IMETHOD GetCurrentServer(nsIMsgIncomingServer* *aServer) = 0; + NS_IMETHOD GetAccountManager(nsIMsgAccountManager* *aAccountManager) = 0; }; #endif /* nsIMsgMailSession_h___ */ diff --git a/mailnews/base/src/nsMsgMailSession.cpp b/mailnews/base/src/nsMsgMailSession.cpp index 15c1e516d6a..d6e77d81b5a 100644 --- a/mailnews/base/src/nsMsgMailSession.cpp +++ b/mailnews/base/src/nsMsgMailSession.cpp @@ -87,3 +87,12 @@ nsresult nsMsgMailSession::GetCurrentServer(nsIMsgIncomingServer ** aServer) return rv; } + +nsresult nsMsgMailSession::GetAccountManager(nsIMsgAccountManager* *aAM) +{ + if (!aAM) return NS_ERROR_NULL_POINTER; + + *aAM = m_accountManager; + NS_ADDREF(m_accountManager); + return NS_OK; +} diff --git a/mailnews/base/src/nsMsgMailSession.h b/mailnews/base/src/nsMsgMailSession.h index b065690ee65..07e2bad5154 100644 --- a/mailnews/base/src/nsMsgMailSession.h +++ b/mailnews/base/src/nsMsgMailSession.h @@ -44,6 +44,7 @@ public: // nsIMsgMailSession support NS_IMETHOD GetCurrentIdentity(nsIMsgIdentity ** aIdentity); NS_IMETHOD GetCurrentServer(nsIMsgIncomingServer **aServer); + NS_IMETHOD GetAccountManager(nsIMsgAccountManager* *aAM); protected: nsIMsgAccountManager *m_accountManager;