diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-10 23:05:11 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-10 23:05:11 +0100 |
commit | 55c1129a651b1191273bbf8e49783a4798580375 (patch) | |
tree | c4c121fe01d304d8de86968d7172127e7f64df05 /src/main/java/eu/siacs/conversations/parser/MessageParser.java | |
parent | 2262921ff41f3e1b2108c4ab075bfbda27fe090f (diff) |
notify on mam catchup messages
Diffstat (limited to 'src/main/java/eu/siacs/conversations/parser/MessageParser.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 2c536f69..80886f7f 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -397,15 +397,21 @@ public class MessageParser extends AbstractParser implements } conversation.add(message); - if (query != null) { - query.incrementMessageCount(); - } else { + + if (query == null || query.getWith() == null) { //either no mam or catchup if (status == Message.STATUS_SEND || status == Message.STATUS_SEND_RECEIVED) { mXmppConnectionService.markRead(conversation); - account.activateGracePeriod(); + if (query == null) { + account.activateGracePeriod(); + } } else { message.markUnread(); } + } + + if (query != null) { + query.incrementMessageCount(); + } else { mXmppConnectionService.updateConversationUi(); } @@ -445,7 +451,11 @@ public class MessageParser extends AbstractParser implements if (message.trusted() && message.treatAsDownloadable() != Message.Decision.NEVER && manager.getAutoAcceptFileSize() > 0) { manager.createNewDownloadConnection(message); } else if (!message.isRead()) { - mXmppConnectionService.getNotificationService().push(message); + if (query == null) { + mXmppConnectionService.getNotificationService().push(message); + } else if (query.getWith() == null) { // mam catchup + mXmppConnectionService.getNotificationService().pushFromBacklog(message); + } } } else { //no body if (isTypeGroupChat) { |