summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Sanders <don.sanders@nokia.com>2012-01-12 18:50:18 +0200
committerDon Sanders <don.sanders@nokia.com>2012-01-12 18:50:18 +0200
commit529c8511e723fa9b4438d40b05f9685085ff35e2 (patch)
tree0daa61229c26a6c8768d46b30b26f1687ec71902
parent79e03debb2e1dbf5a8cd7be337eba04c41b9b99b (diff)
Fix qtmail bug in editing message in drafts folder on server
Updated message should now be saved to drafts folder on server. This required deleting old message, and saving a new message. Which has some side effects. #1 On gmail deleted messages are copied to the trash automatically. #2 In qtmail if multiple qmf accounts exist for the same remote account then updating a drafts in one qmf account and then viewing the other account will detect that the original drafts message has been removed due to qtmail automatic visible message flags updating, and the new message will not be retrieved until a synchronization is performed.
-rw-r--r--examples/qtmail/app/emailclient.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/qtmail/app/emailclient.cpp b/examples/qtmail/app/emailclient.cpp
index 08fcf319..86ada777 100644
--- a/examples/qtmail/app/emailclient.cpp
+++ b/examples/qtmail/app/emailclient.cpp
@@ -1210,7 +1210,12 @@ void EmailClient::saveAsDraft(QMailMessage& mail)
mail.setStatus(QMailMessage::LocalOnly, true);
inserted = QMailStore::instance()->addMessage(&mail);
} else {
- inserted = QMailStore::instance()->updateMessage(&mail);
+ QMailMessageId msgId = mail.id();
+ mail.setId(QMailMessageId());
+ mail.setStatus(QMailMessage::LocalOnly, true);
+ mail.setServerUid(QString());
+ inserted = QMailStore::instance()->addMessage(&mail);
+ QMailStore::instance()->removeMessage(msgId, QMailStore::CreateRemovalRecord);
}
if (inserted) {