Commit ad3cc7f1 authored by guus's avatar guus

Workaround for OF-23 - send presence error stanzas to all resources of the original sender.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11568 b35dd754-fafc-0310-a699-88a17e54d16e
parent 304c2ed5
......@@ -20,7 +20,9 @@
package org.jivesoftware.openfire.server;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.BlockingQueue;
......@@ -297,12 +299,23 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
routingTable.routePacket(reply.getTo(), reply, true);
}
else if (packet instanceof Presence) {
Presence reply = new Presence();
reply.setID(packet.getID());
reply.setTo(from);
reply.setFrom(to);
reply.setError(PacketError.Condition.remote_server_not_found);
routingTable.routePacket(reply.getTo(), reply, true);
// workaround for OF-23. "undo" the 'setFrom' to a bare JID
// by sending the error to all available resources.
final List<JID> routes = new ArrayList<JID>();
if (to.getResource() == null) {
routes.addAll(routingTable.getRoutes(to, null));
} else {
routes.add(to);
}
for (JID route : routes) {
Presence reply = new Presence();
reply.setID(packet.getID());
reply.setTo(from);
reply.setFrom(route);
reply.setError(PacketError.Condition.remote_server_not_found);
routingTable.routePacket(reply.getTo(), reply, true);
}
}
else if (packet instanceof Message) {
Message reply = new 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