aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-08-25 11:11:32 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-08-25 11:11:32 +0200
commit476db24c10180c0100bbd9a2cfbc34b672464b74 (patch)
tree098717a9c7fd47890e1a2b492c8d2e0dbb0567b7 /src/main/java/eu/siacs
parentdd20f41f1b70dd7329bf58672a655f19d582e43d (diff)
fixed session time
Diffstat (limited to 'src/main/java/eu/siacs')
-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;
}