[Xfce4-commits] <postler:master> Strip mailto on the command line if given

Christian Dywan noreply at xfce.org
Sat Dec 4 04:18:02 CET 2010


Updating branch refs/heads/master
         to bfea0ee2ef89aac9647082a17cab2b7513d9ba2f (commit)
       from 6707d355d897d6d252a509aafae84b902500dc48 (commit)

commit bfea0ee2ef89aac9647082a17cab2b7513d9ba2f
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Dec 4 01:52:06 2010 +0100

    Strip mailto on the command line if given
    
    Fixes: https://bugs.launchpad.net/postler/+bug/684582

 postler/postler-reader.vala |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/postler/postler-reader.vala b/postler/postler-reader.vala
index cab704e..4eb228b 100644
--- a/postler/postler-reader.vala
+++ b/postler/postler-reader.vala
@@ -50,7 +50,8 @@ public class Postler.Reader {
 
         /* Render mail files by default */
         if (module == null && filenames != null && filenames[0] != null) {
-            if (filenames[0].str ("@") != null)
+            if (filenames[0].has_prefix ("mailto:")
+             || filenames[0].str ("@") != null)
                 module = "compose";
             else
                 module = "content";
@@ -86,7 +87,13 @@ public class Postler.Reader {
                 instance = new Postler.Composer ();
                 if (filenames != null && filenames[0] != null) {
                     Postler.Composer composer = (Postler.Composer)instance;
-                    string[] fields = filenames[0].split_set ("?&");
+                    string mailto;
+                    /* mailto: may or may not be stripped by the calling app */
+                    if (filenames[0].has_prefix ("mailto:"))
+                        mailto = filenames[0].substring (7, -1);
+                    else
+                        mailto = filenames[0];
+                    string[] fields = mailto.split_set ("?&");
                     foreach (var field in fields) {
                         string[] pieces = field.split ("=");
                         bool success;



More information about the Xfce4-commits mailing list