[folks] Bug 649088 — Combining contacts doesn't work with german Umlauts



commit 58cc29fd89f7c81b6d5f42cbf5021657bcae7eda
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 008e8f3..88c9128 100644
--- 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)
diff --git a/folks/im-details.vala b/folks/im-details.vala
index 3069c43..9a24c7a 100644
--- a/folks/im-details.vala
+++ b/folks/im-details.vala
@@ -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 ();
     }
 }



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