diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c22b20fc..f2bfdb37c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.72.0 +### Changes +- use webxdc app name in chatlist/quotes/replies etc. #3027 + ### Fixes - run migrations on backup import #3006 diff --git a/src/summary.rs b/src/summary.rs index 2257bb36e..d26c89377 100644 --- a/src/summary.rs +++ b/src/summary.rs @@ -139,7 +139,10 @@ impl Message { } Viewtype::Webxdc => { append_text = true; - "Webxdc".to_string() + self.get_webxdc_info(context) + .await + .map(|info| info.name) + .unwrap_or_else(|_| "ErrWebxdcName".to_string()) } Viewtype::Text | Viewtype::Unknown => { if self.param.get_cmd() != SystemMessage::LocationOnly { diff --git a/src/webxdc.rs b/src/webxdc.rs index 9961ca724..4b83804f0 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -488,6 +488,7 @@ mod tests { add_contact_to_chat, create_group_chat, forward_msgs, send_msg, send_text_msg, ChatId, ProtectionStatus, }; + use crate::chatlist::Chatlist; use crate::contact::Contact; use crate::dc_receive_imf::dc_receive_imf; use crate::test_utils::TestContext; @@ -1514,4 +1515,24 @@ sth_for_the = "future""# Ok(()) } + + #[async_std::test] + async fn test_webxdc_chatlist_summary() -> Result<()> { + let t = TestContext::new_alice().await; + let chat_id = create_group_chat(&t, ProtectionStatus::Unprotected, "chat").await?; + let mut instance = create_webxdc_instance( + &t, + "with-minimal-manifest.xdc", + include_bytes!("../test-data/webxdc/with-minimal-manifest.xdc"), + ) + .await?; + send_msg(&t, chat_id, &mut instance).await?; + + let chatlist = Chatlist::try_load(&t, 0, None, None).await?; + assert_eq!(chatlist.len(), 1); + let summary = chatlist.get_summary(&t, 0, None).await?; + assert_eq!(summary.text, "nice app!".to_string()); + + Ok(()) + } }