aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/services/MessageArchiveService.java20
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java
index 8611bf873..f0d48a86f 100644
--- a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java
+++ b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java
@@ -300,6 +300,26 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
}
}
+ public void kill(Conversation conversation) {
+ synchronized (this.queries) {
+ for (Query q : queries) {
+ if (q.conversation == conversation) {
+ kill(q);
+ }
+ }
+ }
+ }
+
+ private void kill(Query query) {
+ Log.d(Config.LOGTAG, query.getAccount().getJid().toBareJid() + ": killing mam query prematurely");
+ query.callback = null;
+ this.finalizeQuery(query, false);
+ if (query.isCatchup() && query.getActualMessageCount() > 0) {
+ mXmppConnectionService.getNotificationService().finishBacklog(true, query.getAccount());
+ }
+ this.processPostponed(query);
+ }
+
private void processPostponed(Query query) {
query.account.getAxolotlService().processPostponed();
Log.d(Config.LOGTAG, query.getAccount().getJid().toBareJid() + ": found " + query.pendingReceiptRequests.size() + " pending receipt requests");
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index afa24f671..96c80c93d 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -1978,6 +1978,7 @@ public class XmppConnectionService extends Service {
getNotificationService().clear(conversation);
conversation.setStatus(Conversation.STATUS_ARCHIVED);
synchronized (this.conversations) {
+ getMessageArchiveService().kill(conversation);
if (conversation.getMode() == Conversation.MODE_MULTI) {
if (conversation.getAccount().getStatus() == Account.State.ONLINE) {
Bookmark bookmark = conversation.getBookmark();