From 3d88ffc5cd4b9e500048557f9ce5f01653123526 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 8 Oct 2014 12:21:58 +0200 Subject: fixed possible logout bugs --- src/eu/siacs/conversations/services/XmppConnectionService.java | 3 +++ src/eu/siacs/conversations/xmpp/XmppConnection.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/eu/siacs') diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 6aac3f93..e2c17b7e 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1508,6 +1508,9 @@ public class XmppConnectionService extends Service { thread.start(); scheduleWakeupCall((int) (Config.CONNECT_TIMEOUT * 1.2), false); + } else { + account.getRoster().clearPresences(); + account.setXmppConnection(null); } } }).start(); diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index b789d95f..54409be4 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -910,8 +910,7 @@ public class XmppConnection implements Runnable { } public void disconnect(boolean force) { - changeStatus(Account.STATUS_OFFLINE); - Log.d(Config.LOGTAG, "disconnecting"); + Log.d(Config.LOGTAG, account.getJid()+": disconnecting"); try { if (force) { socket.close(); @@ -929,6 +928,7 @@ public class XmppConnection implements Runnable { Thread.sleep(100); } tagWriter.writeTag(Tag.end("stream:stream")); + socket.close(); } catch (IOException e) { Log.d(Config.LOGTAG, "io exception during disconnect"); -- cgit v1.2.3