1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Use XmlStringBuilder in most toXML() bodies

Also change StringUtils.escapeForXML() and Packet.toXML() to return
CharSequence instead of String. XmlStringBuilder now has 'optX' methods.

Remove XmlUtils in favor of XmlStringBuilder
This commit is contained in:
Florian Schmaus 2014-03-21 09:51:52 +01:00
parent 1cf4681581
commit 978f692eb0
47 changed files with 511 additions and 412 deletions

View file

@ -338,7 +338,7 @@ public class BOSHConnection extends XMPPConnection {
void sendPacketInternal(Packet packet) {
if (!done) {
try {
send(ComposableBody.builder().setPayloadXML(packet.toXML())
send(ComposableBody.builder().setPayloadXML(packet.toXML().toString())
.build());
} catch (BOSHException e) {
LOGGER.log(Level.SEVERE, "BOSHException in sendPacketInternal", e);
@ -391,7 +391,7 @@ public class BOSHConnection extends XMPPConnection {
try {
client.disconnect(ComposableBody.builder()
.setNamespaceDefinition("xmpp", XMPP_BOSH_NS)
.setPayloadXML(unavailablePresence.toXML())
.setPayloadXML(unavailablePresence.toXML().toString())
.build());
// Wait 150 ms for processes to clean-up, then shutdown.
Thread.sleep(150);