always go through reconnect method instead of just starting XmppConnection threads

This commit is contained in:
iNPUTmice 2015-02-18 13:37:26 +01:00
parent da2bc6db23
commit b128b33e56

View file

@ -466,10 +466,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
this.scheduleWakeUpCall((int) (msToNextPing / 1000), account.getUuid().hashCode()); this.scheduleWakeUpCall((int) (msToNextPing / 1000), account.getUuid().hashCode());
} }
} else if (account.getStatus() == Account.State.OFFLINE) { } else if (account.getStatus() == Account.State.OFFLINE) {
if (account.getXmppConnection() == null) { reconnectAccount(account,true);
account.setXmppConnection(this.createConnection(account));
}
new Thread(account.getXmppConnection()).start();
} else if (account.getStatus() == Account.State.CONNECTING) { } else if (account.getStatus() == Account.State.CONNECTING) {
long timeout = Config.CONNECT_TIMEOUT - ((SystemClock.elapsedRealtime() - account.getXmppConnection().getLastConnect()) / 1000); long timeout = Config.CONNECT_TIMEOUT - ((SystemClock.elapsedRealtime() - account.getXmppConnection().getLastConnect()) / 1000);
if (timeout < 0) { if (timeout < 0) {