Commit a25c2e0b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Removed superfluos #toLowercase. JM-539

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3352 b35dd754-fafc-0310-a699-88a17e54d16e
parent c535348c
......@@ -523,7 +523,7 @@ public class SessionManager extends BasicModule {
*/
public boolean addSession(ClientSession session) {
boolean success = false;
String username = session.getAddress().getNode().toLowerCase();
String username = session.getAddress().getNode();
SessionMap resources = null;
synchronized(username.intern()) {
......@@ -684,7 +684,7 @@ public class SessionManager extends BasicModule {
// Do nothing if the session belongs to an anonymous user
return;
}
String username = sender.getNode().toLowerCase();
String username = sender.getNode();
synchronized (username.intern()) {
SessionMap resources = sessions.get(username);
if (resources == null) {
......@@ -728,7 +728,6 @@ public class SessionManager extends BasicModule {
}
}
else {
username = username.toLowerCase();
synchronized (username.intern()) {
SessionMap sessionMap = sessions.get(username);
if (sessionMap != null) {
......@@ -818,10 +817,10 @@ public class SessionManager extends BasicModule {
if (serverName == null || !serverName.equals(domain)) {
return null;
}
// Build a JID represention based on the given JID data
StringBuilder buf = new StringBuilder(40);
if (username != null) {
username = username.toLowerCase();
buf.append(username).append("@");
}
buf.append(domain);
......@@ -863,7 +862,6 @@ public class SessionManager extends BasicModule {
session = anonymousSessions.get(resource);
}
else {
username = username.toLowerCase();
synchronized (username.intern()) {
SessionMap sessionMap = sessions.get(username);
if (sessionMap != null) {
......@@ -1218,7 +1216,7 @@ public class SessionManager extends BasicModule {
else {
// If this is a non-anonymous session then remove the session from the SessionMap
if (session.getAddress() != null && session.getAddress().getNode() != null) {
String username = session.getAddress().getNode().toLowerCase();
String username = session.getAddress().getNode();
synchronized (username.intern()) {
sessionMap = sessions.get(username);
if (sessionMap != null) {
......
......@@ -238,7 +238,6 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
String name = update.getFrom().getNode();
try {
if (name != null && !"".equals(name)) {
name = name.toLowerCase();
Roster roster = rosterManager.getRoster(name);
roster.broadcastPresence(update);
}
......@@ -305,7 +304,6 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
WeakHashMap<ChannelHandler, Set<String>> map;
String name = update.getFrom().getNode();
if (name != null && !"".equals(name)) {
name = name.toLowerCase();
try {
Roster roster = rosterManager.getRoster(name);
// If the directed presence was sent to an entity that is not in the user's
......
......@@ -67,7 +67,7 @@ public class MUCUserImpl implements MUCUser {
}
public MUCRole getRole(String roomName) throws NotFoundException {
MUCRole role = roles.get(roomName.toLowerCase());
MUCRole role = roles.get(roomName);
if (role == null) {
throw new NotFoundException(roomName);
}
......@@ -79,11 +79,11 @@ public class MUCUserImpl implements MUCUser {
}
public void addRole(String roomName, MUCRole role) {
roles.put(roomName.toLowerCase(), role);
roles.put(roomName, role);
}
public void removeRole(String roomName) {
roles.remove(roomName.toLowerCase());
roles.remove(roomName);
}
public long getLastPacketTime() {
......@@ -157,7 +157,7 @@ public class MUCUserImpl implements MUCUser {
+ packet.toString());
}
else {
MUCRole role = roles.get(group.toLowerCase());
MUCRole role = roles.get(group);
if (role == null) {
if (server.hasChatRoom(group)) {
boolean declinedInvitation = false;
......@@ -306,7 +306,7 @@ public class MUCUserImpl implements MUCUser {
+ packet.toString());
}
else {
MUCRole role = roles.get(group.toLowerCase());
MUCRole role = roles.get(group);
if (role == null) {
// TODO: send error message to user (can't send packets to group you haven't
// joined)
......@@ -382,7 +382,7 @@ public class MUCUserImpl implements MUCUser {
}
}
else {
MUCRole role = roles.get(group.toLowerCase());
MUCRole role = roles.get(group);
if (role == null) {
// If we're not already in a room, we either are joining it or it's not
// properly addressed and we drop it silently
......
......@@ -394,7 +394,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
public MUCRoom getChatRoom(String roomName, JID userjid) throws NotAllowedException {
MUCRoom room = null;
synchronized (roomName.intern()) {
room = rooms.get(roomName.toLowerCase());
room = rooms.get(roomName);
if (room == null) {
room = new MUCRoomImpl(this, roomName, router);
// If the room is persistent load the configuration values from the DB
......@@ -418,18 +418,18 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
}
room.addFirstOwner(userjid.toBareJID());
}
rooms.put(roomName.toLowerCase(), room);
rooms.put(roomName, room);
}
}
return room;
}
public MUCRoom getChatRoom(String roomName) {
MUCRoom room = rooms.get(roomName.toLowerCase());
MUCRoom room = rooms.get(roomName);
if (room == null) {
// Check if the room exists in the database and was not present in memory
synchronized (roomName.intern()) {
room = rooms.get(roomName.toLowerCase());
room = rooms.get(roomName);
if (room == null) {
room = new MUCRoomImpl(this, roomName, router);
// If the room is persistent load the configuration values from the DB
......@@ -438,7 +438,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
// persistent but was added to the DB after the server was started up or the
// room may be an old room that was not present in memory)
MUCPersistenceManager.loadFromDB((MUCRoomImpl) room);
rooms.put(roomName.toLowerCase(), room);
rooms.put(roomName, room);
}
catch (IllegalArgumentException e) {
// The room does not exist so do nothing
......@@ -459,7 +459,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
}
public void removeChatRoom(String roomName) {
final MUCRoom room = rooms.remove(roomName.toLowerCase());
final MUCRoom room = rooms.remove(roomName);
if (room != null) {
totalChatTime += room.getChatLength();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment