Commit e9a58db9 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Refactoring work. JM-256


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1244 b35dd754-fafc-0310-a699-88a17e54d16e
parent 0da2a54c
......@@ -374,8 +374,6 @@ public class ClientSession extends Session {
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
// TODO: Should attempt to do something with the packet
conn.close();
}
}
}
......
......@@ -192,7 +192,7 @@ public class IQRouter extends BasicModule {
}
Session session = sessionManager.getSession(packet.getFrom());
if (session != null) {
session.getConnection().deliver(reply);
session.process(reply);
}
else {
Log.warn("Packet could not be delivered " + packet);
......@@ -213,7 +213,7 @@ public class IQRouter extends BasicModule {
if (XMPPServer.getInstance().isLocal(recipientJID)) {
Session session = sessionManager.getBestRoute(recipientJID);
if (session != null) {
session.getConnection().deliver(packet);
session.process(packet);
handlerFound = true;
}
else {
......@@ -238,7 +238,7 @@ public class IQRouter extends BasicModule {
IQ reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.service_unavailable);
session.getConnection().deliver(reply);
session.process(reply);
}
}
}
......
......@@ -108,7 +108,7 @@ public class OfflineMessageStrategy extends BasicModule {
Message errorResponse = message.createCopy();
errorResponse.setError(new PacketError(PacketError.Condition.item_not_found,
PacketError.Type.continue_processing));
session.getConnection().deliver(errorResponse);
session.process(errorResponse);
}
catch (Exception e) {
Log.error(e);
......
......@@ -157,7 +157,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
// Send the response directly since we want to be sure that we are sending it back
// to the correct session. Any other session of the same user but with different
// resource is incorrect.
session.getConnection().deliver(response);
session.process(response);
}
catch (Exception e) {
Log.error("Error handling authentication IQ packet", e);
......
......@@ -58,7 +58,7 @@ public abstract class IQHandler extends BasicModule implements ChannelHandler {
response.setError(PacketError.Condition.not_authorized);
Session session = sessionManager.getSession(iq.getFrom());
if (!session.getConnection().isClosed()) {
session.getConnection().deliver(response);
session.process(response);
}
}
catch (Exception de) {
......
......@@ -213,7 +213,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
GroupManager.getInstance().deleteUser(user);
reply = IQ.createResultIQ(packet);
session.getConnection().deliver(reply);
session.process(reply);
// Close the user's connection
session.getConnection().close();
// The reply has been sent so clean up the variable
......@@ -340,7 +340,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
}
if (reply != null) {
// why is this done here instead of letting the iq handler do it?
session.getConnection().deliver(reply);
session.process(reply);
}
return null;
}
......
......@@ -191,10 +191,10 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
Roster roster = rosterManager.getRoster(username);
for (RosterItem item : roster.getRosterItems()) {
if (item.getRecvStatus() == RosterItem.RECV_SUBSCRIBE) {
session.getConnection().deliver(createSubscribePresence(item.getJid(), true));
session.process(createSubscribePresence(item.getJid(), true));
}
else if (item.getRecvStatus() == RosterItem.RECV_UNSUBSCRIBE) {
session.getConnection().deliver(createSubscribePresence(item.getJid(), false));
session.process(createSubscribePresence(item.getJid(), false));
}
if (item.getSubStatus() == RosterItem.SUB_TO
|| item.getSubStatus() == RosterItem.SUB_BOTH) {
......@@ -204,7 +204,7 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
// deliver offline messages if any
Collection<Message> messages = messageStore.getMessages(username);
for (Message message : messages) {
session.getConnection().deliver(message);
session.process(message);
}
}
}
......
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