aboutsummaryrefslogtreecommitdiff
path: root/src/mailbox.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-14 18:06:42 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-14 18:06:42 +0200
commitd7823a6dbf2a30223f528dfe03767f8c854849fa (patch)
treeb024bb212b9c283bc60ca490fd31a286c6e8db92 /src/mailbox.rs
parentda6881199cd6f477fe2fc10fbbc6484e84ea6513 (diff)
downloadaerogramme-d7823a6dbf2a30223f528dfe03767f8c854849fa.tar.gz
aerogramme-d7823a6dbf2a30223f528dfe03767f8c854849fa.zip
Add a flag cache
Diffstat (limited to 'src/mailbox.rs')
-rw-r--r--src/mailbox.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mailbox.rs b/src/mailbox.rs
index 43ff5ca..349a13b 100644
--- a/src/mailbox.rs
+++ b/src/mailbox.rs
@@ -55,7 +55,7 @@ impl Mailbox {
return Ok(Summary {
validity: state.uidvalidity,
next: state.uidnext,
- exists: state.mail_uid.len(),
+ exists: state.idx_by_uid.len(),
});
}
@@ -74,12 +74,12 @@ impl Mailbox {
dump(&self.uid_index);
- if self.uid_index.state().mails_by_uid.len() > 6 {
+ if self.uid_index.state().idx_by_uid.len() > 6 {
for i in 0..2 {
let (_, uuid) = self
.uid_index
.state()
- .mails_by_uid
+ .idx_by_uid
.iter()
.skip(3 + i)
.next()
@@ -101,16 +101,12 @@ fn dump(uid_index: &Bayou<UidIndex>) {
println!("UIDVALIDITY {}", s.uidvalidity);
println!("UIDNEXT {}", s.uidnext);
println!("INTERNALSEQ {}", s.internalseq);
- for (uid, uuid) in s.mails_by_uid.iter() {
+ for (uid, ident) in s.idx_by_uid.iter() {
println!(
"{} {} {}",
uid,
- hex::encode(uuid.0),
- s.mail_flags
- .get(uuid)
- .cloned()
- .unwrap_or_default()
- .join(", ")
+ hex::encode(ident.0),
+ s.table.get(ident).cloned().unwrap_or_default().1.join(", ")
);
}
println!("");