[Xfce4-commits] <postler:master> Assemble convo message from parts including attachments

Christian Dywan noreply at xfce.org
Tue Jun 28 05:10:01 CEST 2011


Updating branch refs/heads/master
         to ff5d85a40692c6d74deda5757cb01a3a801fdfce (commit)
       from 7bbee32c3c1a22bf42af372a070cbba2cba9593d (commit)

commit ff5d85a40692c6d74deda5757cb01a3a801fdfce
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Jun 26 19:14:03 2011 +0200

    Assemble convo message from parts including attachments
    
    So attachments are available as they are with regular messages.

 postler/postler-content.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 89b2904..f0a1dc6 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -643,6 +643,7 @@ public class Postler.Content : WebKit.WebView {
                 content_stylesheet = "";
             }
 
+            message_parts = new GLib.List<MessagePart> ();
             var body_chunk = new StringBuilder ();
             foreach (var child in thread) {
                 MessagePart? html_part = null;
@@ -663,17 +664,18 @@ public class Postler.Content : WebKit.WebView {
                 }
 
                 var reply_chunk = new StringBuilder ();
+                message_parts.append (html_part ?? (text_part ?? child.parts.nth_data (0)));
                 if (html_part != null)
                     reply_chunk.append (html_part.body.str);
-                else if (text_part != null) {
+                else if (text_part != null)
                     reply_chunk.append (render_plain_text (text_part.body.str, child.project));
-                }
                 else
-                    reply_chunk.append (text_part.body.str);
+                    reply_chunk.append (child.parts.nth_data (0).body.str);
 
                 foreach (var attachment_part in child.parts) {
                     if (attachment_part != html_part && attachment_part != text_part
-                     && !attachment_part.mime_type.has_prefix ("multipart/"))
+                     && !attachment_part.mime_type.has_prefix ("multipart/")) {
+                        message_parts.append (attachment_part);
                         reply_chunk.append_printf ("""<p>
                             <b>%s</b>
                             <a href="message-part:open:%d">%s</a>
@@ -684,6 +686,7 @@ public class Postler.Content : WebKit.WebView {
                             _("Open file"),
                             child.parts.position (child.parts.find (attachment_part)),
                             _("Save As..."));
+                    }
                 }
 
                 string reply_markup;
@@ -695,7 +698,6 @@ public class Postler.Content : WebKit.WebView {
             }
 
             message = thread.nth_data (0);
-            message_parts = message.parts.copy ();
             last_location = message.get_path ();
             subject = message.subject;
             string arguments = "?subject=Re: " + subject;



More information about the Xfce4-commits mailing list