diff --git a/src/chat.rs b/src/chat.rs index c8fa0c411..48f22e44b 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1464,7 +1464,7 @@ pub async fn send_msg( } } msg.param.remove(Param::PrepForwards); - msg.save_param_to_disk(context).await; + msg.update_param(context).await; } return send_msg_inner(context, chat_id, msg).await; } @@ -2596,7 +2596,7 @@ pub async fn forward_msgs( .set(Param::PrepForwards, new_msg_id.to_u32().to_string()); } - msg.save_param_to_disk(context).await; + msg.update_param(context).await; msg.param = save_param; } else { msg.state = MessageState::OutPending; diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index d2628e9ab..1675cb73b 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -2327,6 +2327,8 @@ mod tests { #[async_std::test] async fn test_parse_ndn() { + use std::io::Write; + let t = dummy_context().await; t.ctx .set_config(Config::Addr, Some("alice@example.org")) @@ -2367,7 +2369,10 @@ mod tests { .await .unwrap(); + println!("Loading msg {}…", msg_id); let msg = Message::load_from_db(&t.ctx, msg_id).await.unwrap(); + std::io::stdout().flush().unwrap(); + assert_eq!(msg.state, MessageState::OutFailed); assert_eq!( msg.param.get(Param::Error), diff --git a/src/job.rs b/src/job.rs index 6eb4997f1..a5501ceb8 100644 --- a/src/job.rs +++ b/src/job.rs @@ -806,7 +806,7 @@ pub async fn send_msg_job(context: &Context, msg_id: MsgId) -> Result 0 { self.param.set_int(Param::Duration, duration); } - self.save_param_to_disk(context).await; + self.update_param(context).await; } - pub async fn save_param_to_disk(&mut self, context: &Context) -> bool { + pub async fn update_param(&mut self, context: &Context) -> bool { context .sql .execute( @@ -1256,7 +1256,7 @@ pub async fn set_msg_failed(context: &Context, msg_id: MsgId, error: Option { if let Some(first) = mail.subparts.iter().next() { @@ -878,7 +881,6 @@ impl MimeMessage { .iter() .find(|p| p.typ == Viewtype::Text) .map(|p| &p.msg); - info!(context, "msg_failed {:?}", error); message::ndn_from_ext(context, from_id, original_message_id, error).await } }