Bug 649088 — Combining contacts doesn't work with german Umlauts
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Sun, 1 May 2011 21:12:47 +0000 (22:12 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Thu, 12 May 2011 20:53:18 +0000 (21:53 +0100)
Fix normalisation of Jabber IDs to use the correct Unicode normalisation mode
as described in RFC 3920, §A.4. Closes: bgo#649088

NEWS
folks/im-details.vala

diff --git a/NEWS b/NEWS
index 008e8f3..88c9128 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Bugs fixed:
 * Bug 645186 — Make sure all connect() calls have appropriate disconnect() calls
 * Bug 648533 — Add runtime debug signalling
 * Bug 649790 — Vala uses the wrong includes
+* Bug 649088 — Combining contacts doesn't work with german Umlauts
 
 API changes:
 * LinkedHashSet.list_iterator() is now disallowed (causes an assertion failure)
index 3069c43..9a24c7a 100644 (file)
@@ -79,16 +79,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")
         {
@@ -144,6 +142,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);
@@ -163,13 +163,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 ();
     }
 }