mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 14:06:29 +03:00
Mark messages as seen in IMAP loop
MarkseenMsgOnImap job, that was responsible for marking messages as seen on IMAP and sending MDNs, has been removed. Messages waiting to be marked as seen are now stored in a single-column imap_markseen table consisting of foreign keys pointing to corresponding imap table records. Messages are marked as seen in batches in the inbox loop. UIDs are grouped by folders to reduce the number of requests, including folder selection requests. UID grouping logic has been factored out of move_delete_messages into UidGrouper iterator to avoid code duplication. Messages are marked as seen right before fetching from the inbox folder. This ensures that even if new messages arrive into inbox while the connection has another folder selected to mark messages there, all messages are fetched before going IDLE. Ideally marking messages as seen should be done after fetching and moving, as it is a low-priority task, but this requires skipping IDLE if UIDNEXT has advanced since previous time inbox has been selected. This is outside of the scope of this change. MDNs are now queued independently of marking the messages as seen. SendMdn job is created directly rather than after marking the message as seen on IMAP. Previously sending MDNs was done in MarkseenMsgOnImap avoid duplicate MDN sending by setting $MDNSent flag together with \Seen flag and skipping MDN sending if the flag is already set. This is not the case anymore as $MDNSent flag support has been removed in9c077c98cdand duplicate MDN sending in multi-device case is avoided by synchronizing Seen status since833e5f46ccas long as the server supports CONDSTORE extension.
This commit is contained in:
@@ -181,6 +181,7 @@ impl Sql {
|
||||
PRAGMA secure_delete=on;
|
||||
PRAGMA busy_timeout = {};
|
||||
PRAGMA temp_store=memory; -- Avoid SQLITE_IOERR_GETTEMPPATH errors on Android
|
||||
PRAGMA foreign_keys=on;
|
||||
",
|
||||
Duration::from_secs(10).as_millis()
|
||||
))?;
|
||||
|
||||
Reference in New Issue
Block a user