fixed possible logout bugs

This commit is contained in:
iNPUTmice 2014-10-08 12:21:58 +02:00
parent 3737a96dbb
commit 3d88ffc5cd
2 changed files with 5 additions and 2 deletions

View File

@ -1508,6 +1508,9 @@ public class XmppConnectionService extends Service {
thread.start(); thread.start();
scheduleWakeupCall((int) (Config.CONNECT_TIMEOUT * 1.2), scheduleWakeupCall((int) (Config.CONNECT_TIMEOUT * 1.2),
false); false);
} else {
account.getRoster().clearPresences();
account.setXmppConnection(null);
} }
} }
}).start(); }).start();

View File

@ -910,8 +910,7 @@ public class XmppConnection implements Runnable {
} }
public void disconnect(boolean force) { public void disconnect(boolean force) {
changeStatus(Account.STATUS_OFFLINE); Log.d(Config.LOGTAG, account.getJid()+": disconnecting");
Log.d(Config.LOGTAG, "disconnecting");
try { try {
if (force) { if (force) {
socket.close(); socket.close();
@ -929,6 +928,7 @@ public class XmppConnection implements Runnable {
Thread.sleep(100); Thread.sleep(100);
} }
tagWriter.writeTag(Tag.end("stream:stream")); tagWriter.writeTag(Tag.end("stream:stream"));
socket.close();
} catch (IOException e) { } catch (IOException e) {
Log.d(Config.LOGTAG, Log.d(Config.LOGTAG,
"io exception during disconnect"); "io exception during disconnect");