Commit 6ab854f0 authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #691 from surevine/stream-response

OF-1123 Respond to incoming streams with the right domain
parents 55bf1bee 3a9e15da
...@@ -112,7 +112,12 @@ public class LocalIncomingServerSession extends LocalServerSession implements In ...@@ -112,7 +112,12 @@ public class LocalIncomingServerSession extends LocalServerSession implements In
String version = xpp.getAttributeValue("", "version"); String version = xpp.getAttributeValue("", "version");
String fromDomain = xpp.getAttributeValue("", "from"); String fromDomain = xpp.getAttributeValue("", "from");
String toDomain = xpp.getAttributeValue("", "to");
int[] serverVersion = version != null ? decodeVersion(version) : new int[] {0,0}; int[] serverVersion = version != null ? decodeVersion(version) : new int[] {0,0};
if (toDomain == null) {
toDomain = serverName;
}
try { try {
// Get the stream ID for the new session // Get the stream ID for the new session
...@@ -127,7 +132,7 @@ public class LocalIncomingServerSession extends LocalServerSession implements In ...@@ -127,7 +132,7 @@ public class LocalIncomingServerSession extends LocalServerSession implements In
openingStream.append(" xmlns:db=\"jabber:server:dialback\""); openingStream.append(" xmlns:db=\"jabber:server:dialback\"");
openingStream.append(" xmlns:stream=\"http://etherx.jabber.org/streams\""); openingStream.append(" xmlns:stream=\"http://etherx.jabber.org/streams\"");
openingStream.append(" xmlns=\"jabber:server\""); openingStream.append(" xmlns=\"jabber:server\"");
openingStream.append(" from=\"").append(serverName).append("\""); openingStream.append(" from=\"").append(toDomain).append("\"");
if (fromDomain != null) { if (fromDomain != null) {
openingStream.append(" to=\"").append(fromDomain).append("\""); 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