зеркало из https://github.com/mozilla/gecko-dev.git
get status msgs working again for imap 73241, couple small fixes for offline imap 15865 r=naving, sr=sspitzer
This commit is contained in:
Родитель
acd235df63
Коммит
efce4931fc
|
@ -55,7 +55,7 @@ interface nsIURI;
|
|||
|
||||
interface nsIImapMockChannel : nsIChannel
|
||||
{
|
||||
void GetProgressEventSink(out nsIProgressEventSink aProgressSink);
|
||||
attribute nsIProgressEventSink progressEventSink;
|
||||
void GetChannelListener(out nsIStreamListener aChannelListener);
|
||||
void GetChannelContext(out nsISupports aChannelContext);
|
||||
void Close();
|
||||
|
|
|
@ -164,6 +164,7 @@ interface nsIImapUrl : nsISupports
|
|||
const long nsImapUidExpunge = 0x10000029;
|
||||
const long nsImapSaveMessageToDisk = 0x10000030;
|
||||
const long nsImapOpenMimePart = 0x10000031;
|
||||
const long nsImapMsgDownloadForOffline = 0x10000032;
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -268,7 +268,7 @@
|
|||
# LOCALIZATION NOTE (Error 5045): Do not translate the word "%s" or "%lu" below.
|
||||
# Place the word %s in your translation where the name of the folder should appear.
|
||||
# Place the word %lu where the number of headers should appear.
|
||||
5045=%s - Receiving: message %lu of %lu
|
||||
5045=%S - Receiving: message %lu of %lu
|
||||
|
||||
## @name IMAP_DISCOVERING_MAILBOX
|
||||
## @loc None
|
||||
|
|
|
@ -1731,6 +1731,7 @@ void nsImapProtocol::ProcessSelectedStateURL()
|
|||
break;
|
||||
case nsIImapUrl::nsImapSaveMessageToDisk:
|
||||
case nsIImapUrl::nsImapMsgFetch:
|
||||
case nsIImapUrl::nsImapMsgDownloadForOffline:
|
||||
{
|
||||
nsXPIDLCString messageIdString;
|
||||
m_runningUrl->CreateListOfMessageIdsString(getter_Copies(messageIdString));
|
||||
|
@ -6800,6 +6801,12 @@ NS_IMETHODIMP nsImapMockChannel::GetProgressEventSink(nsIProgressEventSink ** aP
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMockChannel::SetProgressEventSink(nsIProgressEventSink * aProgressEventSink)
|
||||
{
|
||||
mProgressEventSink = aProgressEventSink;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMockChannel::GetChannelListener(nsIStreamListener **aChannelListener)
|
||||
{
|
||||
*aChannelListener = m_channelListener;
|
||||
|
|
|
@ -3256,7 +3256,7 @@ nsImapService::DownloadMessagesForOffline(const char *messageIds, nsIMsgFolder *
|
|||
nsCOMPtr<nsIImapMessageSink> imapMessageSink(do_QueryInterface(aFolder, &rv));
|
||||
nsCOMPtr<nsIStreamListener> folderStreamListener(do_QueryInterface(aFolder, &rv));
|
||||
// ### need to use peek to fetch messages, because FetchMessage is marking them read.
|
||||
rv = FetchMessage(imapUrl, nsImapUrl::nsImapMsgFetch,aFolder, imapMessageSink,
|
||||
rv = FetchMessage(imapUrl, nsImapUrl::nsImapMsgDownloadForOffline,aFolder, imapMessageSink,
|
||||
aMsgWindow, getter_AddRefs(runningURI), folderStreamListener, messageIds, PR_TRUE);
|
||||
if (runningURI && aUrlListener)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "nsIMsgHdr.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
|
||||
static NS_DEFINE_CID(kCImapMockChannel, NS_IMAPMOCKCHANNEL_CID);
|
||||
static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
|
||||
|
@ -105,8 +106,13 @@ NS_IMETHODIMP nsImapUrl::SetMsgWindow(nsIMsgWindow *aMsgWindow)
|
|||
nsCOMPtr<nsIDocShell> msgDocShell;
|
||||
m_msgWindow->GetRootDocShell(getter_AddRefs(msgDocShell));
|
||||
if (msgDocShell) {
|
||||
nsCOMPtr <nsIProgressEventSink> prevEventSink;
|
||||
m_mockChannel->GetProgressEventSink(getter_AddRefs(prevEventSink));
|
||||
nsCOMPtr<nsIInterfaceRequestor> docIR(do_QueryInterface(msgDocShell));
|
||||
m_mockChannel->SetNotificationCallbacks(docIR);
|
||||
// we want to use our existing event sink.
|
||||
if (prevEventSink)
|
||||
m_mockChannel->SetProgressEventSink(prevEventSink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче