aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/parser/MessageParser.java
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-02-04 18:02:03 +0100
committerChristian S <christian@pix-art.de>2016-02-04 18:02:03 +0100
commit14b688e0fbe62a0fef0fadcc20763faa21801d7a (patch)
tree37fc7b87aa21326b0ca7ba97fee84aaf0ea6d3c2 /src/main/java/eu/siacs/conversations/parser/MessageParser.java
parent9e96d80e31c5d0455c4b15984eef5709cf1071fc (diff)
parent91ec4839acef3e395e83815f211dd9771af1287e (diff)
Merge remote-tracking branch 'siacs/master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/parser/MessageParser.java')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 345e83958..3bf488316 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -271,7 +271,7 @@ public class MessageParser extends AbstractParser implements
packet = f.first;
isForwarded = true;
serverMsgId = result.getAttribute("id");
- query.incrementTotalCount();
+ query.incrementMessageCount();
} else if (query != null) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": received mam result from invalid sender");
return;
@@ -398,7 +398,11 @@ public class MessageParser extends AbstractParser implements
return;
}
- conversation.add(message);
+ if (query != null && query.getPagingOrder() == MessageArchiveService.PagingOrder.REVERSE) {
+ conversation.prepend(message);
+ } else {
+ conversation.add(message);
+ }
if (query == null || query.getWith() == null) { //either no mam or catchup
if (status == Message.STATUS_SEND || status == Message.STATUS_SEND_RECEIVED) {
@@ -411,9 +415,7 @@ public class MessageParser extends AbstractParser implements
}
}
- if (query != null) {
- query.incrementMessageCount();
- } else {
+ if (query == null) {
mXmppConnectionService.updateConversationUi();
}
@@ -454,7 +456,7 @@ public class MessageParser extends AbstractParser implements
mXmppConnectionService.getNotificationService().pushFromBacklog(message);
}
}
- } else { //no body
+ } else if (!packet.hasChild("body")){ //no body
if (isTypeGroupChat) {
Conversation conversation = mXmppConnectionService.find(account, from.toBareJid());
if (packet.hasChild("subject")) {