[Xfce4-commits] <postler:master> Recognise split fields by tabs and spaces

Christian Dywan noreply at xfce.org
Fri Jan 21 17:28:04 CET 2011


Updating branch refs/heads/master
         to 06c430be07c11f6fdc592b135fde66afff3b4dbc (commit)
       from 018f346e0628170d708fcc4901c12af058c2ddce (commit)

commit 06c430be07c11f6fdc592b135fde66afff3b4dbc
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Jan 20 20:18:13 2011 +0100

    Recognise split fields by tabs and spaces

 postler/postler-content.vala  |   19 +++++++++----------
 postler/postler-messages.vala |    5 +++++
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index b3d36f2..1fa7a3f 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -627,16 +627,10 @@ public class Postler.Content : WebKit.WebView {
             while ((line = stream.read_line (null, null)) != null) {
                 if (line == "")
                     break;
-                if (line.has_suffix (",")
-                 || line.has_suffix (";")
-                 || line.has_suffix ("; ")) {
-                    previous_line += line;
-                    continue;
-                }
-                if (previous_line != "") {
-                    line = previous_line + line;
-                    previous_line = "";
-                }
+                if (line[0] == '\t' || line[0] == ' ')
+                    line = previous_line + " " + line.chug ();
+                previous_line = line;
+
                 parts = line.split (":", 2);
                 if (parts == null || parts[0] == null)
                     continue;
@@ -763,6 +757,7 @@ public class Postler.Content : WebKit.WebView {
             bool in_signature = false;
             string inner_boundary = "";
             string line;
+            string previous_line = "";
             while ((line = stream.read_line (null, null)) != null) {
                 if (multipart > 0) {
                     if (line.has_prefix ("--")) {
@@ -789,6 +784,10 @@ public class Postler.Content : WebKit.WebView {
                             continue;
                         }
 
+                        if (line[0] == '\t' || line[0] == ' ')
+                        line = previous_line + " " + line.chug ();
+                        previous_line = line;
+
                         /* Content-Type can span over multiple lines */
                         string[] parts;
                         if (message_part.mime_type.has_suffix (";"))
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index e76f085..10446a4 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -590,9 +590,14 @@ public class Postler.Messages : Gtk.TreeView {
         try {
             var stream = new DataInputStream (contents.read (null));
             string line;
+            string previous_line = "";
             while ((line = stream.read_line (null, null)) != null) {
                 if (line == "")
                     break;
+                if (line[0] == '\t' || line[0] == ' ')
+                    line = previous_line + " " + line.chug ();
+                previous_line = line;
+
                 string[] parts = line.split (":", 2);
                 if (parts == null || parts[0] == null)
                     continue;



More information about the Xfce4-commits mailing list