[folks/folks-0-4] Bug 649088 — Combining contacts doesn't work with german Umlauts



commit 58f464fcbcb554680b6e81f38cd1acc300cb8add
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sun May 1 22:12:47 2011 +0100

    Bug 649088 â?? Combining contacts doesn't work with german Umlauts
    
    Fix normalisation of Jabber IDs to use the correct Unicode normalisation mode
    as described in RFC 3920, §A.4. Closes: bgo#649088

 NEWS                  |    1 +
 folks/im-details.vala |   14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index afb3230..9705249 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Bugs fixed:
 * Bug 647562 â?? Don't crash on duplicate group channels
 * Bug 647121 â?? Crash in individual_store_contact_sort at
   empathy-individual-store.c line 1387
+* Bug 649088 â?? Combining contacts doesn't work with german Umlauts
 
 Overview of changes from libfolks 0.4.1 to libfolks 0.4.2
 =========================================================
diff --git a/folks/im-details.vala b/folks/im-details.vala
index e7522a0..8583f86 100644
--- a/folks/im-details.vala
+++ b/folks/im-details.vala
@@ -80,16 +80,14 @@ public interface Folks.ImDetails : Object
   public static string normalise_im_address (string im_address, string protocol)
       throws Folks.ImDetailsError
     {
-      string normalised;
-
       if (protocol == "aim" || protocol == "myspace")
         {
-          normalised = im_address.replace (" ", "").down ();
+          return im_address.replace (" ", "").down ().normalize ();
         }
       else if (protocol == "irc" || protocol == "yahoo" ||
           protocol == "yahoojp" || protocol == "groupwise")
         {
-          normalised = im_address.down ();
+          return im_address.down ().normalize ();
         }
       else if (protocol == "jabber")
         {
@@ -145,6 +143,8 @@ public interface Folks.ImDetails : Object
             node = node.down ();
 
           /* Build a new JID */
+          string normalised = null;
+
           if (node != null && resource != null)
             {
               normalised = "%s %s/%s".printf (node, domain, resource);
@@ -164,13 +164,13 @@ public interface Folks.ImDetails : Object
                   _("The IM address '%s' could not be understood."),
                   im_address);
             }
+
+          return normalised.normalize (-1, NormalizeMode.NFKC);
         }
       else
         {
           /* Fallback */
-          normalised = im_address;
+          return im_address.normalize ();
         }
-
-      return normalised.normalize ();
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]