зеркало из https://github.com/mozilla/pjs.git
add statusFeedback to SelectFolder call, way to get running imap url from imap protocol
This commit is contained in:
Родитель
1659608160
Коммит
ab5b53c69c
|
@ -87,6 +87,8 @@ public:
|
|||
NS_IMETHOD GetFlagsForUID(PRUint32 uid, PRBool *foundIt, imapMessageFlagsType *flags) = 0;
|
||||
NS_IMETHOD GetSupportedUserFlags(PRUint16 *flags) = 0;
|
||||
|
||||
NS_IMETHOD GetRunningImapURL(nsIImapUrl **aImapUrl) = 0;
|
||||
|
||||
// this is for the temp message display hack
|
||||
// ** jt - let's try it a litter more generic way
|
||||
NS_IMETHOD GetStreamConsumer (nsISupports **aSupport) = 0;
|
||||
|
|
|
@ -45,6 +45,7 @@ class nsIURI;
|
|||
class nsIImapUrl;
|
||||
class nsIEventQueue;
|
||||
class nsIMsgFolder;
|
||||
class nsIMsgStatusFeedback;
|
||||
|
||||
class nsIImapService : public nsISupports
|
||||
{
|
||||
|
@ -58,6 +59,7 @@ public:
|
|||
NS_IMETHOD SelectFolder(nsIEventQueue * aClientEventQueue,
|
||||
nsIMsgFolder * aImapMailFolder,
|
||||
nsIUrlListener * aUrlListener,
|
||||
nsIMsgStatusFeedback *aMsgStatusFeedback,
|
||||
nsIURI ** aURL) = 0;
|
||||
NS_IMETHOD LiteSelectFolder(nsIEventQueue * aClientEventQueue,
|
||||
nsIMsgFolder * aImapMailFolder,
|
||||
|
|
|
@ -45,14 +45,12 @@
|
|||
#include "nsICopyMsgStreamListener.h"
|
||||
#include "nsImapStringBundle.h"
|
||||
|
||||
#include "nsIMsgStatusFeedback.h"
|
||||
|
||||
|
||||
#ifdef DOING_FILTERS
|
||||
#include "nsIMsgFilter.h"
|
||||
#include "nsIMsgFilterService.h"
|
||||
#include "nsImapMoveCoalescer.h"
|
||||
static NS_DEFINE_CID(kMsgFilterServiceCID, NS_MSGFILTERSERVICE_CID);
|
||||
#endif
|
||||
|
||||
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
|
||||
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
|
||||
|
@ -441,7 +439,7 @@ NS_IMETHODIMP nsImapMailFolder::GetMessages(nsIEnumerator* *result)
|
|||
// don't run select if we're already running a url/select...
|
||||
if (NS_SUCCEEDED(rv) && !m_urlRunning && selectFolder)
|
||||
{
|
||||
rv = imapService->SelectFolder(m_eventQueue, this, this, nsnull);
|
||||
rv = imapService->SelectFolder(m_eventQueue, this, this, nsnull, nsnull);
|
||||
m_urlRunning = PR_TRUE;
|
||||
}
|
||||
|
||||
|
@ -1041,7 +1039,7 @@ NS_IMETHODIMP nsImapMailFolder::GetNewMessages()
|
|||
PRUint32 numFolders;
|
||||
rv = rootFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_INBOX, getter_AddRefs(inbox), 1, &numFolders);
|
||||
}
|
||||
rv = imapService->SelectFolder(m_eventQueue, inbox, this, nsnull);
|
||||
rv = imapService->SelectFolder(m_eventQueue, inbox, this, nsnull, nsnull);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1812,7 +1810,7 @@ nsresult nsImapMailFolder::StoreImapFlags(imapMessageFlagsType flags, PRBool add
|
|||
PR_TRUE);
|
||||
}
|
||||
// force to update the thread pane view
|
||||
rv = imapService->SelectFolder(m_eventQueue, this, this, nsnull);
|
||||
rv = imapService->SelectFolder(m_eventQueue, this, this, nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2720,14 +2718,12 @@ nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
|
|||
{
|
||||
if (mDatabase)
|
||||
mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
#ifdef DOING_FILTERS
|
||||
if (m_moveCoalescer)
|
||||
{
|
||||
m_moveCoalescer->PlaybackMoves (m_eventQueue);
|
||||
delete m_moveCoalescer;
|
||||
m_moveCoalescer = nsnull;
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2815,6 +2811,23 @@ nsImapMailFolder::PercentProgress(nsIImapProtocol* aProtocol,
|
|||
nsCString message(aInfo->message);
|
||||
printf("progress: %d %s\n", aInfo->percent, message.GetBuffer());
|
||||
#endif
|
||||
if (aProtocol)
|
||||
{
|
||||
nsCOMPtr <nsIImapUrl> imapUrl;
|
||||
aProtocol->GetRunningImapURL(getter_AddRefs(imapUrl));
|
||||
if (imapUrl)
|
||||
{
|
||||
nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(imapUrl);
|
||||
if (mailnewsUrl)
|
||||
{
|
||||
nsCOMPtr <nsIMsgStatusFeedback> feedback;
|
||||
mailnewsUrl->GetStatusFeedback(getter_AddRefs(feedback));
|
||||
if (feedback && aInfo->message)
|
||||
feedback->ShowStatusString(aInfo->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -3136,7 +3149,7 @@ nsImapMailFolder::CopyFileMessage(nsIFileSpec* fileSpec,
|
|||
urlListener, nsnull,
|
||||
copySupport);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
imapService->SelectFolder(m_eventQueue, this, this, nsnull);
|
||||
imapService->SelectFolder(m_eventQueue, this, this, nsnull, nsnull);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -370,11 +370,9 @@ protected:
|
|||
PRBool m_haveDiscoverAllFolders;
|
||||
PRBool m_haveReadNameFromDB;
|
||||
nsCOMPtr<nsIMsgParseMailMsgState> m_msgParser;
|
||||
#ifdef DOING_FILTERS
|
||||
nsCOMPtr<nsIMsgFilterList> m_filterList;
|
||||
PRBool m_msgMovedByFilter;
|
||||
nsImapMoveCoalescer *m_moveCoalescer;
|
||||
#endif
|
||||
nsMsgKey m_curMsgUid;
|
||||
PRInt32 m_nextMessageByteLength;
|
||||
nsCOMPtr<nsIEventQueue> m_eventQueue;
|
||||
|
|
|
@ -1020,6 +1020,18 @@ nsImapProtocol::GetRunningUrl(nsIURI **result)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsImapProtocol::GetRunningImapURL(nsIImapUrl **aImapUrl)
|
||||
{
|
||||
if (aImapUrl && m_runningUrl)
|
||||
{
|
||||
return m_runningUrl->QueryInterface(nsIImapUrl::GetIID(), (void**) aImapUrl);
|
||||
}
|
||||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Writes the data contained in dataBuffer into the current output stream. It also informs
|
||||
* the transport layer that this data is now available for transmission.
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
// Notify FE Event has been completed
|
||||
NS_IMETHOD NotifyFEEventCompletion();
|
||||
|
||||
NS_IMETHOD GetRunningImapURL(nsIImapUrl **aImapUrl);
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// we suppport the nsIStreamListener interface
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include "nsIEventQueueService.h"
|
||||
#include "nsRDFCID.h"
|
||||
|
||||
#include "nsIMsgStatusFeedback.h"
|
||||
|
||||
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
|
||||
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
|
||||
// that multiply inherits from nsISupports
|
||||
|
@ -122,6 +124,7 @@ NS_IMETHODIMP
|
|||
nsImapService::SelectFolder(nsIEventQueue * aClientEventQueue,
|
||||
nsIMsgFolder * aImapMailFolder,
|
||||
nsIUrlListener * aUrlListener,
|
||||
nsIMsgStatusFeedback *aStatusFeedback,
|
||||
nsIURI ** aURL)
|
||||
{
|
||||
|
||||
|
@ -142,6 +145,11 @@ nsImapService::SelectFolder(nsIEventQueue * aClientEventQueue,
|
|||
if (NS_SUCCEEDED(rv) && imapUrl)
|
||||
{
|
||||
rv = imapUrl->SetImapAction(nsIImapUrl::nsImapSelectFolder);
|
||||
|
||||
nsCOMPtr <nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
|
||||
if (mailNewsUrl)
|
||||
mailNewsUrl->SetStatusFeedback(aStatusFeedback);
|
||||
|
||||
rv = SetImapUrlSink(aImapMailFolder, imapUrl);
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
|
@ -326,7 +334,7 @@ nsImapService::CopyMessage(const char * aSrcMailboxURI, nsIStreamListener *
|
|||
PR_TRUE);
|
||||
// ** jt -- force to update the folder
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = SelectFolder(queue, folder, aUrlListener, nsnull);
|
||||
rv = SelectFolder(queue, folder, aUrlListener, nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ class nsIImapHostSessionList;
|
|||
class nsString2;
|
||||
class nsIImapUrl;
|
||||
class nsIMsgFolder;
|
||||
class nsIMsgStatusFeedback;
|
||||
|
||||
class nsImapService : public nsIImapService, public nsIMsgMessageService, public nsIProtocolHandler
|
||||
{
|
||||
|
@ -47,6 +48,7 @@ public:
|
|||
NS_IMETHOD SelectFolder(nsIEventQueue * aClientEventQueue,
|
||||
nsIMsgFolder *aImapMailFolder,
|
||||
nsIUrlListener * aUrlListener,
|
||||
nsIMsgStatusFeedback *aMsgStatusFeedback,
|
||||
nsIURI ** aURL);
|
||||
NS_IMETHOD LiteSelectFolder(nsIEventQueue * aClientEventQueue,
|
||||
nsIMsgFolder * aImapMailFolder,
|
||||
|
|
|
@ -165,7 +165,7 @@ nsImapMoveCopyMsgTxn::Undo(void)
|
|||
m_idsAreUids);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_srcFolder,
|
||||
srcListener, nsnull);
|
||||
srcListener, nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
if (m_dstKeyArray.GetSize() > 0)
|
||||
|
@ -180,7 +180,7 @@ nsImapMoveCopyMsgTxn::Undo(void)
|
|||
m_idsAreUids);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_dstFolder,
|
||||
dstListener, nsnull);
|
||||
dstListener, nsnull, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ nsImapMoveCopyMsgTxn::Redo(void)
|
|||
m_idsAreUids);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_srcFolder,
|
||||
srcListener, nsnull);
|
||||
srcListener, nsnull, nsnull);
|
||||
}
|
||||
}
|
||||
if (m_dstKeyArray.GetSize() > 0)
|
||||
|
@ -224,7 +224,7 @@ nsImapMoveCopyMsgTxn::Redo(void)
|
|||
m_idsAreUids);
|
||||
if(NS_SUCCEEDED(rv))
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_dstFolder,
|
||||
dstListener, nsnull);
|
||||
dstListener, nsnull, nsnull);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ nsresult nsIMAP4TestDriver::OnSelectFolder()
|
|||
{
|
||||
SetupInbox();
|
||||
if (NS_SUCCEEDED(rv) && m_inbox)
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_inbox /* imap folder sink */, this /* url listener */, nsnull);
|
||||
rv = imapService->SelectFolder(m_eventQueue, m_inbox /* imap folder sink */, this /* url listener */, nsnull, nsnull);
|
||||
m_runningURL = PR_TRUE; // we are now running a url...
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче