Commit 6c66a7f1 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-58] Respond by saying you are not logged in when you are not.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5729 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3ca1b67e
......@@ -160,30 +160,31 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
JID from = packet.getFrom();
JID to = packet.getTo();
if (to.getNode() == null) {
// Message to gateway itself. Throw away for now.
try {
TransportSession session = sessionManager.getSession(from);
try {
TransportSession session = sessionManager.getSession(from);
if (!session.isLoggedIn()) {
Message m = new Message();
m.setError(Condition.service_unavailable);
m.setTo(from);
m.setFrom(getJID());
m.setBody("You are not currently logged into the transport.");
reply.add(m);
}
else if (to.getNode() == null) {
// Message to gateway itself. Throw away for now.
if (packet.getBody() != null) {
session.sendServerMessage(packet.getBody());
}
}
catch (NotFoundException e) {
// TODO: Should return an error packet here
Log.debug("Unable to find session.");
}
}
else {
try {
TransportSession session = sessionManager.getSession(from);
else {
if (packet.getBody() != null) {
session.sendMessage(to, packet.getBody());
}
}
catch (NotFoundException e) {
// TODO: Should return an error packet here
Log.debug("Unable to find session.");
}
}
catch (NotFoundException e) {
// TODO: Should return an error packet here
Log.debug("Unable to find session.");
}
return reply;
......
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