Add IMAP UIDs to message info (#3755)

This commit is contained in:
link2xt
2022-11-15 17:19:32 +03:00
committed by GitHub
parent ee34b64f5d
commit 428ef11157
2 changed files with 23 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
### Changes
- add `configured_inbox_folder` to account info #3748
- `dc_delete_contact()` hides contacts if referenced #3751
- add IMAP UIDs to message info #3755
### Fixes
- improve IMAP logging, in particular fix incorrect "IMAP IDLE protocol

View File

@@ -1122,6 +1122,28 @@ pub async fn get_msg_info(context: &Context, msg_id: MsgId) -> Result<String> {
}
if !msg.rfc724_mid.is_empty() {
ret += &format!("\nMessage-ID: {}", msg.rfc724_mid);
let server_uids = context
.sql
.query_map(
"SELECT folder, uid FROM imap WHERE rfc724_mid=?",
paramsv![msg.rfc724_mid],
|row| {
let folder: String = row.get("folder")?;
let uid: u32 = row.get("uid")?;
Ok((folder, uid))
},
|rows| {
rows.collect::<std::result::Result<Vec<_>, _>>()
.map_err(Into::into)
},
)
.await?;
for (folder, uid) in server_uids {
// Format as RFC 5092 relative IMAP URL.
ret += &format!("\n</{}/;UID={}>", folder, uid);
}
}
let hop_info: Option<String> = context
.sql