Skip to content

Commit

Permalink
Merge pull request #274 from tevans/OF-938
Browse files Browse the repository at this point in the history
OF-938: Use correct namespace for BOSH packets
  • Loading branch information
dwd committed Aug 14, 2015
2 parents d29034d + 2336652 commit e387da5
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/java/org/jivesoftware/openfire/http/HttpSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -1173,19 +1173,11 @@ public Deliverable(Collection<Packet> elements) {
this.text = null;
this.packets = new ArrayList<String>();
for (Packet packet : elements) {
// Rewrite packet namespace according XEP-0206
if (packet instanceof Presence) {
this.packets.add("<presence xmlns=\"jabber:client\"" + packet.toXML().substring(9));
}
else if (packet instanceof IQ) {
this.packets.add("<iq xmlns=\"jabber:client\"" + packet.toXML().substring(3));
}
else if (packet instanceof Message) {
this.packets.add("<message xmlns=\"jabber:client\"" + packet.toXML().substring(8));
}
else {
this.packets.add(packet.toXML());
}
// Append packet namespace according XEP-0206 if needed
if (Namespace.NO_NAMESPACE.equals(packet.getElement().getNamespace())) {
packet.getElement().add(Namespace.get("jabber:client"));
}
this.packets.add(packet.toXML());
}
}

Expand Down

0 comments on commit e387da5

Please sign in to comment.