From 850b24c4dbbed20cde68f6015be2a5b7f28fba93 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 5 Apr 2014 09:45:15 +0200 Subject: [PATCH] code cleanup --- .../siacs/conversations/xmpp/XmppConnection.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 591752c44..7b26e3d8a 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -387,14 +387,10 @@ public class XmppConnection implements Runnable { } private void sendCompressionZlib() throws IOException { - tagWriter.writeElement(new Element("compress") { - public String toString() { - return - "" - + "zlib" - + ""; - } - }); + Element compress = new Element("compress"); + compress.setAttribute("xmlns", "http://jabber.org/protocol/compress"); + compress.addChild("method").setContent("zlib"); + tagWriter.writeElement(compress); } private void switchOverToZLib(Tag currentTag) throws XmlPullParserException, @@ -408,9 +404,8 @@ public class XmppConnection implements Runnable { tagReader.setInputStream(new ZLibInputStream(tagReader.getInputStream())); sendStartStream(); + Log.d(LOGTAG,account.getJid()+": compression enabled"); processStream(tagReader.readTag()); - - Log.d(LOGTAG,account.getJid()+": zlib compressed stream established"); } private void sendStartTLS() throws IOException { @@ -568,7 +563,6 @@ public class XmppConnection implements Runnable { return true; } } - return false; }