summaryrefslogtreecommitdiff
path: root/src/cmd/move.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/move.rs')
-rw-r--r--src/cmd/move.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/move.rs b/src/cmd/move.rs
new file mode 100644
index 0000000..c852d6c
--- /dev/null
+++ b/src/cmd/move.rs
@@ -0,0 +1,19 @@
+use crate::cmd::{open_submaildir, MailStorage};
+use crate::de_jmhoffmann_jwebmail_mailstorage::Call_Move;
+
+pub fn r#move(
+ ms: &MailStorage,
+ call: &mut dyn Call_Move,
+ mid: String,
+ from_folder: String,
+ to_folder: String,
+) -> varlink::Result<()> {
+ if let Some(p) = ms.maildir_path.read().unwrap().clone() {
+ let from = open_submaildir(p.clone(), &from_folder);
+ let to = open_submaildir(p, &to_folder);
+ from.move_to(&mid, &to).unwrap();
+ call.reply()
+ } else {
+ call.reply_not_initialized()
+ }
+}