summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Sanders <don.sanders@nokia.com>2012-04-19 15:16:51 +0300
committerDon Sanders <don.sanders@nokia.com>2012-04-19 15:16:51 +0300
commit4d2b61eb0d21f3f70238d67bccdf1abf89adef61 (patch)
tree1e5720f6f36ea2e5a7deafbcf89fc95bf2b81f8a
parentc09dcbd713281155f5cdfd952590488cd8b5d554 (diff)
Fix a bug where externalize/move operations were leaking files.
Need to set content scheme and identifier for effected mails. Did numerous tests to ensure there are no regressions, details below * Tests with sent folder and trash folder on server for fwod server * 1) check forward without download send and check mail is in sent folder on server sync and check mail is in inbox check can get attachment for message in inbox check can get attachment for message in sent folder 2) move to trash complete mail check moved mail in trash on server is ok before/after sync check moved mail is shown in universal trash before/after sync 3) move to trash partially downloaded (forwarded) mail in inbox forward without download again check mail in trash on server is ok before sync check can complete mail (download attachment) before sync check moved mail is shown in universal trash before sync 4) move to trash partially downloaded (forwarded) mail in inbox forward without download again check mail in trash is ok after sync check can complete mail (download attachment after sync) check moved mail is shown in universal trash after sync 5) copy message to trash (only works for complete messages) check copied message is in trash (noticed that only metadata is fetched for copied message, but can retrieve rest of mail using GUI) 6) remove from trash check still removed after sync 7) normal send, restore from trash on server send normal mail with attachment, sync, move to trash, restore from trash on server, get attachment * Tests without sent folder and trash on server for fwod server * Same as above, but test using universal trash and universal sent mail e.g. check mail is in univeral sent, check can restore from universal trash * Tests on server without fwod * Need to do all above tests again
-rw-r--r--src/plugins/messageservices/imap/imapstrategy.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/messageservices/imap/imapstrategy.cpp b/src/plugins/messageservices/imap/imapstrategy.cpp
index 78e9b0c8..a1e4c9f6 100644
--- a/src/plugins/messageservices/imap/imapstrategy.cpp
+++ b/src/plugins/messageservices/imap/imapstrategy.cpp
@@ -4007,11 +4007,21 @@ QString ImapCopyMessagesStrategy::copiedMessageFetched(ImapStrategyContextBase *
void ImapCopyMessagesStrategy::updateCopiedMessage(ImapStrategyContextBase *, QMailMessage &message, const QMailMessage &source)
{
message.setStatus(QMailMessage::New, source.status() & QMailMessage::New);
- message.setStatus(QMailMessage::Trash, source.status() & QMailMessage::Trash); // shouldn't standard flags be set correctly when retrieving?
message.setStatus(QMailMessage::Read, source.status() & QMailMessage::Read);
message.setStatus(QMailMessage::Important, source.status() & QMailMessage::Important);
-
message.setRestoreFolderId(source.restoreFolderId());
+
+ // Need to set these status fields as ImapClient::messageFetched only updates them for newly retrieved mails
+ message.setStatus(QMailMessage::Incoming, source.status() & QMailMessage::Incoming);
+ message.setStatus(QMailMessage::Outgoing, source.status() & QMailMessage::Outgoing);
+ message.setStatus(QMailMessage::Draft, source.status() & QMailMessage::Draft);
+ message.setStatus(QMailMessage::Sent, source.status() & QMailMessage::Sent);
+ message.setStatus(QMailMessage::Junk, source.status() & QMailMessage::Junk);
+ message.setStatus(QMailMessage::CalendarInvitation, source.hasCalendarInvitation());
+
+ // Need to set content scheme and identifier to prevent file leaks
+ message.setContentScheme(source.contentScheme());
+ message.setContentIdentifier(source.contentIdentifier());
}
void ImapCopyMessagesStrategy::copyNextMessage(ImapStrategyContextBase *context)