Merge pull request #5931 from k9mail/remove_notifications_on_action
Remove notification when message is marked as read or deleted
This commit is contained in:
commit
37e406ab50
1 changed files with 13 additions and 0 deletions
|
@ -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>
|
||||
|
@ -2050,6 +2061,8 @@ public class MessagingController {
|
|||
List<LocalMessage> syncedMessages = new ArrayList<>();
|
||||
List<String> syncedMessageUids = new ArrayList<>();
|
||||
for (LocalMessage message : messages) {
|
||||
notificationController.removeNewMailNotification(account, message.makeMessageReference());
|
||||
|
||||
String uid = message.getUid();
|
||||
if (uid.startsWith(K9.LOCAL_UID_PREFIX)) {
|
||||
localOnlyMessages.add(message);
|
||||
|
|
Loading…
Reference in a new issue