From d711caee38f6f34dec9085217df1f32cd6c0e46d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 12 Aug 2015 10:16:48 +0200 Subject: [PATCH] Use EntityFullJid in MUC's getOccupant(Presence) API instead of String, which will always return null if used with ocupantsMap.get(String), because String.equals(Object) is only true if Object is also instanceof String. Thanks to Adnan Elezovic for reporting. --- .../java/org/jivesoftware/smackx/muc/MultiUserChat.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index a6d22a1c7..049a6b6b6 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -1634,7 +1634,7 @@ public class MultiUserChat { * @return the occupant's current presence, or null if the user is unavailable * or if no presence information is available. */ - public Presence getOccupantPresence(String user) { + public Presence getOccupantPresence(EntityFullJid user) { return occupantsMap.get(user); } @@ -1647,8 +1647,8 @@ public class MultiUserChat { * be: roomName@service/nickname (e.g. darkcave@macbeth.shakespeare.lit/thirdwitch). * @return the Occupant or null if the user is unavailable (i.e. not in the room). */ - public Occupant getOccupant(String user) { - Presence presence = occupantsMap.get(user); + public Occupant getOccupant(EntityFullJid user) { + Presence presence = getOccupantPresence(user); if (presence != null) { return new Occupant(presence); }