aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index ddc3158c..6a94a5f3 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -318,7 +318,6 @@ public class XmppConnection implements Runnable {
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString()
+ ": stream management(" + smVersion + ") enabled");
}
- this.lastSessionStarted = SystemClock.elapsedRealtime();
this.stanzasReceived = 0;
final RequestPacket r = new RequestPacket(smVersion);
tagWriter.writeStanzaAsync(r);
@@ -784,6 +783,7 @@ public class XmppConnection implements Runnable {
sendServiceDiscoveryInfo(account.getJid().toBareJid());
sendServiceDiscoveryItems(account.getServer());
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": online with resource " + account.getResource());
+ this.lastSessionStarted = SystemClock.elapsedRealtime();
changeStatus(Account.State.ONLINE);
if (bindListener != null) {
bindListener.onBind(account);
@@ -1100,12 +1100,7 @@ public class XmppConnection implements Runnable {
}
public long getLastSessionEstablished() {
- final long diff;
- if (this.lastSessionStarted == 0) {
- diff = SystemClock.elapsedRealtime() - this.lastConnect;
- } else {
- diff = SystemClock.elapsedRealtime() - this.lastSessionStarted;
- }
+ final long diff = SystemClock.elapsedRealtime() - this.lastSessionStarted;
return System.currentTimeMillis() - diff;
}