diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 5c90d416b0..9557f86bb6 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -974,12 +974,12 @@ async fn add_parts( .await?; let now = tools::time(); let update_config = if last_time.saturating_add(24 * 60 * 60) <= now { - let mut msg = Message::new(Viewtype::Text); - msg.text = stock_str::cant_decrypt_outgoing_msgs(context).await; - chat::add_device_msg(context, None, Some(&mut msg)) - .await - .log_err(context) - .ok(); + // let mut msg = Message::new(Viewtype::Text); + // msg.text = stock_str::cant_decrypt_outgoing_msgs(context).await; + // chat::add_device_msg(context, None, Some(&mut msg)) + // .await + // .log_err(context) + // .ok(); true } else { last_time > now diff --git a/src/receive_imf/tests.rs b/src/receive_imf/tests.rs index 283f7d56fc..ce42931f77 100644 --- a/src/receive_imf/tests.rs +++ b/src/receive_imf/tests.rs @@ -3152,41 +3152,41 @@ async fn test_blocked_contact_creates_group() -> Result<()> { Ok(()) } -#[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_outgoing_undecryptable() -> Result<()> { - let alice = &TestContext::new().await; - alice.configure_addr("alice@example.org").await; - - let raw = include_bytes!("../../test-data/message/thunderbird_with_autocrypt.eml"); - receive_imf(alice, raw, false).await?; - - let bob_contact_id = Contact::lookup_id_by_addr(alice, "bob@example.net", Origin::OutgoingTo) - .await? - .unwrap(); - assert!(ChatId::lookup_by_contact(alice, bob_contact_id) - .await? - .is_none()); - - let dev_chat_id = ChatId::lookup_by_contact(alice, ContactId::DEVICE) - .await? - .unwrap(); - let dev_msg = alice.get_last_msg_in(dev_chat_id).await; - assert!(dev_msg.error().is_none()); - assert!(dev_msg - .text - .contains(&stock_str::cant_decrypt_outgoing_msgs(alice).await)); - - let raw = include_bytes!("../../test-data/message/thunderbird_encrypted_signed.eml"); - receive_imf(alice, raw, false).await?; - - assert!(ChatId::lookup_by_contact(alice, bob_contact_id) - .await? - .is_none()); - // The device message mustn't be added too frequently. - assert_eq!(alice.get_last_msg_in(dev_chat_id).await.id, dev_msg.id); - - Ok(()) -} +// #[tokio::test(flavor = "multi_thread", worker_threads = 2)] +// async fn test_outgoing_undecryptable() -> Result<()> { +// let alice = &TestContext::new().await; +// alice.configure_addr("alice@example.org").await; + +// let raw = include_bytes!("../../test-data/message/thunderbird_with_autocrypt.eml"); +// receive_imf(alice, raw, false).await?; + +// let bob_contact_id = Contact::lookup_id_by_addr(alice, "bob@example.net", Origin::OutgoingTo) +// .await? +// .unwrap(); +// assert!(ChatId::lookup_by_contact(alice, bob_contact_id) +// .await? +// .is_none()); + +// let dev_chat_id = ChatId::lookup_by_contact(alice, ContactId::DEVICE) +// .await? +// .unwrap(); +// let dev_msg = alice.get_last_msg_in(dev_chat_id).await; +// assert!(dev_msg.error().is_none()); +// assert!(dev_msg +// .text +// .contains(&stock_str::cant_decrypt_outgoing_msgs(alice).await)); + +// let raw = include_bytes!("../../test-data/message/thunderbird_encrypted_signed.eml"); +// receive_imf(alice, raw, false).await?; + +// assert!(ChatId::lookup_by_contact(alice, bob_contact_id) +// .await? +// .is_none()); +// // The device message mustn't be added too frequently. +// assert_eq!(alice.get_last_msg_in(dev_chat_id).await.id, dev_msg.id); + +// Ok(()) +// } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_thunderbird_autocrypt() -> Result<()> { diff --git a/src/stock_str.rs b/src/stock_str.rs index 3f57efee95..bf8de246cb 100644 --- a/src/stock_str.rs +++ b/src/stock_str.rs @@ -751,7 +751,7 @@ pub(crate) async fn cant_decrypt_msg_body(context: &Context) -> String { } /// Stock string:`Got outgoing message(s) encrypted for another setup...`. -pub(crate) async fn cant_decrypt_outgoing_msgs(context: &Context) -> String { +pub async fn cant_decrypt_outgoing_msgs(context: &Context) -> String { translated(context, StockMessage::CantDecryptOutgoingMsgs).await }