From 444306f7cd50d5bd5fd1abf27bcb569478911ef9 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Thu, 30 Sep 2004 01:00:56 +0000 Subject: [PATCH] Treat XMPP addresses as case insensitive. SMACK-157 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2388 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/Roster.java | 8 ++++---- source/org/jivesoftware/smack/RosterEntry.java | 2 +- source/org/jivesoftware/smack/RosterGroup.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/org/jivesoftware/smack/Roster.java b/source/org/jivesoftware/smack/Roster.java index 815414832..037adba9d 100644 --- a/source/org/jivesoftware/smack/Roster.java +++ b/source/org/jivesoftware/smack/Roster.java @@ -399,7 +399,7 @@ public class Roster { synchronized (entries) { for (Iterator i=entries.iterator(); i.hasNext(); ) { RosterEntry entry = (RosterEntry)i.next(); - if (entry.getUser().equals(user)) { + if (entry.getUser().toLowerCase().equals(user.toLowerCase())) { return entry; } } @@ -423,7 +423,7 @@ public class Roster { synchronized (entries) { for (Iterator i=entries.iterator(); i.hasNext(); ) { RosterEntry entry = (RosterEntry)i.next(); - if (entry.getUser().equals(user)) { + if (entry.getUser().toLowerCase().equals(user.toLowerCase())) { return true; } } @@ -602,7 +602,7 @@ public class Roster { synchronized (entries) { for (Iterator i = entries.iterator(); i.hasNext();) { RosterEntry entry = (RosterEntry) i.next(); - if (entry.getUser().equals(key)) { + if (entry.getUser().toLowerCase().equals(key.toLowerCase())) { fireRosterPresenceEvent(key); } } @@ -621,7 +621,7 @@ public class Roster { synchronized (entries) { for (Iterator i=entries.iterator(); i.hasNext(); ) { RosterEntry entry = (RosterEntry)i.next(); - if (entry.getUser().equals(key)) { + if (entry.getUser().toLowerCase().equals(key.toLowerCase())) { fireRosterPresenceEvent(key); } } diff --git a/source/org/jivesoftware/smack/RosterEntry.java b/source/org/jivesoftware/smack/RosterEntry.java index 77b36134f..ad7631114 100644 --- a/source/org/jivesoftware/smack/RosterEntry.java +++ b/source/org/jivesoftware/smack/RosterEntry.java @@ -133,7 +133,7 @@ public class RosterEntry { return true; } if (object != null && object instanceof RosterEntry) { - return user.equals(((RosterEntry)object).getUser()); + return user.toLowerCase().equals(((RosterEntry)object).getUser().toLowerCase()); } else { return false; diff --git a/source/org/jivesoftware/smack/RosterGroup.java b/source/org/jivesoftware/smack/RosterGroup.java index cc616b604..f5bd049f2 100644 --- a/source/org/jivesoftware/smack/RosterGroup.java +++ b/source/org/jivesoftware/smack/RosterGroup.java @@ -153,7 +153,7 @@ public class RosterGroup { synchronized (entries) { for (Iterator i=entries.iterator(); i.hasNext(); ) { RosterEntry entry = (RosterEntry)i.next(); - if (entry.getUser().equals(user)) { + if (entry.getUser().toLowerCase().equals(user.toLowerCase())) { return entry; } } @@ -189,7 +189,7 @@ public class RosterGroup { synchronized (entries) { for (Iterator i=entries.iterator(); i.hasNext(); ) { RosterEntry entry = (RosterEntry)i.next(); - if (entry.getUser().equals(user)) { + if (entry.getUser().toLowerCase().equals(user.toLowerCase())) { return true; } }