fix problems filtering pop3 mail when hidden pref to remove dupes is set, bug 457168, r=standard8, sr=neil, a=standard8
authorDavid Bienvenu <bienvenu@nventure.com>
Mon, 29 Sep 2008 06:57:30 -0700
changeset 460 4e502622d8b1bbbc5f03842812e0914c30a58ccc
parent 459 f8499aaeeba17b796910b8943bb567bb0b058024
child 461 f95b15892209021649676464b167fe4192c86014
push idunknown
push userunknown
push dateunknown
reviewersstandard8, neil, standard8
bugs457168
fix problems filtering pop3 mail when hidden pref to remove dupes is set, bug 457168, r=standard8, sr=neil, a=standard8
mailnews/local/src/nsParseMailbox.cpp
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1732,18 +1732,25 @@ PRInt32 nsParseNewMailState::PublishMsgH
 
               }
               break;
             case nsIMsgIncomingServer::moveDupsToTrash:
               {
                 nsCOMPtr <nsIMsgFolder> trash;
                 GetTrashFolder(getter_AddRefs(trash));
                 if (trash)
+                {
+                  // save off m_newMsgHdr because MoveIncorporatedMessage 
+                  // clears it by calling nsParseMailMessageState::Init
+                  nsCOMPtr<nsIMsgDBHdr> msgHdr = m_newMsgHdr;
                   MoveIncorporatedMessage(m_newMsgHdr, m_mailDB, trash,
                                                           nsnull, msgWindow);
+                  if (!m_downloadingToTempFile)
+                    m_mailDB->RemoveHeaderMdbRow(msgHdr);
+                }
               }
               break;
             case nsIMsgIncomingServer::markDupsRead:
               MarkFilteredMessageRead(m_newMsgHdr);
               break;
           }
           PRInt32 numNewMessages;
           m_downloadFolder->GetNumNewMessages(PR_FALSE, &numNewMessages);