aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/utils
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-23 23:34:58 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-23 23:34:58 +0100
commit95ef8fd216d31aabd089649161ac699d06f3f8cd (patch)
treec0dc3d8df681e2002c8e5d6aee79f36c51a696dd /src/main/java/de/pixart/messenger/utils
parentd8c077be6513debbb352d362390296c37c92c7fd (diff)
rework last activity logic to something that should work pretty well …
…in Conversations only enviroments
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/utils/Namespace.java1
-rw-r--r--src/main/java/de/pixart/messenger/utils/UIHelper.java5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Namespace.java b/src/main/java/de/pixart/messenger/utils/Namespace.java
index bc6d56752..a384712db 100644
--- a/src/main/java/de/pixart/messenger/utils/Namespace.java
+++ b/src/main/java/de/pixart/messenger/utils/Namespace.java
@@ -9,4 +9,5 @@ public final class Namespace {
public static final String STANZA_IDS = "urn:xmpp:sid:0";
public static final String MAM = "urn:xmpp:mam:2";
public static final String MAM_LEGACY = "urn:xmpp:mam:0";
+ public static final String IDLE = "urn:xmpp:idle:1";
}
diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java
index 05d6c2706..68f9297e9 100644
--- a/src/main/java/de/pixart/messenger/utils/UIHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java
@@ -112,8 +112,9 @@ public class UIHelper {
public static String lastseen(Context context, boolean active, long time) {
long difference = (System.currentTimeMillis() - time) / 1000;
- active = active && difference <= 300;
- if (active || difference < 60) {
+ if (active) {
+ return context.getString(R.string.last_seen_now);
+ } else if (difference < 60) {
return context.getString(R.string.last_seen_now);
} else if (difference < 60 * 2) {
return context.getString(R.string.last_seen_min);