feat: message info: add database msg ID

We have recently removed it from the normal "message info" dialog
at least on Delta Chat Desktop, so without this one can't easily find
the ID of a particular message,
which is useful for debugging.
This commit is contained in:
WofWca
2026-05-29 15:33:14 +04:00
parent 0bc7849e8a
commit 7a60c79301
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -324,6 +324,7 @@ SELECT ?1, rfc724_mid, pre_rfc724_mid, timestamp, ?, ? FROM msgs WHERE id=?1
if duration != 0 { if duration != 0 {
ret += &format!("Duration: {duration} ms\n",); ret += &format!("Duration: {duration} ms\n",);
} }
ret += &format!("\nDatabase ID: {}", msg.id);
if !msg.rfc724_mid.is_empty() { if !msg.rfc724_mid.is_empty() {
ret += &format!("\nMessage-ID: {}", msg.rfc724_mid); ret += &format!("\nMessage-ID: {}", msg.rfc724_mid);
+6 -1
View File
@@ -41,6 +41,7 @@ async fn test_parse_receive_headers_integration() {
let raw = include_bytes!("../../test-data/message/mail_with_cc.txt"); let raw = include_bytes!("../../test-data/message/mail_with_cc.txt");
let expected = r"State: Fresh let expected = r"State: Fresh
Database ID: X
Message-ID: 2dfdbde7@example.org Message-ID: 2dfdbde7@example.org
Hop: From: localhost; By: hq5.merlinux.eu; Date: Sat, 14 Sep 2019 17:00:22 +0000 Hop: From: localhost; By: hq5.merlinux.eu; Date: Sat, 14 Sep 2019 17:00:22 +0000
@@ -50,6 +51,7 @@ Hop: From: hq5.merlinux.eu; By: hq5.merlinux.eu; Date: Sat, 14 Sep 2019 17:00:25
let raw = include_bytes!("../../test-data/message/encrypted_with_received_headers.eml"); let raw = include_bytes!("../../test-data/message/encrypted_with_received_headers.eml");
let expected = "State: Fresh, Encrypted let expected = "State: Fresh, Encrypted
Database ID: X
Message-ID: Mr.adQpEwndXLH.LPDdlFVJ7wG@example.net Message-ID: Mr.adQpEwndXLH.LPDdlFVJ7wG@example.net
Hop: From: [127.0.0.1]; By: mail.example.org; Date: Mon, 27 Dec 2021 11:21:21 +0000 Hop: From: [127.0.0.1]; By: mail.example.org; Date: Mon, 27 Dec 2021 11:21:21 +0000
@@ -71,7 +73,10 @@ async fn check_parse_receive_headers_integration(raw: &[u8], expected: &str) {
// received time that depends on the test time which makes it impossible to // received time that depends on the test time which makes it impossible to
// compare with a static string // compare with a static string
let capped_result = &msg_info[msg_info.find("State").unwrap()..]; let capped_result = &msg_info[msg_info.find("State").unwrap()..];
assert_eq!(expected, capped_result); assert_eq!(
expected.replace("\nDatabase ID: X", &format!("\nDatabase ID: {msg_id}")),
capped_result
);
} }
#[test] #[test]