Remove 'new message' notification when user marks the message as read

We already handled the case where the message was marked as read on the server. This handles the case where the user marks the message as read locally.
This commit is contained in:
cketti 2022-02-22 02:18:27 +01:00
parent 504062a533
commit 7a784f1fcd

View file

@ -1167,6 +1167,10 @@ public class MessagingController {
l.folderStatusChanged(account, folderId);
}
if (flag == Flag.SEEN && newState) {
cancelNotificationsForMessages(account, folderId, uids);
}
if (accountSupportsFlags) {
LocalFolder localFolder = localStore.getFolder(folderId);
try {
@ -1183,6 +1187,13 @@ public class MessagingController {
}
}
private void cancelNotificationsForMessages(Account account, long folderId, List<String> uids) {
for (String uid : uids) {
MessageReference messageReference = new MessageReference(account.getUuid(), folderId, uid);
notificationController.removeNewMailNotification(account, messageReference);
}
}
/**
* Set or remove a flag for a set of messages in a specific folder.
* <p>