зеркало из https://github.com/mozilla/pjs.git
(not part of the build yet) a=cyeh.
Replace identity stuff with nsIMsgIncomingServer.
This commit is contained in:
Родитель
677108ad97
Коммит
b1b3e8059b
|
@ -46,7 +46,7 @@ nsImapUrl::nsImapUrl()
|
|||
NS_INIT_REFCNT();
|
||||
|
||||
m_errorMessage = nsnull;
|
||||
m_identity = nsnull;
|
||||
m_server = nsnull;
|
||||
|
||||
// nsINetLibUrl specific state
|
||||
m_URL_s = nsnull;
|
||||
|
@ -77,7 +77,7 @@ nsImapUrl::~nsImapUrl()
|
|||
NS_IF_RELEASE(m_imapMessage);
|
||||
NS_IF_RELEASE(m_imapExtension);
|
||||
NS_IF_RELEASE(m_imapMiscellaneous);
|
||||
NS_IF_RELEASE(m_identity);
|
||||
NS_IF_RELEASE(m_server);
|
||||
|
||||
NS_IF_RELEASE(m_urlListeners);
|
||||
PR_FREEIF(m_errorMessage);
|
||||
|
@ -139,48 +139,48 @@ NS_IMETHODIMP nsImapUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr)
|
|||
// Begin nsIImapUrl specific support
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHODIMP nsImapUrl::SetIdentity(nsIMsgIdentity * aMsgIdentity)
|
||||
NS_IMETHODIMP nsImapUrl::SetServer(nsIMsgIncomingServer * aServer)
|
||||
{
|
||||
if (aMsgIdentity)
|
||||
if (aServer)
|
||||
{
|
||||
NS_IF_RELEASE(m_identity);
|
||||
m_identity = aMsgIdentity;
|
||||
NS_ADDREF(m_identity);
|
||||
NS_IF_RELEASE(m_server);
|
||||
m_server = aServer;
|
||||
NS_ADDREF(m_server);
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapUrl::GetIdentity(nsIMsgIdentity **aMsgIdentity)
|
||||
NS_IMETHODIMP nsImapUrl::GetServer(nsIMsgIncomingServer **aServer)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (aMsgIdentity) // valid argument to return result in?
|
||||
if (aServer) // valid argument to return result in?
|
||||
{
|
||||
// if we weren't given an identity, let's be creative and go fetch the default current
|
||||
// identity.
|
||||
if (!m_identity)
|
||||
// if we weren't given an server, let's be creative and go fetch the default current
|
||||
// server.
|
||||
if (!m_server)
|
||||
{
|
||||
nsIMsgMailSession * session = nsnull;
|
||||
rv = nsServiceManager::GetService(kMsgMailSessionCID, nsIMsgMailSession::GetIID(),
|
||||
(nsISupports **) &session);
|
||||
if (NS_SUCCEEDED(rv) && session)
|
||||
{
|
||||
// store the identity in m_identity so we don't have to do this again.
|
||||
rv = session->GetCurrentIdentity(&m_identity);
|
||||
// store the server in m_server so we don't have to do this again.
|
||||
rv = session->GetCurrentServer(&m_server);
|
||||
nsServiceManager::ReleaseService(kMsgMailSessionCID, session);
|
||||
}
|
||||
}
|
||||
|
||||
// if we were given an identity then use it.
|
||||
if (m_identity)
|
||||
// if we were given a server then use it.
|
||||
if (m_server)
|
||||
{
|
||||
*aMsgIdentity = m_identity;
|
||||
NS_ADDREF(m_identity);
|
||||
*aServer = m_server;
|
||||
NS_ADDREF(m_server);
|
||||
}
|
||||
else
|
||||
*aMsgIdentity = nsnull;
|
||||
*aServer = nsnull;
|
||||
} // if aMsgIdentity
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "nsIImapUrl.h"
|
||||
#include "nsIUrlListenerManager.h"
|
||||
#include "nsINetlibURL.h" /* this should be temporary until nunet project lands */
|
||||
#include "nsIMsgIdentity.h"
|
||||
#include "nsIMsgIncomingServer.h"
|
||||
|
||||
class nsImapUrl : public nsIImapUrl, public nsINetlibURL
|
||||
{
|
||||
|
@ -44,8 +44,8 @@ public:
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// we support the nsIImapUrl interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
NS_IMETHOD SetIdentity(nsIMsgIdentity * aMsgIdentity);
|
||||
NS_IMETHOD GetIdentity(nsIMsgIdentity ** aMsgIdentity);
|
||||
NS_IMETHOD SetServer(nsIMsgIncomingServer * aServer);
|
||||
NS_IMETHOD GetServer(nsIMsgIncomingServer ** aServer);
|
||||
|
||||
NS_IMETHOD GetImapLog(nsIImapLog ** aImapLog);
|
||||
NS_IMETHOD SetImapLog(nsIImapLog * aImapLog);
|
||||
|
@ -135,7 +135,7 @@ protected:
|
|||
nsIImapExtension* m_imapExtension;
|
||||
nsIImapMiscellaneous* m_imapMiscellaneous;
|
||||
|
||||
nsIMsgIdentity *m_identity;
|
||||
nsIMsgIncomingServer *m_server;
|
||||
};
|
||||
|
||||
#endif /* nsImapUrl_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче