Bug 1352859 - Avoid behavior change when delete model is "Just mark it as deleted". r=jorgk,mkmelin
authorGene Smith <gds@chartertn.net>
Sun, 08 Oct 2017 23:51:44 -0400
changeset 29191 56ff0ad0e707eba1500736aa30b1c0e6b8e0c7d1
parent 29190 af57e5297b947197ec47b3fc529446ceccaee146
child 29192 33577e068081b48884ecff324c6d03659e5a561d
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, mkmelin
bugs1352859
Bug 1352859 - Avoid behavior change when delete model is "Just mark it as deleted". r=jorgk,mkmelin In this model no uid expunge will occur so a moved message will show in mbox with Red X and strike-through instead of disappearing. For other models, a moved message will disappear and, if UIDPLUS supported, the moved message will be expunged from the source mbox.
mailnews/imap/src/nsImapProtocol.cpp
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -3027,17 +3027,21 @@ void nsImapProtocol::ProcessSelectedStat
                   Expunge();
                 }
                 else
                 {
                   // Check if UIDPLUS capable so we can just expunge emails we just
                   // copied and marked as deleted. This prevents expunging emails
                   // that other clients may have marked as deleted in the mailbox
                   // and don't want them to disappear.
-                  if (GetServerStateParser().GetCapabilityFlag() & kUidplusCapability)
+                  // Only do UidExpunge() when user selected delete method is "Move
+                  // it to this folder" or "Remove it immediately", not when the
+                  // delete method is "Just mark it as deleted".
+                  if (!GetShowDeletedMessages() &&
+                      (GetServerStateParser().GetCapabilityFlag() & kUidplusCapability))
                   {
                     UidExpunge(messageIdString);
                   }
                 }
               }
               if (m_imapMailFolderSink)
               {
                 copyState = storeSuccessful ? (ImapOnlineCopyState) ImapOnlineCopyStateType::kSuccessfulDelete