Commit 75926ddb authored by guus's avatar guus

Fixing the workaround for OF-23.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11578 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9e5f2c57
...@@ -302,17 +302,17 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -302,17 +302,17 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
// workaround for OF-23. "undo" the 'setFrom' to a bare JID // workaround for OF-23. "undo" the 'setFrom' to a bare JID
// by sending the error to all available resources. // by sending the error to all available resources.
final List<JID> routes = new ArrayList<JID>(); final List<JID> routes = new ArrayList<JID>();
if (to.getResource() == null) { if (from.getResource() == null || from.getResource().trim().length() == 0) {
routes.addAll(routingTable.getRoutes(to, null)); routes.addAll(routingTable.getRoutes(from, null));
} else { } else {
routes.add(to); routes.add(from);
} }
for (JID route : routes) { for (JID route : routes) {
Presence reply = new Presence(); Presence reply = new Presence();
reply.setID(packet.getID()); reply.setID(packet.getID());
reply.setTo(from); reply.setTo(route);
reply.setFrom(route); reply.setFrom(to);
reply.setError(PacketError.Condition.remote_server_not_found); reply.setError(PacketError.Condition.remote_server_not_found);
routingTable.routePacket(reply.getTo(), reply, true); routingTable.routePacket(reply.getTo(), reply, true);
} }
......
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