Commit 1f189fd6 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Code cleanup, removed synchronization.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@680 b35dd754-fafc-0310-a699-88a17e54d16e
parent ff49ae5f
......@@ -25,6 +25,7 @@ import java.util.Map;
* @author Iain Shigeoka
*/
abstract public class BasicConnection implements Connection {
private Map listeners = new HashMap();
public void init(Session session) {
......
......@@ -210,27 +210,19 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
}
if (user != null) {
synchronized (onlineUsers) {
onlineUsers.put(user.getUsername(), presence);
}
onlineUsers.put(user.getUsername(), presence);
}
else {
synchronized (onlineGuests) {
onlineGuests.put(presence.getID(), presence);
}
onlineGuests.put(presence.getID(), presence);
}
}
public void setOffline(Presence presence) {
if (presence.getFrom().getNode() != null) {
synchronized (onlineUsers) {
onlineUsers.remove(presence.getFrom().getNode());
}
onlineUsers.remove(presence.getFrom().getNode());
}
else {
synchronized (onlineGuests) {
onlineGuests.remove(presence.getID());
}
onlineGuests.remove(presence.getID());
}
}
......
......@@ -197,15 +197,14 @@ public class CachedRosterImpl extends BasicRoster implements CachedRoster {
}
}
public synchronized RosterItem deleteRosterItem(JID user) throws UnauthorizedException {
public RosterItem deleteRosterItem(JID user) throws UnauthorizedException {
// Note that the super cache will always only hold cached roster items
CachedRosterItem item = (CachedRosterItem)super.deleteRosterItem(user);
if (item != null) {
// If removing the user was successful, remove the user from the backend store
rosterItemProvider.deleteItem(username, item.getID());
// broadcast the update to the user
// Broadcast the update to the user
Roster roster = new Roster();
roster.setType(IQ.Type.set);
roster.addItem(user, Roster.Subscription.remove);
......@@ -214,8 +213,6 @@ public class CachedRosterImpl extends BasicRoster implements CachedRoster {
return item;
}
private void broadcast(Roster roster) throws UnauthorizedException {
if (server == null) {
server = BasicServer.getInstance();
......
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