[Xfce4-commits] <postler:master> Rework header generate in composer

Christian Dywan noreply at xfce.org
Wed Mar 16 06:30:01 CET 2011


Updating branch refs/heads/master
         to 21ebc1091d6e9edb28e1ed96bd51235b12efcd10 (commit)
       from 86b873ef034494da8acd2eae55071f1f8ae6e242 (commit)

commit 21ebc1091d6e9edb28e1ed96bd51235b12efcd10
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Mar 15 23:48:14 2011 +0100

    Rework header generate in composer
    
    Fixes: https://bugs.launchpad.net/postler/+bug/733572

 postler/postler-composer.vala |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index 0fc31b6..b324a54 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -188,22 +188,21 @@ public class Postler.Composer : Gtk.Window {
         var now = new Soup.Date.from_now (0);
         string copy = entry_copy.text;
         string blind_copy = entry_blind_copy.text;
-        string header = ("From: %s\nTo: %s\n%s%s%s"
-            + "MIME-Version: 1.0\n"
-            + "Subject: %s\n"
-            + "Date: %s\n"
-            + "X-Mailer: %s\n"
-            + (info.reply != null ? "Reply-To: " + info.reply + "\n" : "")
-            + (info.organization != null ?
-               "Organization: " + info.organization + "\n" : "")).printf (
-              sender,
-              entry_to.text,
-              copy != "" ? "CC: " : "", copy != "" ? copy + "\n" : "",
-              blind_copy != "" ? "BCC: " : "", blind_copy != "" ? blind_copy + "\n" : "",
-              entry_subject.text,
-              now.to_string (Soup.DateFormat.RFC2822),
-              Postler.App.get_user_agent ());
-
+        string header = ("From: %s\nTo: %s\nSubject: %s\n"
+                       + "Date: %s\nX-Mailer: %s\nMIME-Version: 1.0\n").printf (
+                         sender,
+                         entry_to.text,
+                         entry_subject.text,
+                         now.to_string (Soup.DateFormat.RFC2822),
+                         Postler.App.get_user_agent ());
+        if (info.reply != null)
+            header += "Reply-To: " + info.reply + "\n";
+        if (info.organization != null)
+            header += "Organization: " + info.organization + "\n";
+        if (copy != "")
+            header += "CC: " + copy + "\n";
+        if (blind_copy != "")
+            header += "BCC: " + blind_copy + "\n";
         if ((actions.get_action ("MarkImportant") as Gtk.ToggleAction).active)
             header += "X-Priority: 1\n";
 



More information about the Xfce4-commits mailing list