[Xfce4-commits] <postler:master> Encode and split task: link properly

Christian Dywan noreply at xfce.org
Fri Aug 12 22:06:07 CEST 2011


Updating branch refs/heads/master
         to 3f6930e170af3cd0d529487d57b5ce202bf9090a (commit)
       from 4e59d43b2d2e0d44a312d8a000e5745f5108573a (commit)

commit 3f6930e170af3cd0d529487d57b5ce202bf9090a
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Aug 12 21:42:28 2011 +0200

    Encode and split task: link properly
    
    Using &postler; to avoid mixup with a character that
    is actually contained in the text.

 postler/postler-content.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 740c414..20af75c 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -743,7 +743,7 @@ public class Postler.Content : WebKit.WebView {
 
                 if (GTG.GTG.available) {
                     string task_desc = "%s \n\n @mail".printf (
-                        default_part.get_plain_text ());
+                        html_escape (default_part.get_plain_text ()));
                     var info = account_info ?? child.get_account (new Accounts ());
                     if (info != null)
                         task_desc += " @" + info.display_name;
@@ -751,7 +751,7 @@ public class Postler.Content : WebKit.WebView {
                         <span class="contact">%s</span>
                         """.printf (
                         linkify_icon (STOCK_TASK_DUE, _("New Task"),
-                            "task:%s:%s".printf (child.subject, task_desc))));
+                            "task:%s&postler;%s".printf (html_escape (child.subject), task_desc))));
                 }
 
                 string? sender_name = null;
@@ -1036,8 +1036,8 @@ public class Postler.Content : WebKit.WebView {
             return true;
         }
         else if (uri.has_prefix ("task:")) {
-            string[] parts = Soup.URI.decode (uri).split (":", 3);
-            new GTG.GTG ().open_new_task (parts[1], parts[2]);
+            string[] parts = Soup.URI.decode (uri).substring (5, -1).split ("&postler;", 2);
+            new GTG.GTG ().open_new_task (parts[0], parts[1]);
             return true;
         }
         else if (uri.has_prefix ("message-part:")) {


More information about the Xfce4-commits mailing list