Commit 7d098202 authored by Günther Niess's avatar Günther Niess Committed by niess

OF-346: Fix packet namespaces for Http-Bind (string manipulation)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11636 b35dd754-fafc-0310-a699-88a17e54d16e
parent 16131237
......@@ -1036,7 +1036,28 @@ public class HttpSession extends LocalClientSession {
this.text = null;
this.packets = new ArrayList<String>();
for (Packet packet : elements) {
this.packets.add(packet.toXML());
// Rewrite packet namespace according XEP-0206
if (packet instanceof Presence) {
final StringBuilder sb = new StringBuilder();
sb.append("<presence xmlns=\"jabber:client\"");
sb.append(packet.toXML().substring(9));
this.packets.add(sb.toString());
}
else if (packet instanceof IQ) {
final StringBuilder sb = new StringBuilder();
sb.append("<iq xmlns=\"jabber:client\"");
sb.append(packet.toXML().substring(3));
this.packets.add(sb.toString());
}
else if (packet instanceof Message) {
final StringBuilder sb = new StringBuilder();
sb.append("<message xmlns=\"jabber:client\"");
sb.append(packet.toXML().substring(8));
this.packets.add(sb.toString());
}
else {
this.packets.add(packet.toXML());
}
}
}
......
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