summaryrefslogtreecommitdiff
path: root/src/cmd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd.rs')
-rw-r--r--src/cmd.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd.rs b/src/cmd.rs
index 364fcfb..fdb8a5f 100644
--- a/src/cmd.rs
+++ b/src/cmd.rs
@@ -26,6 +26,7 @@ pub enum Return {
Count(CountInfo),
Search(Vec<Mail>),
Move,
+ Remove,
}
pub fn serialize_to<W>(res: Result<Return>, mut write: W) -> std::io::Result<()>
@@ -56,6 +57,7 @@ where
Ok(r)
}
Return::Move => ser.serialize_unit(),
+ Return::Remove => ser.serialize_unit(),
}?;
Ok(())
}
@@ -85,6 +87,12 @@ pub fn move_mail(p: PathBuf, mid: &str, from_f: &str, to_f: &str) -> Result<()>
from.move_to(mid, &to).map_err(|e| e.into())
}
+pub fn remove_mail(p: PathBuf, sub: &str, mid: &str) -> Result<()> {
+ let md = open_submaildir(p, sub);
+ dbg!(mid);
+ md.add_flags(mid, "T").map_err(|e| e.into())
+}
+
pub fn search(_md: &Maildir, _pattern: &str) -> Result<Vec<Mail>> {
todo!()
}