clear notification and activate grace period when receiving chat marker from another instance

This commit is contained in:
Daniel Gultsch 2015-10-06 11:44:27 +02:00
parent 89edd83609
commit e6af502055

View file

@ -40,6 +40,10 @@ public class MessageParser extends AbstractParser implements
Jid from = packet.getFrom(); Jid from = packet.getFrom();
if (from.toBareJid().equals(account.getJid().toBareJid())) { if (from.toBareJid().equals(account.getJid().toBareJid())) {
conversation.setOutgoingChatState(state); conversation.setOutgoingChatState(state);
if (state == ChatState.ACTIVE || state == ChatState.COMPOSING) {
mXmppConnectionService.markRead(conversation);
account.activateGracePeriod();
}
return false; return false;
} else { } else {
return conversation.setIncomingChatState(state); return conversation.setIncomingChatState(state);
@ -300,7 +304,7 @@ public class MessageParser extends AbstractParser implements
return; return;
} }
if (extractChatState(mXmppConnectionService.find(account, from), packet)) { if (extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), packet)) {
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
} }