[Xfce4-commits] <postler:master> Handle selected account address more carefully

Christian Dywan noreply at xfce.org
Sat Jan 22 06:48:03 CET 2011


Updating branch refs/heads/master
         to 55cec9d4f1dc62803ac106fcaa200d938467d217 (commit)
       from 59d3c9a172e789af20730f7b86c48dcbf63b9eea (commit)

commit 55cec9d4f1dc62803ac106fcaa200d938467d217
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Jan 22 03:26:55 2011 +0100

    Handle selected account address more carefully

 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 3943b73..46a93b1 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -583,6 +583,10 @@ public class Postler.Content : WebKit.WebView {
         load_string (body.str, mime_type, charset, "about:blank");
     }
 
+    string selected_address () {
+        return selected_account != null ? selected_account.address : "";
+    }
+
     public string? choose_from () {
         /* See if recipient is among the accounts, otherwise pick a fallback */
         if (recipient != null) {
@@ -592,9 +596,7 @@ public class Postler.Content : WebKit.WebView {
                 if (info.address != null && from in info.address)
                     return from;
         }
-        if (selected_account != null && selected_account.address != null)
-            return selected_account.address.split (",")[0];
-        return null;
+        return selected_address ().split (",")[0];
     }
 
     void parse_message (string location) throws GLib.FileError {
@@ -709,8 +711,8 @@ public class Postler.Content : WebKit.WebView {
             sender = linkify_address (from, arguments);
             if (recipient != "") {
                 /* Show recipient only if isn't unique */
-                if ("," in recipient || "," in selected_account.address
-                                     || !recipient.contains (selected_account.address))
+                if ("," in recipient || "," in selected_address ()
+                                     || !recipient.contains (selected_address ()))
                     recipient = linkify_address (recipient, arguments);
                 else
                     recipient = "";



More information about the Xfce4-commits mailing list