Skip to content

Commit 2e6c228

Browse files
committed
api: jsonrpc: add full_message_view_type to Message and
`MessageInfo`
1 parent aee3281 commit 2e6c228

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

deltachat-jsonrpc/src/api/types/message.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub struct MessageObject {
4848
has_location: bool,
4949
has_html: bool,
5050
view_type: MessageViewtype,
51+
/// If message is a pre-message,
52+
/// then this returns the viewtype it will have when it is downloaded.
53+
full_message_view_type: Option<MessageViewtype>,
5154
state: u32,
5255

5356
/// An error text, if there is one.
@@ -92,6 +95,8 @@ pub struct MessageObject {
9295

9396
file: Option<String>,
9497
file_mime: Option<String>,
98+
/// Returns the size of the file in bytes, if applicable.
99+
/// If message is a pre-message, then this returns size of the to be downloaded file.
95100
file_bytes: u64,
96101
file_name: Option<String>,
97102

@@ -210,6 +215,7 @@ impl MessageObject {
210215
has_location: message.has_location(),
211216
has_html: message.has_html(),
212217
view_type: message.get_viewtype().into(),
218+
full_message_view_type: message.get_full_message_viewtype().map(Into::into),
213219
state: message
214220
.get_state()
215221
.to_u32()
@@ -681,6 +687,9 @@ pub struct MessageInfo {
681687
rfc724_mid: String,
682688
server_urls: Vec<String>,
683689
hop_info: String,
690+
/// If message is a pre-message,
691+
/// then this returns the viewtype it will have when it is downloaded.
692+
full_message_view_type: Option<MessageViewtype>,
684693
}
685694

686695
impl MessageInfo {
@@ -704,6 +713,7 @@ impl MessageInfo {
704713
rfc724_mid: message.rfc724_mid().to_owned(),
705714
server_urls,
706715
hop_info,
716+
full_message_view_type: message.get_full_message_viewtype().map(Into::into),
707717
})
708718
}
709719
}

0 commit comments

Comments
 (0)