diff --git a/mailnews/base/src/nsMsgCopyService.cpp b/mailnews/base/src/nsMsgCopyService.cpp index ab9b25e3e584..af9057c2ae84 100644 --- a/mailnews/base/src/nsMsgCopyService.cpp +++ b/mailnews/base/src/nsMsgCopyService.cpp @@ -287,11 +287,17 @@ nsMsgCopyService::DoNextCopy() } else if (copyRequest->m_requestType == nsCopyFoldersType ) { - copySource->m_processed = PR_TRUE; + copySource->m_processed = PR_TRUE; rv = copyRequest->m_dstFolder->CopyFolder (copySource->m_msgFolder, copyRequest->m_isMoveOrDraftOrTemplate, copyRequest->m_msgWindow, copyRequest->m_listener); + // If it's a copy folder operation and the destination + // folder already exists, CopyFolder() returns an error w/o sending + // a completion notification, so clear it here. + if (NS_FAILED(rv)) + ClearRequest(copyRequest, rv); + } else if (copyRequest->m_requestType == nsCopyFileMessageType) { @@ -318,14 +324,6 @@ nsMsgCopyService::DoNextCopy() } } } - // Don't clear copy request in failure case - notify completion should do that. - // Hmm, this is not true in case it's a copy folder opeation and the destination - // folder already exists. In this case CopyFolder() returns an error and there - // won't be completion notification at all and the request will stay in the - // queue forever. - if (NS_FAILED(rv)) - ClearRequest(copyRequest, rv); - return rv; }