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();
scheduleWakeupCall((int) (Config.CONNECT_TIMEOUT * 1.2),
false);
} else {
account.getRoster().clearPresences();
account.setXmppConnection(null);
}
}
}).start();

View file

@ -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");