Commit 50151644 authored by Ash Ward's avatar Ash Ward Committed by Guus der Kinderen

Handle per-domain disco item providers correctly

parent 737f2a76
......@@ -111,8 +111,14 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
// We consider the host of the recipient JID of the packet as the entity. It's the
// DiscoItemsProvider responsibility to provide the items associated with the JID's name
// together with any possible requested node.
DiscoItemsProvider itemsProvider = getProvider(packet.getTo() == null ?
packet.getFrom().getNode() : packet.getTo().getNode() != null ? packet.getTo().getNode() : packet.getTo().getDomain());
DiscoItemsProvider itemsProvider = null;
if((packet.getTo() == null) || (packet.getTo().asBareJID().equals(packet.getFrom().asBareJID()))) {
itemsProvider = getProvider(XMPPServer.getInstance().getServerInfo().getXMPPDomain());
} else {
itemsProvider = getProvider(packet.getTo().getDomain());
}
if (itemsProvider != null) {
// Get the JID's name
String name = packet.getTo() == null ? null : packet.getTo().getNode();
......
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