Browse Source

melib/maildir: add message flag initialize in bytes

Maildir flags from filesystem path was not set correctly on Envelope
initialization in maildir backend
master
Manos Pitsidianakis 2 years ago
parent
commit
c0c588be9c
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 6
      melib/src/backends/maildir/backend.rs
  2. 2
      melib/src/backends/maildir/stream.rs

6
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!(

2
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);

Loading…
Cancel
Save