fixed possible logout bugs
This commit is contained in:
parent
3737a96dbb
commit
3d88ffc5cd
|
@ -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();
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue