aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser/PresenceParser.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-12 18:27:50 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-12 18:27:50 +0200
commitb1482212b879123344ef8dcdc622ce095a4dc765 (patch)
tree7b3e6d9f2074bd16cdef1655ad84e02aa2c51cf9 /src/eu/siacs/conversations/parser/PresenceParser.java
parent18871230e1c0ef76431b97037e6073856279f93e (diff)
fire onContactStatusChanged only on online/offline changes. not on status changes
Diffstat (limited to 'src/eu/siacs/conversations/parser/PresenceParser.java')
-rw-r--r--src/eu/siacs/conversations/parser/PresenceParser.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java
index cf55f61f..2003d4cd 100644
--- a/src/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/eu/siacs/conversations/parser/PresenceParser.java
@@ -1,6 +1,5 @@
package eu.siacs.conversations.parser;
-import android.util.Log;
import eu.siacs.conversations.crypto.PgpEngine;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
@@ -54,6 +53,7 @@ public class PresenceParser extends AbstractParser {
Contact contact = account.getRoster().getContact(packet.getFrom());
if (type == null) {
if (fromParts.length == 2) {
+ int sizeBefore = contact.getPresences().size();
contact.updatePresence(fromParts[1],
Presences.parseShow(packet.findChild("show")));
PgpEngine pgp = mXmppConnectionService.getPgpEngine();
@@ -71,9 +71,10 @@ public class PresenceParser extends AbstractParser {
x.getContent()));
}
}
+ boolean online = sizeBefore < contact.getPresences().size();
updateLastseen(packet, account,true);
mXmppConnectionService.onContactStatusChanged
- .onContactStatusChanged(contact,true);
+ .onContactStatusChanged(contact,online);
}
} else if (type.equals("unavailable")) {
if (fromParts.length != 2) {