diff options
Diffstat (limited to '')
3 files changed, 4 insertions, 12 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java index 7d3990735..73c717bf2 100644 --- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java @@ -48,16 +48,12 @@ public abstract class AbstractParser { return dateFormat.parse(timestamp); } - protected void updateLastseen(final AbstractStanza packet, final Account account, final boolean presenceOverwrite) { - updateLastseen(getTimestamp(packet), account, packet.getFrom(), presenceOverwrite); - } - - protected void updateLastseen(long timestamp, final Account account, final Jid from, final boolean presenceOverwrite) { + protected void updateLastseen(long timestamp, final Account account, final Jid from) { final String presence = from == null || from.isBareJid() ? "" : from.getResourcepart(); final Contact contact = account.getRoster().getContact(from); if (timestamp >= contact.lastseen.time) { contact.lastseen.time = timestamp; - if (!presence.isEmpty() && presenceOverwrite) { + if (!presence.isEmpty()) { contact.lastseen.presence = presence; } } diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 21bdbdf63..3f5cfe242 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -395,14 +395,11 @@ public class MessageParser extends AbstractParser implements if (conversation.getMode() == Conversation.MODE_MULTI) { Jid trueCounterpart = conversation.getMucOptions().getTrueCounterpart(counterpart.getResourcepart()); message.setTrueCounterpart(trueCounterpart); - if (trueCounterpart != null) { - updateLastseen(timestamp, account, trueCounterpart, false); - } if (!isTypeGroupChat) { message.setType(Message.TYPE_PRIVATE); } } else { - updateLastseen(timestamp, account, packet.getFrom(), true); + updateLastseen(timestamp, account, from); } if (replacementId != null && mXmppConnectionService.allowMessageCorrection()) { @@ -543,7 +540,7 @@ public class MessageParser extends AbstractParser implements mXmppConnectionService.markRead(conversation); } } else { - updateLastseen(timestamp, account, packet.getFrom(), true); + updateLastseen(timestamp, account, from); final Message displayedMessage = mXmppConnectionService.markMessage(account, from.toBareJid(), displayed.getAttribute("id"), Message.STATUS_SEND_DISPLAYED); Message message = displayedMessage == null ? null : displayedMessage.prev(); while (message != null diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index e6cfa38fe..c6b234590 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -211,7 +211,6 @@ public class PresenceParser extends AbstractParser implements contact.setPgpKeyId(pgp.fetchKeyId(account, msg, x.getContent())); } boolean online = sizeBefore < contact.getPresences().size(); - updateLastseen(packet, account, false); mXmppConnectionService.onContactStatusChanged.onContactStatusChanged(contact, online); } else if (type.equals("unavailable")) { if (from.isBareJid()) { |