aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-26 23:01:09 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-26 23:01:09 +0200
commitce98d4090857ce1461b0f68a71e43afd7c4094e1 (patch)
treeacae20c7bdd6ba4f42205c41714c733f56bb2ef5 /src/main/java/de/pixart/messenger/parser
parent3cb9cd0a5df5400e25cd9bcac4593e39b2579116 (diff)
improve active_since implementation (XEP-0319: Last User Interaction in Presence)
* set contact to inactive if it becomes offline * send idle also in case app started in background
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-rw-r--r--src/main/java/de/pixart/messenger/parser/PresenceParser.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
index 15fb36372..1da8553dc 100644
--- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java
+++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
@@ -283,6 +283,9 @@ public class PresenceParser extends AbstractParser implements
} else {
contact.removePresence(from.getResource());
}
+ if (contact.getShownStatus() == Presence.Status.OFFLINE) {
+ contact.flagInactive();
+ }
mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, false);
} else if (type.equals("subscribe")) {
if (contact.getOption(Contact.Options.PREEMPTIVE_GRANT)) {