Bug 540778 - Please remove "deliver mode" printf statement from nsMsgCompose::_SendMsg; Remove some more debug statements r=bienvenu
authorLudovic Hirlimann <ludovic@mozilla.com>
Fri, 13 May 2011 14:52:51 +0100
changeset 7767 330a00287b90a67ae44cacd8391fa533d6bc6baa
parent 7766 773821ef3799b4621f6e5c4491f7844f78dc908d
child 7768 ffc7c66a1797dfe188c902c482dee3ef5155b9ca
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs540778
Bug 540778 - Please remove "deliver mode" printf statement from nsMsgCompose::_SendMsg; Remove some more debug statements r=bienvenu
mailnews/compose/src/nsMsgCompose.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -3071,22 +3071,17 @@ nsMsgCompose::QuoteMessage(const char *m
 
   // Create the consumer output stream.. this will receive all the HTML from libmime
   mQuoteStreamListener =
     new QuotingOutputStreamListener(msgURI, msgHdr, PR_FALSE, !mHtmlToQuote.IsEmpty(), m_identity,
                                     m_compFields->GetCharacterSet(), mCharsetOverride, PR_FALSE,
                                     mHtmlToQuote);
 
   if (!mQuoteStreamListener)
-  {
-#ifdef NS_DEBUG
-    printf("Failed to create mQuoteStreamListener\n");
-#endif
     return NS_ERROR_FAILURE;
-  }
   NS_ADDREF(mQuoteStreamListener);
 
   mQuoteStreamListener->SetComposeObj(this);
 
   rv = mQuote->QuoteMessage(msgURI, PR_FALSE, mQuoteStreamListener,
                             mCharsetOverride ? m_compFields->GetCharacterSet() : "", PR_FALSE);
   return rv;
 }
@@ -3115,22 +3110,17 @@ nsMsgCompose::QuoteOriginalMessage(const
 
   // Create the consumer output stream.. this will receive all the HTML from libmime
   mQuoteStreamListener =
     new QuotingOutputStreamListener(originalMsgURI, originalMsgHdr, what != 1,
                                     !bAutoQuote || !mHtmlToQuote.IsEmpty(), m_identity,
                                     mQuoteCharset.get(), mCharsetOverride, PR_TRUE, mHtmlToQuote);
 
   if (!mQuoteStreamListener)
-  {
-#ifdef NS_DEBUG
-    printf("Failed to create mQuoteStreamListener\n");
-#endif
     return NS_ERROR_FAILURE;
-  }
   NS_ADDREF(mQuoteStreamListener);
 
   mQuoteStreamListener->SetComposeObj(this);
 
   rv = mQuote->QuoteMessage(originalMsgURI, what != 1, mQuoteStreamListener,
                             mCharsetOverride ? mQuoteCharset.get() : "", !bAutoQuote);
   return rv;
 }
@@ -3504,19 +3494,16 @@ nsresult nsMsgComposeSendListener::OnSto
   nsCOMPtr<nsIMsgCompose> msgCompose = do_QueryReferent(mWeakComposeObj, &rv);
   if (msgCompose)
   {
     nsCOMPtr<nsIMsgProgress> progress;
     msgCompose->GetProgress(getter_AddRefs(progress));
 
     if (NS_SUCCEEDED(aStatus))
     {
-#ifdef NS_DEBUG
-      printf("nsMsgComposeSendListener: Success on the message send operation!\n");
-#endif
       nsCOMPtr<nsIMsgCompFields> compFields;
       msgCompose->GetCompFields(getter_AddRefs(compFields));
 
       // only process the reply flags if we successfully sent the message
       msgCompose->ProcessReplyFlags();
       
       // See if there is a composer window
       PRBool hasDomWindow = PR_TRUE;
@@ -3560,19 +3547,16 @@ nsresult nsMsgComposeSendListener::OnSto
       // Remove the current draft msg when sending draft is done.
       PRBool deleteDraft;
       msgCompose->GetDeleteDraft(&deleteDraft);
       if (deleteDraft)
         RemoveCurrentDraftMessage(msgCompose, PR_FALSE);
     }
     else
     {
-#ifdef NS_DEBUG
-      printf("nsMsgComposeSendListener: the message send operation failed!\n");
-#endif
       msgCompose->NotifyStateListeners(nsIMsgComposeNotificationType::ComposeProcessDone, aStatus);
       if (progress)
       {
         progress->CloseProgressDialog(PR_TRUE);
         progress->UnregisterListener(this);
       }
     }
 
@@ -3595,29 +3579,22 @@ nsMsgComposeSendListener::OnGetDraftFold
 
   return NS_OK;
 }
 
 
 nsresult
 nsMsgComposeSendListener::OnStartCopy()
 {
-#ifdef NS_DEBUG
-  printf("nsMsgComposeSendListener::OnStartCopy()\n");
-#endif
-
   return NS_OK;
 }
 
 nsresult
 nsMsgComposeSendListener::OnProgress(PRUint32 aProgress, PRUint32 aProgressMax)
 {
-#ifdef NS_DEBUG
-  printf("nsMsgComposeSendListener::OnProgress() - COPY\n");
-#endif
   return NS_OK;
 }
 
 nsresult
 nsMsgComposeSendListener::OnStopCopy(nsresult aStatus)
 {
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMsgCompose> msgCompose = do_QueryReferent(mWeakComposeObj, &rv);
@@ -3642,19 +3619,16 @@ nsMsgComposeSendListener::OnStopCopy(nsr
       progress->UnregisterListener(this);
       progress->CloseProgressDialog(NS_FAILED(aStatus));
     }
 
     msgCompose->NotifyStateListeners(nsIMsgComposeNotificationType::ComposeProcessDone, aStatus);
 
     if (NS_SUCCEEDED(aStatus))
     {
-#ifdef NS_DEBUG
-      printf("nsMsgComposeSendListener: Success on the message copy operation!\n");
-#endif
       // We should only close the window if we are done. Things like templates
       // and drafts aren't done so their windows should stay open
       if (mDeliverMode == nsIMsgSend::nsMsgSaveAsDraft ||
           mDeliverMode == nsIMsgSend::nsMsgSaveAsTemplate)
       {
         msgCompose->NotifyStateListeners(nsIMsgComposeNotificationType::SaveInFolderDone, aStatus);
         // Remove the current draft msg when saving as draft/template is done.
         msgCompose->SetDeleteDraft(PR_TRUE);
@@ -3667,20 +3641,16 @@ nsMsgComposeSendListener::OnStopCopy(nsr
             mDeliverMode == nsIMsgSend::nsMsgDeliverBackground)
         {
           msgCompose->SetDeleteDraft(PR_TRUE);
           RemoveCurrentDraftMessage(msgCompose, PR_TRUE);
         }
         msgCompose->CloseWindow(PR_TRUE);
       }
     }
-#ifdef NS_DEBUG
-    else
-      printf("nsMsgComposeSendListener: the message copy operation failed!\n");
-#endif
   }
 
   return rv;
 }
 
 nsresult
 nsMsgComposeSendListener::GetMsgFolder(nsIMsgCompose *compObj, nsIMsgFolder **msgFolder)
 {