Commit 3a9e15da authored by Dave Cridland's avatar Dave Cridland

OF-1123 Respond to incoming streams with the right domain

Openfire previously would respond to all incoming domains with the IM domain,
this patch examines and validates the "to" attribute on inbound streams and
responds accordingly.
parent 55bf1bee
......@@ -112,7 +112,12 @@ public class LocalIncomingServerSession extends LocalServerSession implements In
String version = xpp.getAttributeValue("", "version");
String fromDomain = xpp.getAttributeValue("", "from");
String toDomain = xpp.getAttributeValue("", "to");
int[] serverVersion = version != null ? decodeVersion(version) : new int[] {0,0};
if (toDomain == null) {
toDomain = serverName;
}
try {
// Get the stream ID for the new session
......@@ -127,7 +132,7 @@ public class LocalIncomingServerSession extends LocalServerSession implements In
openingStream.append(" xmlns:db=\"jabber:server:dialback\"");
openingStream.append(" xmlns:stream=\"http://etherx.jabber.org/streams\"");
openingStream.append(" xmlns=\"jabber:server\"");
openingStream.append(" from=\"").append(serverName).append("\"");
openingStream.append(" from=\"").append(toDomain).append("\"");
if (fromDomain != null) {
openingStream.append(" to=\"").append(fromDomain).append("\"");
}
......
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