count all messages in a query

This commit is contained in:
Daniel Gultsch 2016-02-03 16:04:21 +01:00
parent 1274b0ef39
commit 0911669b07
2 changed files with 3 additions and 8 deletions

View File

@ -271,7 +271,7 @@ public class MessageParser extends AbstractParser implements
packet = f.first; packet = f.first;
isForwarded = true; isForwarded = true;
serverMsgId = result.getAttribute("id"); serverMsgId = result.getAttribute("id");
query.incrementTotalCount(); query.incrementMessageCount();
} else if (query != null) { } else if (query != null) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": received mam result from invalid sender"); Log.d(Config.LOGTAG,account.getJid().toBareJid()+": received mam result from invalid sender");
return; return;
@ -411,9 +411,7 @@ public class MessageParser extends AbstractParser implements
} }
} }
if (query != null) { if (query == null) {
query.incrementMessageCount();
} else {
mXmppConnectionService.updateConversationUi(); mXmppConnectionService.updateConversationUi();
} }

View File

@ -345,12 +345,9 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
return this.account; return this.account;
} }
public void incrementTotalCount() {
this.totalCount++;
}
public void incrementMessageCount() { public void incrementMessageCount() {
this.messageCount++; this.messageCount++;
this.totalCount++;
} }
public int getTotalCount() { public int getTotalCount() {