aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-03-20 17:24:41 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-03-20 17:24:41 +0100
commit7df24407dcbe6b19af7996cc0752531958c133d2 (patch)
treed881ec9a78adf66e89e65cc3b5bfe7399d9c2b44 /src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
parentb51ce43d36aad7633ac504b952be65a05116e20e (diff)
be more careful to avoid creating multiple connections
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 72996e4b..fd0e355d 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -219,12 +219,16 @@ public class XmppConnection implements Runnable {
}
}
+ public void prepareNewConnection() {
+ this.lastConnect = SystemClock.elapsedRealtime();
+ this.lastPingSent = SystemClock.elapsedRealtime();
+ this.lastDiscoStarted = Long.MAX_VALUE;
+ this.changeStatus(Account.State.CONNECTING);
+ }
+
protected void connect() {
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": connecting");
features.encryptionEnabled = false;
- lastConnect = SystemClock.elapsedRealtime();
- lastPingSent = SystemClock.elapsedRealtime();
- lastDiscoStarted = Long.MAX_VALUE;
this.attempt++;
switch (account.getJid().getDomainpart()) {
case "chat.facebook.com":