Skip to content

Commit

Permalink
improvement: add MessageQuote.chat_id
Browse files Browse the repository at this point in the history
For the "Reply Privately" feature.
  • Loading branch information
WofWca committed Jan 19, 2025
1 parent 0b9746b commit bc4cb30
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deltachat-jsonrpc/src/api/types/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ enum MessageQuote {
WithMessage {
text: String,
message_id: u32,
/// The quoted message does not always belong
/// to the parent message's chat, e.g. when "Reply Privately" is used.
/// If this is the case, chat_id is provided.
chat_id: Option<u32>,
author_display_name: String,
author_display_color: String,
override_sender_name: Option<String>,
Expand Down Expand Up @@ -147,6 +151,11 @@ impl MessageObject {
Some(MessageQuote::WithMessage {
text: quoted_text,
message_id: quote.get_id().to_u32(),
chat_id: if quote.get_chat_id() != message.get_chat_id() {
Some(quote.get_chat_id().to_u32())
} else {
None
},
author_display_name: quote_author.get_display_name().to_owned(),
author_display_color: color_int_to_hex_string(quote_author.get_color()),
override_sender_name: quote.get_override_sender_name(),
Expand Down

0 comments on commit bc4cb30

Please sign in to comment.