aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-04 16:16:14 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-06-04 16:16:14 +0200
commit71e911717697078141c3669134ad9268e9753ea0 (patch)
tree93c9833d28048c15aefe4109105523a4a0e002d9 /src/main/java/eu/siacs/conversations/utils
parent6639d0f23bb983cae7234d6b15f9875464c67093 (diff)
opt-in to send last userinteraction in presence
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java8
-rw-r--r--src/main/java/eu/siacs/conversations/utils/Xmlns.java2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index 4ab748188..acc7f28c5 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -107,12 +107,10 @@ public class UIHelper {
.get(Calendar.DAY_OF_YEAR);
}
- public static String lastseen(Context context, long time) {
- if (time == 0) {
- return context.getString(R.string.never_seen);
- }
+ public static String lastseen(Context context, boolean active, long time) {
long difference = (System.currentTimeMillis() - time) / 1000;
- if (difference < 60) {
+ active = active && difference <= 300;
+ if (active || difference < 60) {
return context.getString(R.string.last_seen_now);
} else if (difference < 60 * 2) {
return context.getString(R.string.last_seen_min);
diff --git a/src/main/java/eu/siacs/conversations/utils/Xmlns.java b/src/main/java/eu/siacs/conversations/utils/Xmlns.java
index ad30b3e63..de0a29ce2 100644
--- a/src/main/java/eu/siacs/conversations/utils/Xmlns.java
+++ b/src/main/java/eu/siacs/conversations/utils/Xmlns.java
@@ -1,7 +1,5 @@
package eu.siacs.conversations.utils;
-import eu.siacs.conversations.Config;
-
public final class Xmlns {
public static final String BLOCKING = "urn:xmpp:blocking";
public static final String ROSTER = "jabber:iq:roster";