From daaa37f3a7513a4f844980d0ad743210b64ccecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Thu, 8 Apr 2021 13:55:23 +0200 Subject: [PATCH] fix incomplete copy/move (#75) --- CHANGELOG.md | 2 ++ src/msg/cli.rs | 4 ++-- src/msg/model.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3381aa1d..0a5469c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Unicode chars breaks the view [#71] +- Copy/move incomplete (missing parts) [#75] ### Added @@ -123,3 +124,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#41]: https://github.com/soywod/himalaya/issues/41 [#61]: https://github.com/soywod/himalaya/issues/61 [#71]: https://github.com/soywod/himalaya/issues/71 +[#75]: https://github.com/soywod/himalaya/issues/75 diff --git a/src/msg/cli.rs b/src/msg/cli.rs index 015afea8..34d54cb0 100644 --- a/src/msg/cli.rs +++ b/src/msg/cli.rs @@ -435,7 +435,7 @@ pub fn msg_matches(matches: &ArgMatches) -> Result<()> { let msg = Msg::from(imap_conn.read_msg(&mbox, &uid)?); let mut flags = msg.flags.deref().to_vec(); flags.push(Flag::Seen); - imap_conn.append_msg(target, &msg.to_vec()?, &flags)?; + imap_conn.append_msg(target, &msg.raw, &flags)?; imap_conn.logout(); return Ok(()); } @@ -447,7 +447,7 @@ pub fn msg_matches(matches: &ArgMatches) -> Result<()> { let msg = Msg::from(imap_conn.read_msg(&mbox, &uid)?); let mut flags = msg.flags.deref().to_vec(); flags.push(Flag::Seen); - imap_conn.append_msg(target, &msg.to_vec()?, msg.flags.deref())?; + imap_conn.append_msg(target, &msg.raw, msg.flags.deref())?; imap_conn.add_flags(mbox, uid, "\\Seen \\Deleted")?; imap_conn.logout(); return Ok(()); diff --git a/src/msg/model.rs b/src/msg/model.rs index 1e8bac0f..8e36b49c 100644 --- a/src/msg/model.rs +++ b/src/msg/model.rs @@ -182,7 +182,7 @@ pub struct Msg<'m> { #[serde(skip_serializing)] pub attachments: Vec, #[serde(skip_serializing)] - raw: Vec, + pub raw: Vec, } impl<'m> From> for Msg<'m> {