1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-10-02 09:07:08 +02:00

Switch to the new I18n class and format cleanup of all classes

This commit is contained in:
snowleo
2011-11-21 02:55:26 +01:00
parent 19f5a2340d
commit 220d68f375
207 changed files with 1247 additions and 1306 deletions

View File

@@ -3,10 +3,7 @@ package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IConf;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class UserManager implements IConf
@@ -24,26 +21,27 @@ public class UserManager implements IConf
public final boolean isSpy(final String username)
{
return users.getBoolean(username.toLowerCase() + "." + SPY, false);
return users.getBoolean(username.toLowerCase(Locale.ENGLISH) + "." + SPY, false);
}
public void setSpy(final String username, final boolean spy)
{
setUser(username.toLowerCase(), getAddress(username), spy);
setUser(username.toLowerCase(Locale.ENGLISH), getAddress(username), spy);
}
public final String getAddress(final String username)
{
return users.getString(username.toLowerCase() + "." + ADDRESS, null);
return users.getString(username.toLowerCase(Locale.ENGLISH) + "." + 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)) {
if (address != null && search.equalsIgnoreCase(address))
{
return username;
}
}
@@ -52,7 +50,7 @@ public class UserManager implements IConf
public void setAddress(final String username, final String address)
{
setUser(username.toLowerCase(), address, isSpy(username));
setUser(username.toLowerCase(Locale.ENGLISH), address, isSpy(username));
}
public List<String> getSpyUsers()