diff options
author | lookshe <github@lookshe.org> | 2016-03-17 23:08:58 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-03-17 23:08:58 +0100 |
commit | b5d1ee194c25b0e4c0f0ad6c68c4390fbbc85e4c (patch) | |
tree | 04fe0f966830c00f0753e543c524db299b44d9aa /src/main/java/de/thedevstack/conversationsplus/parser | |
parent | cb55d2af52c1007b577b1bb1f94a4206aec58ef0 (diff) |
Fixes FS#156 and FS#135 (occured again)
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/parser')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java index e64fe6a4..39e06bf6 100644 --- a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java +++ b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java @@ -431,7 +431,10 @@ public class MessageParser extends AbstractParser implements account.activateGracePeriod(); } } else { - message.markUnread(); + // only not mam messages should be marked as unread + if (query == null) { + message.markUnread(); + } } } @@ -453,17 +456,20 @@ public class MessageParser extends AbstractParser implements if (message.getEncryption() == Message.ENCRYPTION_NONE || !ConversationsPlusPreferences.dontSaveEncrypted()) { mXmppConnectionService.databaseBackend.createMessage(message); } - final HttpConnectionManager manager = this.mXmppConnectionService.getHttpConnectionManager(); if (message.trusted() && message.treatAsDownloadable() != Message.Decision.NEVER && ConversationsPlusPreferences.autoAcceptFileSize() > 0 && ConversationsPlusPreferences.autoDownloadFileLink()) { - manager.createNewDownloadConnection(message); + this.mXmppConnectionService.getHttpConnectionManager().createNewDownloadConnection(message); } else { if (query == null) { mXmppConnectionService.getNotificationService().push(message); } else if (query.getWith() == null) { // mam catchup - mXmppConnectionService.getNotificationService().pushFromBacklog(message); + /* + Like suggested in https://bugs.thedevstack.de/task/156 user should be notified + in some other way of loaded messages. + */ + // mXmppConnectionService.getNotificationService().pushFromBacklog(message); } } } else if (!packet.hasChild("body")){ //no body |