From c68777c67c77f2b488adb70d087870d2fb4e793f Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Fri, 4 Jul 2014 16:22:19 +0200 Subject: [PATCH] made contact jids lower case --- src/eu/siacs/conversations/entities/Contact.java | 3 ++- src/eu/siacs/conversations/entities/Roster.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eu/siacs/conversations/entities/Contact.java b/src/eu/siacs/conversations/entities/Contact.java index a0047cdf3..50d7af8b0 100644 --- a/src/eu/siacs/conversations/entities/Contact.java +++ b/src/eu/siacs/conversations/entities/Contact.java @@ -1,6 +1,7 @@ package eu.siacs.conversations.entities; import java.util.HashSet; +import java.util.Locale; import java.util.Set; import org.json.JSONArray; @@ -78,7 +79,7 @@ public class Contact { } public String getJid() { - return this.jid; + return this.jid.toLowerCase(Locale.getDefault()); } public boolean match(String needle) { diff --git a/src/eu/siacs/conversations/entities/Roster.java b/src/eu/siacs/conversations/entities/Roster.java index c1e40dbcc..aa3286641 100644 --- a/src/eu/siacs/conversations/entities/Roster.java +++ b/src/eu/siacs/conversations/entities/Roster.java @@ -2,6 +2,7 @@ package eu.siacs.conversations.entities; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.concurrent.ConcurrentHashMap; public class Roster { @@ -19,7 +20,7 @@ public class Roster { } public Contact getContact(String jid) { - String cleanJid = jid.split("/")[0]; + String cleanJid = jid.split("/")[0].toLowerCase(Locale.getDefault()); if (contacts.containsKey(cleanJid)) { return contacts.get(cleanJid); } else {