diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-09 22:53:12 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-09-10 21:19:38 +0300 |
commit | c0c588be9c39e5b1d1b1537e76b3c9a605b5fc43 (patch) | |
tree | ef7395e2719299b8e29f0ec8e2718791a9d7e14a /melib/src/backends | |
parent | be57b65dae81d74e5e0844ad367be41099c8806c (diff) |
melib/maildir: add message flag initialize in bytes
Maildir flags from filesystem path was not set correctly on Envelope
initialization in maildir backend
Diffstat (limited to 'melib/src/backends')
-rw-r--r-- | melib/src/backends/maildir/backend.rs | 6 | ||||
-rw-r--r-- | melib/src/backends/maildir/stream.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/melib/src/backends/maildir/backend.rs b/melib/src/backends/maildir/backend.rs index 1ff8a12c..b969acdb 100644 --- a/melib/src/backends/maildir/backend.rs +++ b/melib/src/backends/maildir/backend.rs @@ -280,7 +280,7 @@ impl MailBackend for MaildirType { } if let Ok(mut env) = Envelope::from_bytes( unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() }, - None, + Some(file.flags()), ) { env.set_hash(hash); mailbox_index @@ -488,7 +488,7 @@ impl MailBackend for MaildirType { unsafe { &Mmap::open_path(&pathbuf, Protection::Read)?.as_slice() }, - None, + Some(pathbuf.flags()), ) { env.set_hash(new_hash); debug!("{}\t{:?}", new_hash, &pathbuf); @@ -1162,7 +1162,7 @@ fn add_path_to_index( //Mmap::open_path(self.path(), Protection::Read)? let mut env = Envelope::from_bytes( unsafe { &Mmap::open_path(path, Protection::Read)?.as_slice() }, - None, + Some(path.flags()), )?; env.set_hash(env_hash); debug!( diff --git a/melib/src/backends/maildir/stream.rs b/melib/src/backends/maildir/stream.rs index 56ee61cd..8fd59fc9 100644 --- a/melib/src/backends/maildir/stream.rs +++ b/melib/src/backends/maildir/stream.rs @@ -148,7 +148,7 @@ impl MaildirStream { } match Envelope::from_bytes( unsafe { &Mmap::open_path(&file, Protection::Read)?.as_slice() }, - None, + Some(file.flags()), ) { Ok(mut env) => { env.set_hash(env_hash); |