mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
Don't fetch messages that arrived in the meantime if InboxWatch is
disabled and re-enabled That's another narrow-stitching patch for a scenario where many emails could be deleted all at once and surprisingly: user disables inbox-watch, enables delete-from-server, after a moth enables inbox-watch again -> currently all emails that arrived in the meantime will be deleted (if emails are not fetched, they won't be deleted)
This commit is contained in:
@@ -253,6 +253,16 @@ impl Context {
|
||||
job::schedule_resync(self).await;
|
||||
ret
|
||||
}
|
||||
Config::InboxWatch => {
|
||||
if self.get_config(Config::InboxWatch).await.as_deref() != value {
|
||||
// If Inbox-watch is disabled and then enabled again, we don't want
|
||||
// emails that arrived in the meantime to be fetched
|
||||
if let Some(inbox) = self.get_config(Config::ConfiguredInboxFolder).await {
|
||||
crate::imap::set_config_last_seen_uid(self, inbox, 0, 0).await;
|
||||
}
|
||||
}
|
||||
self.sql.set_raw_config(self, key, value).await
|
||||
}
|
||||
_ => self.sql.set_raw_config(self, key, value).await,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user