aboutsummaryrefslogtreecommitdiff
path: root/src/imap/search.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-11 11:48:02 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-11 11:48:02 +0100
commitfbf2e9aa9670c991f5384350b2c78ad38dc3baf8 (patch)
tree51555e9c3371622fefd854c89ce887a8814fa0e1 /src/imap/search.rs
parent917c32ae0b6fa3161cebdfeec748b2db0bbc1c70 (diff)
downloadaerogramme-fbf2e9aa9670c991f5384350b2c78ad38dc3baf8.tar.gz
aerogramme-fbf2e9aa9670c991f5384350b2c78ad38dc3baf8.zip
Enable CONDSTORE if SEARCH MODSEQ is queried
Diffstat (limited to 'src/imap/search.rs')
-rw-r--r--src/imap/search.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/imap/search.rs b/src/imap/search.rs
index 12bad51..61cbad5 100644
--- a/src/imap/search.rs
+++ b/src/imap/search.rs
@@ -112,6 +112,17 @@ impl<'a> Criteria<'a> {
}
}
+ pub fn is_modseq(&self) -> bool {
+ use SearchKey::*;
+ match self.0 {
+ And(and_list) => and_list.as_ref().iter().any(|child| Criteria(child).is_modseq()),
+ Or(left, right) => Criteria(left).is_modseq() || Criteria(right).is_modseq(),
+ Not(child) => Criteria(child).is_modseq(),
+ ModSeq { .. } => true,
+ _ => false,
+ }
+ }
+
/// Returns emails that we now for sure we want to keep
/// but also a second list of emails we need to investigate further by
/// fetching some remote data