aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/MessageArchiveService.java3
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java4
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
index f6d3a2fa..8847cfcd 100644
--- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
+++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java
@@ -218,6 +218,9 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
if (complete || relevant == null || abort) {
this.finalizeQuery(query);
Log.d(Config.LOGTAG,query.getAccount().getJid().toBareJid().toString()+": finished mam after "+query.getTotalCount()+" messages");
+ if (query.getWith() == null && query.getTotalCount() > 0) {
+ mXmppConnectionService.getNotificationService().finishBacklog(true);
+ }
} else {
final Query nextQuery;
if (query.getPagingOrder() == PagingOrder.NORMAL) {
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 03ab6f63..e8dec815 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -119,10 +119,10 @@ public class NotificationService {
}
}
- public void finishBacklog() {
+ public void finishBacklog(boolean notify) {
synchronized (notifications) {
mXmppConnectionService.updateUnreadCountBadge();
- updateNotification(false);
+ updateNotification(notify);
}
}
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 790e035c..1a0153e5 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1107,7 +1107,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
});
}
- mNotificationService.finishBacklog();
+ mNotificationService.finishBacklog(false);
mRestoredFromDatabase = true;
Log.d(Config.LOGTAG, "restored all messages");
updateConversationUi();