MessageParser: don't refresh view after parsing chat state when combined with message

This commit is contained in:
Daniel Gultsch 2017-11-21 16:17:27 +01:00
parent 381fe82b01
commit 4596cad3cb
1 changed files with 10 additions and 4 deletions

View File

@ -415,10 +415,6 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
return; return;
} }
if (query == null && extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), isTypeGroupChat, packet)) {
mXmppConnectionService.updateConversationUi();
}
if ((body != null || pgpEncrypted != null || axolotlEncrypted != null || oobUrl != null) && !isMucStatusMessage) { if ((body != null || pgpEncrypted != null || axolotlEncrypted != null || oobUrl != null) && !isMucStatusMessage) {
final Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, counterpart.toBareJid(), isTypeGroupChat, false, query, false); final Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, counterpart.toBareJid(), isTypeGroupChat, false, query, false);
final boolean conversationMultiMode = conversation.getMode() == Conversation.MODE_MULTI; final boolean conversationMultiMode = conversation.getMode() == Conversation.MODE_MULTI;
@ -471,6 +467,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
message = parseAxolotlChat(axolotlEncrypted, origin, conversation, status); message = parseAxolotlChat(axolotlEncrypted, origin, conversation, status);
if (message == null) { if (message == null) {
if (query == null && extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), isTypeGroupChat, packet)) {
mXmppConnectionService.updateConversationUi();
}
return; return;
} }
if (conversationMultiMode) { if (conversationMultiMode) {
@ -543,6 +542,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
if (replacedMessage.getStatus() == Message.STATUS_RECEIVED) { if (replacedMessage.getStatus() == Message.STATUS_RECEIVED) {
replacedMessage.markUnread(); replacedMessage.markUnread();
} }
extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), isTypeGroupChat, packet);
mXmppConnectionService.updateMessage(replacedMessage, uuid); mXmppConnectionService.updateMessage(replacedMessage, uuid);
mXmppConnectionService.getNotificationService().updateNotification(false); mXmppConnectionService.getNotificationService().updateNotification(false);
if (mXmppConnectionService.confirmMessages() if (mXmppConnectionService.confirmMessages()
@ -604,6 +604,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
if (query == null) { if (query == null) {
extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), isTypeGroupChat, packet);
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
} }
@ -634,6 +635,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
} }
} }
} else if (!packet.hasChild("body")) { //no body } else if (!packet.hasChild("body")) { //no body
if (query == null && extractChatState(mXmppConnectionService.find(account, counterpart.toBareJid()), isTypeGroupChat, packet)) {
mXmppConnectionService.updateConversationUi();
}
final Conversation conversation = mXmppConnectionService.find(account, from.toBareJid()); final Conversation conversation = mXmppConnectionService.find(account, from.toBareJid());
if (isTypeGroupChat) { if (isTypeGroupChat) {
if (packet.hasChild("subject")) { if (packet.hasChild("subject")) {