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,9 +1036,30 @@ public class HttpSession extends LocalClientSession { ...@@ -1036,9 +1036,30 @@ public class HttpSession extends LocalClientSession {
this.text = null; this.text = null;
this.packets = new ArrayList<String>(); this.packets = new ArrayList<String>();
for (Packet packet : elements) { for (Packet packet : elements) {
// 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()); this.packets.add(packet.toXML());
} }
} }
}
public String getDeliverable() { public String getDeliverable() {
if (text == null) { if (text == null) {
......
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