aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-01-04 19:46:41 +0100
committerChristian S <christian@pix-art.de>2016-01-04 19:46:41 +0100
commitac92023e4a8e537f09059966adaf44c035743e3c (patch)
tree1734b88aef058e2040c5c40326b286f22d53bc59 /src/main/java/eu/siacs/conversations/parser/AbstractParser.java
parent9cce7d873ab241cf50f128bda09631d226da1d48 (diff)
parentabdb8bfb65cda02adcb6c1bcbdcd00159fc0c96a (diff)
copy commits
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/AbstractParser.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
index 18331796e..7d3990735 100644
--- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
@@ -11,6 +11,7 @@ import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.jid.Jid;
+import eu.siacs.conversations.xmpp.stanzas.AbstractStanza;
public abstract class AbstractParser {
@@ -47,14 +48,13 @@ public abstract class AbstractParser {
return dateFormat.parse(timestamp);
}
- protected void updateLastseen(final Element packet, final Account account, final boolean presenceOverwrite) {
- updateLastseen(packet, account, packet.getAttributeAsJid("from"), presenceOverwrite);
+ protected void updateLastseen(final AbstractStanza packet, final Account account, final boolean presenceOverwrite) {
+ updateLastseen(getTimestamp(packet), account, packet.getFrom(), presenceOverwrite);
}
- protected void updateLastseen(final Element packet, final Account account, final Jid from, final boolean presenceOverwrite) {
+ protected void updateLastseen(long timestamp, final Account account, final Jid from, final boolean presenceOverwrite) {
final String presence = from == null || from.isBareJid() ? "" : from.getResourcepart();
final Contact contact = account.getRoster().getContact(from);
- final long timestamp = getTimestamp(packet);
if (timestamp >= contact.lastseen.time) {
contact.lastseen.time = timestamp;
if (!presence.isEmpty() && presenceOverwrite) {