Private
Public Access
1
0

xpc: include attachment guids

This commit is contained in:
2025-08-24 19:46:16 -07:00
parent f239d1de19
commit ee32a0398f

View File

@@ -155,6 +155,15 @@ pub async fn dispatch(
dict_put_str(&mut m, "text", &msg.text.replace('\u{FFFC}', "")); dict_put_str(&mut m, "text", &msg.text.replace('\u{FFFC}', ""));
dict_put_i64_as_str(&mut m, "date", msg.date.and_utc().timestamp()); dict_put_i64_as_str(&mut m, "date", msg.date.and_utc().timestamp());
dict_put_str(&mut m, "sender", &msg.sender.display_name()); dict_put_str(&mut m, "sender", &msg.sender.display_name());
// Include attachment GUIDs for the client to resolve/download
let attachment_guids: Vec<String> = msg
.attachments
.iter()
.map(|a| a.guid.clone())
.collect();
m.insert(cstr("attachment_guids"), array_from_strs(attachment_guids));
items.push(Message::Dictionary(m)); items.push(Message::Dictionary(m));
} }
let mut reply: XpcMap = HashMap::new(); let mut reply: XpcMap = HashMap::new();