Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a784f1f authored by cketti's avatar cketti
Browse files

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.
parent 504062a5
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -1167,6 +1167,10 @@ public class MessagingController {
                l.folderStatusChanged(account, folderId);
                l.folderStatusChanged(account, folderId);
            }
            }


            if (flag == Flag.SEEN && newState) {
                cancelNotificationsForMessages(account, folderId, uids);
            }

            if (accountSupportsFlags) {
            if (accountSupportsFlags) {
                LocalFolder localFolder = localStore.getFolder(folderId);
                LocalFolder localFolder = localStore.getFolder(folderId);
                try {
                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.
     * Set or remove a flag for a set of messages in a specific folder.
     * <p>
     * <p>