зеркало из https://github.com/mozilla/gecko-dev.git
124295 sr=bienvenu move msgHdr out of imapThread to ui thread - fixes
assertion on copying local msgs to imap.
This commit is contained in:
Родитель
7a62a90f8e
Коммит
b6cd30e242
|
@ -72,4 +72,6 @@ interface nsIImapMessageSink : nsISupports {
|
|||
|
||||
void SetContentModified(in nsIImapUrl aImapUrl, in nsImapContentModifiedType modified);
|
||||
void SetImageCacheSessionForUrl(in nsIMsgMailNewsUrl aMailUrl);
|
||||
|
||||
boolean isCurMoveCopyMessageRead(in nsIImapUrl runningUrl);
|
||||
};
|
||||
|
|
|
@ -4030,6 +4030,26 @@ nsImapMailFolder::SetImageCacheSessionForUrl(nsIMsgMailNewsUrl *mailurl)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::IsCurMoveCopyMessageRead(nsIImapUrl *runningUrl, PRBool *aResult)
|
||||
{
|
||||
nsCOMPtr <nsISupports> copyState;
|
||||
runningUrl->GetCopyState(getter_AddRefs(copyState));
|
||||
if (copyState)
|
||||
{
|
||||
nsCOMPtr<nsImapMailCopyState> mailCopyState = do_QueryInterface(copyState);
|
||||
if (mailCopyState)
|
||||
{
|
||||
PRUint32 flags;
|
||||
if (mailCopyState->m_message)
|
||||
{
|
||||
mailCopyState->m_message->GetFlags(&flags);
|
||||
*aResult =(flags & MSG_FLAG_READ) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
{
|
||||
return NS_OK;
|
||||
|
|
|
@ -4683,25 +4683,11 @@ void nsImapProtocol::OnAppendMsgFromFile()
|
|||
if (mailboxName)
|
||||
{
|
||||
imapMessageFlagsType flagsToSet = kImapMsgSeenFlag;
|
||||
nsCOMPtr <nsISupports> copyState;
|
||||
m_runningUrl->GetCopyState(getter_AddRefs(copyState));
|
||||
if (copyState)
|
||||
{
|
||||
nsCOMPtr<nsImapMailCopyState> mailCopyState = do_QueryInterface(copyState, &rv);
|
||||
if (mailCopyState)
|
||||
{
|
||||
nsCOMPtr <nsIMsgDBHdr> curMsg = mailCopyState->m_message;
|
||||
PRUint32 flags;
|
||||
|
||||
if (curMsg)
|
||||
{
|
||||
curMsg->GetFlags(&flags);
|
||||
if (! (flags & MSG_FLAG_READ))
|
||||
PRBool read;
|
||||
if (m_imapMessageSink)
|
||||
m_imapMessageSink->IsCurMoveCopyMessageRead(m_runningUrl, &read);
|
||||
if (!read)
|
||||
flagsToSet &= ~MSG_FLAG_READ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
UploadMessageFromFile(fileSpec, mailboxName, flagsToSet);
|
||||
PR_Free( mailboxName );
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче