Commit 6776fb26 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed routing of Presence packets to bare jids.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8647 b35dd754-fafc-0310-a699-88a17e54d16e
parent aecc9d00
......@@ -17,6 +17,7 @@ import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import org.xmpp.packet.JID;
import org.xmpp.packet.Packet;
import org.xmpp.packet.Presence;
/**
* This ChannelHandler writes packet data to connections.
......@@ -46,9 +47,16 @@ public class SocketPacketWriteHandler implements ChannelHandler {
// no TO was found so send back the packet to the sender
routingTable.routePacket(packet.getFrom(), packet);
}
else {
else if (recipient.getResource() != null || !(packet instanceof Presence)) {
// JID is of the form <user@domain/resource>
routingTable.routePacket(recipient, packet);
}
else {
// JID is of the form <user@domain>
for (JID route : routingTable.getRoutes(recipient)) {
routingTable.routePacket(route, packet);
}
}
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error.deliver") + "\n" + packet.toString(), e);
......
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