[geary] Fix crash in `Geary.RFC822.Message.without_bcc`



commit e1295d2aa714af2781cc3dbc55779aac0db488e3
Author: Michael Gratton <mike vee net>
Date:   Sat Dec 21 18:23:40 2019 +1100

    Fix crash in `Geary.RFC822.Message.without_bcc`
    
    Second GMime workaround in that method no longer needed, and was causing
    a crash, so remove it.

 src/engine/rfc822/rfc822-message.vala | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index e14093e3..df65b932 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -388,21 +388,8 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
         // create the new object.  Kinda sucks, but our hands are tied.
         this.from_buffer(email.message_to_memory_buffer(false, false));
 
-        // GMime also drops the ball for the *new* message.  When it comes out of the GMime
-        // Parser, its "mime part" somehow isn't realizing it has a Content-Type header
-        // already, so whenever you manipulate the headers, it adds a duplicate one.  This
-        // odd looking hack ensures that any header manipulation is done while the "mime
-        // part" is an empty object, and when we re-set the "mime part", there's only the
-        // one Content-Type header.  In other words, this hack prevents the duplicate
-        // header, somehow.
-        GMime.Object original_mime_part = message.get_mime_part();
-        GMime.Message empty = new GMime.Message(true);
-        message.set_mime_part(empty.get_mime_part());
-
-        message.remove_header(HEADER_BCC);
-        bcc = null;
-
-        message.set_mime_part(original_mime_part);
+        this.message.remove_header(HEADER_BCC);
+        this.bcc = null;
     }
 
     private GMime.Object? coalesce_related(Gee.List<GMime.Object> parts,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]