mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Add IMAP UIDs to message info (#3755)
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
### Changes
|
### Changes
|
||||||
- add `configured_inbox_folder` to account info #3748
|
- add `configured_inbox_folder` to account info #3748
|
||||||
- `dc_delete_contact()` hides contacts if referenced #3751
|
- `dc_delete_contact()` hides contacts if referenced #3751
|
||||||
|
- add IMAP UIDs to message info #3755
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- improve IMAP logging, in particular fix incorrect "IMAP IDLE protocol
|
- improve IMAP logging, in particular fix incorrect "IMAP IDLE protocol
|
||||||
|
|||||||
@@ -1122,6 +1122,28 @@ pub async fn get_msg_info(context: &Context, msg_id: MsgId) -> Result<String> {
|
|||||||
}
|
}
|
||||||
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);
|
||||||
|
|
||||||
|
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
|
let hop_info: Option<String> = context
|
||||||
.sql
|
.sql
|
||||||
|
|||||||
Reference in New Issue
Block a user