mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
api: expose Message-ID (aka rfc724_mid) in JSON-RPC API
This commit is contained in:
@@ -34,6 +34,10 @@ pub struct MessageObject {
|
|||||||
quote: Option<MessageQuote>,
|
quote: Option<MessageQuote>,
|
||||||
parent_id: Option<u32>,
|
parent_id: Option<u32>,
|
||||||
|
|
||||||
|
/// Contents of `Message-ID` header.
|
||||||
|
/// Possibly a fake unique string if incoming message did not have a `Message-ID` header.
|
||||||
|
message_id: String,
|
||||||
|
|
||||||
text: String,
|
text: String,
|
||||||
has_location: bool,
|
has_location: bool,
|
||||||
has_html: bool,
|
has_html: bool,
|
||||||
@@ -174,6 +178,8 @@ impl MessageObject {
|
|||||||
Some(reactions.into())
|
Some(reactions.into())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let message_id = message.rfc724_mid().to_string();
|
||||||
|
|
||||||
Ok(MessageObject {
|
Ok(MessageObject {
|
||||||
id: msg_id.to_u32(),
|
id: msg_id.to_u32(),
|
||||||
chat_id: message.get_chat_id().to_u32(),
|
chat_id: message.get_chat_id().to_u32(),
|
||||||
@@ -233,6 +239,8 @@ impl MessageObject {
|
|||||||
download_state,
|
download_state,
|
||||||
|
|
||||||
reactions,
|
reactions,
|
||||||
|
|
||||||
|
message_id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user