Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23263/src/classes

Modified Files:
        MessageView.cpp 
Log Message:
a lot of changes to make it possible to fully support PGP-MIME messages
(although not quite yet):

1. added MimePartVirtual class which can be created from raw text
2. use it instead of (not existing any longer) MimePartRaw in UUDecode.cpp
3. added MessageView::AddVirtualMimePart() which allows to attach a virtual
   MIME part to the viewer, this replaces ugly hack used by UUDecode.cpp
4. added MimePartCCBase: common base for MimePartCC and MimePartVirtual
5. MimePartCC implementation is now in MimePartCC.cpp, not MessageCC.cpp
6. added CclientParseMessage() function, fixed CR LF confusion in MessageCC
   ctor from text


Index: MessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/MessageView.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -b -u -2 -r1.152 -r1.153
--- MessageView.cpp     12 Jul 2004 21:10:53 -0000      1.152
+++ MessageView.cpp     13 Jul 2004 21:58:41 -0000      1.153
@@ -55,4 +55,5 @@
 #include "MessageCC.h"
 #include "MimePartCC.h"
+#include "MimePartVirtual.h"
 #include "FolderView.h"
 #include "ASMailFolder.h"
@@ -86,5 +87,5 @@
 #endif
 
-class MPersMsgBox;
+M_LIST_OWN(VirtualMimePartsList, MimePart);
 
 // ----------------------------------------------------------------------------
@@ -566,4 +567,5 @@
    m_viewer = NULL;
    m_filters = NULL;
+   m_virtualMimeParts = NULL;
 
    m_uid = UID_ILLEGAL;
@@ -578,4 +580,6 @@
 MessageView::~MessageView()
 {
+   delete m_virtualMimeParts;
+
    UnregisterForEvents();
 
@@ -2132,12 +2136,8 @@
                pgpInfo = new PGPInfoGoodMsg(this);
 
-               // TODO: process the mime part that's just been decrypted
-               // the problem is: how to create a MimePart instance from its full 
text?
-               // The following code raises an assert because the MessageCC is
-               // not associated to a folder...
-               {
-                  MessageCC* decryptedMessage = 
MessageCC::Create(wxConvertWX2MB(decryptedData));
-                  const MimePart* decryptedMimePart = 
decryptedMessage->GetTopMimePart();
-                  ProcessPart(decryptedMimePart);
+               {
+                  MimePartVirtual *mpv = new MimePartVirtual(decryptedData);
+                  AddVirtualMimePart(mpv);
+                  ProcessPart(mpv);
                }
                break;
@@ -2146,4 +2146,5 @@
                wxLogError(_("Decrypting the PGP message failed."));
                // fall through
+
             // if the user cancelled decryption, don't complain about it
             case MCryptoEngine::OPERATION_CANCELED_BY_USER:
@@ -2198,10 +2199,8 @@
       ProcessSignedMultiPart(mimepart);
    }
-#if 0
    else if ( subtype == _T("ENCRYPTED") )
    {
       ProcessEncryptedMultiPart(mimepart);
    }
-#endif
    else // process all unknown as MIXED (according to the RFC 2047)
    {
@@ -2252,7 +2251,18 @@
 
 void
-MessageView::Update(void)
+MessageView::AddVirtualMimePart(MimePart *mimepart)
+{
+   if ( !m_virtualMimeParts )
+      m_virtualMimeParts = new VirtualMimePartsList;
+
+   m_virtualMimeParts->push_back(mimepart);
+}
+
+void
+MessageView::Update()
 {
    m_viewer->Clear();
+   if ( m_virtualMimeParts )
+      m_virtualMimeParts->clear();
 
    if( !m_mailMessage )



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to