Bug 452014 cleanup of nsMailboxProtocol::LoadUrl. r/sr=bienvenu
authorHiroyuki Ikezoe <poincare@ikezoe.net>
Tue, 26 Aug 2008 08:23:15 +0100
changeset 194 67fbeb41e45c759fd73c7187837762b7cfaed993
parent 193 cc43c37b45663c1bb77832fba2225b38a67a34ec
child 195 e3663bfb9e164f3a910d9dd364ac437219de637c
push idunknown
push userunknown
push dateunknown
bugs452014
Bug 452014 cleanup of nsMailboxProtocol::LoadUrl. r/sr=bienvenu
mailnews/local/src/nsMailboxProtocol.cpp
--- a/mailnews/local/src/nsMailboxProtocol.cpp
+++ b/mailnews/local/src/nsMailboxProtocol.cpp
@@ -503,41 +503,36 @@ nsresult nsMailboxProtocol::LoadUrl(nsIU
           break;
         case nsIMailboxUrl::ActionSaveMessageToDisk:
           // ohhh, display message already writes a msg to disk (as part of a hack)
           // so we can piggy back off of that!! We just need to change m_tempMessageFile
           // to be the name of our save message to disk file. Since save message to disk
           // urls are run without a docshell to display the msg into, we won't be trying
           // to display the message after we write it to disk...
           {
-            nsCOMPtr<nsIMsgMessageUrl> msgUri = do_QueryInterface(m_runningUrl);
-            msgUri->GetMessageFile(getter_AddRefs(m_tempMessageFile));
-            NS_NewLocalFileOutputStream(getter_AddRefs(m_msgFileOutputStream), m_tempMessageFile, -1, 00600);
-          }
-        case nsIMailboxUrl::ActionCopyMessage:
-        case nsIMailboxUrl::ActionMoveMessage:
-        case nsIMailboxUrl::ActionFetchMessage:
-          if (m_mailboxAction == nsIMailboxUrl::ActionSaveMessageToDisk) 
-          {
-            nsCOMPtr<nsIMsgMessageUrl> messageUrl = do_QueryInterface(aURL, &rv);
+            nsCOMPtr<nsIMsgMessageUrl> messageUrl = do_QueryInterface(m_runningUrl, &rv);
             if (NS_SUCCEEDED(rv))
             {
+              messageUrl->GetMessageFile(getter_AddRefs(m_tempMessageFile));
+              NS_NewLocalFileOutputStream(getter_AddRefs(m_msgFileOutputStream), m_tempMessageFile, -1, 00600);
+
               PRBool addDummyEnvelope = PR_FALSE;
               messageUrl->GetAddDummyEnvelope(&addDummyEnvelope);
               if (addDummyEnvelope)
                 SetFlag(MAILBOX_MSG_PARSE_FIRST_LINE);
               else
                 ClearFlag(MAILBOX_MSG_PARSE_FIRST_LINE);
             }
           }
-          else
-          {
-            ClearFlag(MAILBOX_MSG_PARSE_FIRST_LINE);
-          }
-          
+          m_nextState = MAILBOX_READ_MESSAGE;
+          break;
+        case nsIMailboxUrl::ActionCopyMessage:
+        case nsIMailboxUrl::ActionMoveMessage:
+        case nsIMailboxUrl::ActionFetchMessage:
+          ClearFlag(MAILBOX_MSG_PARSE_FIRST_LINE);
           m_nextState = MAILBOX_READ_MESSAGE;
           break;
         case nsIMailboxUrl::ActionFetchPart:
             m_nextState = MAILBOX_READ_MESSAGE;
             break;
         default:
           break;
         }