diff --git a/src/securejoin.rs b/src/securejoin.rs index 02abc14c5..c327096fc 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -1117,10 +1117,9 @@ mod tests { .unwrap(); // Bob scans QR-code, sends vc-request - let bob_chatid = dc_join_securejoin(&bob.ctx, &qr).await.unwrap(); + dc_join_securejoin(&bob.ctx, &qr).await.unwrap(); let sent = bob.pop_sent_msg().await; - assert_eq!(sent.id(), bob_chatid); assert_eq!(sent.recipient(), "alice@example.com".parse().unwrap()); let msg = alice.parse_msg(&sent).await; assert!(!msg.was_encrypted()); diff --git a/src/test_utils.rs b/src/test_utils.rs index 6e902a267..04ca9de63 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -17,7 +17,7 @@ use crate::dc_receive_imf::dc_receive_imf; use crate::dc_tools::EmailAddress; use crate::job::Action; use crate::key::{self, DcKey}; -use crate::message::Message; +use crate::message::{update_msg_state, Message, MessageState, MsgId}; use crate::mimeparser::MimeMessage; use crate::param::{Param, Params}; @@ -146,7 +146,7 @@ impl TestContext { panic!("no sent message found in jobs table"); } }; - let id = ChatId::new(foreign_id as u32); + let id = MsgId::new(foreign_id as u32); let params = Params::from_str(&raw_params).unwrap(); let blob_path = params .get_blob(Param::File, &self.ctx, false) @@ -159,11 +159,8 @@ impl TestContext { .execute("DELETE FROM jobs WHERE id=?;", paramsv![rowid]) .await .expect("failed to remove job"); - SentMessage { - id, - params, - blob_path, - } + update_msg_state(&self.ctx, id, MessageState::OutDelivered).await; + SentMessage { params, blob_path } } /// Parse a message. @@ -210,17 +207,11 @@ impl TestContext { /// passed through a SMTP-IMAP pipeline. #[derive(Debug, Clone)] pub struct SentMessage { - id: ChatId, params: Params, blob_path: PathBuf, } impl SentMessage { - /// The ChatId the message belonged to. - pub fn id(&self) -> ChatId { - self.id - } - /// A recipient the message was destined for. /// /// If there are multiple recipients this is just a random one, so is not very useful.