"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "comm/mailnews/imap/src/nsImapMailFolder.cpp" between
seamonkey-2.53.8.source.tar.xz and seamonkey-2.53.8.1.source.tar.xz

About: SeaMonkey is an all-in-one internet application suite. Using much of the Mozilla source code it contains a Web-browser, email & newsgroup and feed client, IRC chat, and an included HTML editor.

nsImapMailFolder.cpp  (seamonkey-2.53.8.source.tar.xz):nsImapMailFolder.cpp  (seamonkey-2.53.8.1.source.tar.xz)
skipping to change at line 3881 skipping to change at line 3881
dstFolderDB->GetMsgHdrForKey(offlineOps[opIndex], dstFolderDB->GetMsgHdrForKey(offlineOps[opIndex],
getter_AddRefs(fakeDestHdr)); getter_AddRefs(fakeDestHdr));
if (fakeDestHdr) if (fakeDestHdr)
messages->AppendElement(fakeDestHdr); messages->AppendElement(fakeDestHdr);
break; break;
} }
} }
} }
} }
} }
destImapFolder->SetPendingAttributes(messages, isMove); // 3rd parameter: Set offline flag.
destImapFolder->SetPendingAttributes(messages, isMove, true);
} }
} }
// if we can't get the dst folder db, we should still try to playback // if we can't get the dst folder db, we should still try to playback
// the offline move/copy. // the offline move/copy.
} }
nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACTID , &rv); nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACTID , &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr <nsIURI> resultUrl; nsCOMPtr <nsIURI> resultUrl;
nsAutoCString uids; nsAutoCString uids;
skipping to change at line 7431 skipping to change at line 7432
nsCOMPtr<nsISupports> srcSupport = do_QueryInterface(srcFolder); nsCOMPtr<nsISupports> srcSupport = do_QueryInterface(srcFolder);
OnCopyCompleted(srcSupport, rv); OnCopyCompleted(srcSupport, rv);
if (isMove) if (isMove)
srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ? srcFolder->NotifyFolderEvent(NS_SUCCEEDED(rv) ?
mDeleteOrMoveMsgCompletedAtom : mDeleteOrMoveMsgCompletedAtom :
mDeleteOrMoveMsgFailedAtom); mDeleteOrMoveMsgFailedAtom);
return rv; return rv;
} }
void nsImapMailFolder::SetPendingAttributes(nsIArray* messages, bool aIsMove) void nsImapMailFolder::SetPendingAttributes(nsIArray* messages, bool aIsMove,
bool aSetOffline)
{ {
GetDatabase(); GetDatabase();
if (!mDatabase) if (!mDatabase)
return; return;
uint32_t supportedUserFlags; uint32_t supportedUserFlags;
GetSupportedUserFlags(&supportedUserFlags); GetSupportedUserFlags(&supportedUserFlags);
nsresult rv; nsresult rv;
skipping to change at line 7532 skipping to change at line 7534
nsCString storeToken; nsCString storeToken;
msgDBHdr->GetMessageOffset(&messageOffset); msgDBHdr->GetMessageOffset(&messageOffset);
msgDBHdr->GetOfflineMessageSize(&messageSize); msgDBHdr->GetOfflineMessageSize(&messageSize);
msgDBHdr->GetStringProperty("storeToken", getter_Copies(storeToken)); msgDBHdr->GetStringProperty("storeToken", getter_Copies(storeToken));
if (messageSize) if (messageSize)
{ {
mDatabase->SetUint32AttributeOnPendingHdr(msgDBHdr, "offlineMsgSize", mDatabase->SetUint32AttributeOnPendingHdr(msgDBHdr, "offlineMsgSize",
messageSize); messageSize);
mDatabase->SetUint64AttributeOnPendingHdr(msgDBHdr, "msgOffset", mDatabase->SetUint64AttributeOnPendingHdr(msgDBHdr, "msgOffset",
messageOffset); messageOffset);
mDatabase->SetUint32AttributeOnPendingHdr(msgDBHdr, "flags", // Not always setting "flags" attribute to nsMsgMessageFlags::Offline
nsMsgMessageFlags::Offline); // here because it can cause missing parts (inline or attachments)
// when messages are moved or copied manually or by filter action.
if (aSetOffline)
mDatabase->SetUint32AttributeOnPendingHdr(msgDBHdr, "flags",
nsMsgMessageFlags::Offline);
mDatabase->SetAttributeOnPendingHdr(msgDBHdr, "storeToken", mDatabase->SetAttributeOnPendingHdr(msgDBHdr, "storeToken",
storeToken.get()); storeToken.get());
} }
nsMsgPriorityValue priority; nsMsgPriorityValue priority;
msgDBHdr->GetPriority(&priority); msgDBHdr->GetPriority(&priority);
if(priority != 0) if(priority != 0)
{ {
nsAutoCString priorityStr; nsAutoCString priorityStr;
priorityStr.AppendInt(priority); priorityStr.AppendInt(priority);
mDatabase->SetAttributeOnPendingHdr(msgDBHdr, "priority", priorityStr.ge t()); mDatabase->SetAttributeOnPendingHdr(msgDBHdr, "priority", priorityStr.ge t());
skipping to change at line 7654 skipping to change at line 7660
nsCOMPtr<nsIMutableArray> sortedMsgs(do_CreateInstance(NS_ARRAY_CONTRACTID)) ; nsCOMPtr<nsIMutableArray> sortedMsgs(do_CreateInstance(NS_ARRAY_CONTRACTID)) ;
rv = MessagesInKeyOrder(keyArray, srcFolder, sortedMsgs); rv = MessagesInKeyOrder(keyArray, srcFolder, sortedMsgs);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
if (WeAreOffline()) if (WeAreOffline())
return CopyMessagesOffline(srcFolder, sortedMsgs, isMove, msgWindow, liste ner); return CopyMessagesOffline(srcFolder, sortedMsgs, isMove, msgWindow, liste ner);
nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACT ID, &rv); nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACT ID, &rv);
NS_ENSURE_SUCCESS(rv,rv); NS_ENSURE_SUCCESS(rv,rv);
SetPendingAttributes(sortedMsgs, isMove); // 3rd parameter: Do not set offline flag.
SetPendingAttributes(sortedMsgs, isMove, false);
// if the folders aren't on the same server, do a stream base copy // if the folders aren't on the same server, do a stream base copy
if (!sameServer) if (!sameServer)
{ {
rv = CopyMessagesWithStream(srcFolder, sortedMsgs, isMove, true, msgWindow , listener, allowUndo); rv = CopyMessagesWithStream(srcFolder, sortedMsgs, isMove, true, msgWindow , listener, allowUndo);
goto done; goto done;
} }
nsAutoCString messageIds; nsAutoCString messageIds;
rv = AllocateUidStringFromKeys(keyArray.Elements(), numMsgs, messageIds); rv = AllocateUidStringFromKeys(keyArray.Elements(), numMsgs, messageIds);
skipping to change at line 8101 skipping to change at line 8108
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
messageId.AppendInt((int32_t) key); messageId.AppendInt((int32_t) key);
// Perhaps we have the message offline, but even if we do it is // Perhaps we have the message offline, but even if we do it is
// not valid, since the only time we do a file copy for an // not valid, since the only time we do a file copy for an
// existing message is when we are changing the message. // existing message is when we are changing the message.
// So set the offline size to 0 to force SetPendingAttributes to // So set the offline size to 0 to force SetPendingAttributes to
// clear the offline message flag. // clear the offline message flag.
msgToReplace->SetOfflineMessageSize(0); msgToReplace->SetOfflineMessageSize(0);
messages->AppendElement(msgToReplace); messages->AppendElement(msgToReplace);
SetPendingAttributes(messages, false); SetPendingAttributes(messages, false, false);
} }
} }
bool isMove = (msgToReplace ? true : false); bool isMove = (msgToReplace ? true : false);
rv = InitCopyState(srcSupport, messages, isMove, isDraftOrTemplate, rv = InitCopyState(srcSupport, messages, isMove, isDraftOrTemplate,
false, aNewMsgFlags, aNewMsgKeywords, listener, false, aNewMsgFlags, aNewMsgKeywords, listener,
msgWindow, false); msgWindow, false);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return OnCopyCompleted(srcSupport, rv); return OnCopyCompleted(srcSupport, rv);
skipping to change at line 8440 skipping to change at line 8447
nsCOMPtr<nsIMsgPluggableStore> msgStore; nsCOMPtr<nsIMsgPluggableStore> msgStore;
GetMsgStore(getter_AddRefs(msgStore)); GetMsgStore(getter_AddRefs(msgStore));
if (msgStore) if (msgStore)
msgStore->FinishNewMessage(offlineStore, fakeHdr); msgStore->FinishNewMessage(offlineStore, fakeHdr);
} }
nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &r v)); nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &r v));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
messages->AppendElement(fakeHdr); messages->AppendElement(fakeHdr);
SetPendingAttributes(messages, false); // We are copying from a file to offline store so set offline flag.
SetPendingAttributes(messages, false, true);
// Gloda needs this notification to index the fake message. // Gloda needs this notification to index the fake message.
nsCOMPtr<nsIMsgFolderNotificationService> nsCOMPtr<nsIMsgFolderNotificationService>
notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID)); notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
if (notifier) if (notifier)
notifier->NotifyMsgsClassified(messages, false, false); notifier->NotifyMsgsClassified(messages, false, false);
inputStream->Close(); inputStream->Close();
inputStream = nullptr; inputStream = nullptr;
delete inputStreamBuffer; delete inputStreamBuffer;
} }
if (offlineStore) if (offlineStore)
 End of changes. 6 change blocks. 
7 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)