Update of /cvsroot/mahogany/M/src/classes
In directory usw-pr-cvs1:/tmp/cvs-serv18437/src/classes

Modified Files:
        MessageView.cpp 
Log Message:
1. added MailFolder::SaveMEssageAsMBOX()
2. made resuming interrupted messages work


Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -b -u -2 -r1.75 -r1.76
--- MessageView.cpp     13 Mar 2002 22:30:03 -0000      1.75
+++ MessageView.cpp     19 Mar 2002 01:43:44 -0000      1.76
@@ -2371,45 +2371,15 @@
    else
    {
-      wxFile out(filename, wxFile::write);
-      if ( out.IsOpened() )
-      {
-         bool ok = true;
-
-         // when saving messages to a file we need to "From stuff" them to
-         // make them readable in a standard mail client (including this one)
+      bool ok;
          if ( mimepart->GetType().GetPrimary() == MimeType::MESSAGE )
          {
-            // standard prefix
-            String fromLine = "From ";
-
-            // find the from address
-            const char *p = strstr((const char *)content, "From: ");
-            if ( !p )
-            {
-               // this shouldn't normally happen, but if it does just make it
-               // up
-               wxLogDebug("Couldn't find from header in the message");
-
-               fromLine += "MAHOGANY-DUMMY-SENDER";
+         // saving the messages is special, we have a separate function for
+         // this as it's also done from elsewhere
+         ok = MailFolder::SaveMessageAsMBOX(filename, (const char *)content);
             }
-            else // take everything until the end of line
+      else // not a message
             {
-               // FIXME: we should extract just the address in angle brackets
-               //        instead of taking everything
-               while ( *p && *p != '\r' )
-               {
-                  fromLine += *p++;
-               }
-            }
-
-            fromLine += ' ';
-
-            // time stamp
-            time_t t;
-            time(&t);
-            fromLine += ctime(&t);
-
-            ok = out.Write(fromLine);
-         }
+         wxFile out(filename, wxFile::write);
+         ok = out.IsOpened();
 
          if ( ok )
@@ -2418,4 +2388,5 @@
             ok = out.Write(content, len) == len;
          }
+      }
 
          if ( ok )
@@ -2429,5 +2400,4 @@
 
             return true;
-         }
       }
    }


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to