diff options
Diffstat (limited to 'EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java')
-rw-r--r-- | EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java index bce2277d5..6a2a6e80a 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java @@ -36,6 +36,19 @@ public class UserManager implements IConf { return users.getString(username.toLowerCase() + "." + ADDRESS, null); } + + public final String getUserByAddress(final String search) + { + final List<String> usernames = users.getKeys(null); + for (String username : usernames) + { + final String address = users.getString(username + "." + ADDRESS, null); + if (address != null && search.equalsIgnoreCase(address)) { + return username; + } + } + return search; + } public void setAddress(final String username, final String address) { |