~llndqvst/notmuch-mvrs

fb4a33808e4436c4b4f91f0b11227d2c0ed8f99e — Lukas Lindqvist 8 months ago 1f51690
squash! Add support for Maildir cur, tmp, and new
1 files changed, 9 insertions(+), 2 deletions(-)

M src/movers/mbsync.rs
M src/movers/mbsync.rs => src/movers/mbsync.rs +9 -2
@@ 36,8 36,15 @@ impl Mbsync {

    fn get_rename_pair(&self, from: PathBuf) -> (PathBuf, PathBuf) {
        let new_name: PathBuf = Mbsync::strip_uid(from.file_name().unwrap());
        let maildir_parent: PathBuf = from.parent().unwrap().to_path_buf();
        (from, self.target_path.join(maildir_parent).join(new_name))
        let mut f = from.clone();
        if f.pop() {
            let maildir_parent = f.file_name().unwrap();
            println!("target: {}, maildir_parent: {}", self.target_path.to_str().unwrap(), maildir_parent.to_str().unwrap());
            (from, self.target_path.join(maildir_parent).join(new_name))
        } else {
            println!("target: {}, ", self.target_path.to_str().unwrap());
            (from, self.target_path.join(new_name))
        }
    }
}