From 9a7d925b970a1154e93b5f7e43a9e384abe9de22 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 6 May 2017 15:37:22 +0200 Subject: [PATCH] do not synchronize startXmpp() and sendPacket() on the same object as this can block the ui --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index c70c9324..671ebf10 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -441,7 +441,7 @@ public class XmppConnection implements Runnable { * Starts xmpp protocol, call after connecting to socket * @return true if server returns with valid xmpp, false otherwise */ - private synchronized boolean startXmpp(Socket socket) throws Exception { + private boolean startXmpp(Socket socket) throws Exception { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -643,9 +643,7 @@ public class XmppConnection implements Runnable { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": resumption failed"); } resetStreamId(); - if (account.getStatus() != Account.State.ONLINE) { - sendBindRequest(); - } + sendBindRequest(); } else if (nextTag.isStart("iq")) { processIq(nextTag); } else if (nextTag.isStart("message")) {