fix: do not allow to edit html messages (#6564)

closes https://github.com/deltachat/deltachat-core-rust/issues/6561
This commit is contained in:
bjoern
2025-02-22 20:51:44 +01:00
committed by GitHub
parent f94b21d4aa
commit 3d7ac9d2a1
2 changed files with 19 additions and 0 deletions

View File

@@ -3710,3 +3710,21 @@ async fn test_receive_edit_request_after_removal() -> Result<()> {
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_cannot_edit_html() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
let chat = alice.create_chat(bob).await;
let mut msg = Message::new_text("plain text".to_string());
msg.set_html(Some("<b>html</b> text".to_string()));
send_msg(alice, chat.id, &mut msg).await.unwrap();
assert!(msg.has_html());
assert!(send_edit_request(alice, msg.id, "foo".to_string())
.await
.is_err());
Ok(())
}