jsonrpc: add message errors to MessageObject

This commit is contained in:
link2xt
2022-11-29 17:21:08 +00:00
committed by holger krekel
parent 6c4d919828
commit f2c97bda66
2 changed files with 5 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
### API-Changes
- Add Python API to send reactions #3762
- jsonrpc: add message errors to MessageObject #3788
### Fixes
- Make sure malformed messsages will never block receiving further messages anymore #3771

View File

@@ -34,6 +34,9 @@ pub struct MessageObject {
view_type: MessageViewtype,
state: u32,
/// An error text, if there is one.
error: Option<String>,
timestamp: i64,
sort_timestamp: i64,
received_timestamp: i64,
@@ -167,6 +170,7 @@ impl MessageObject {
.get_state()
.to_u32()
.ok_or_else(|| anyhow!("state conversion to number failed"))?,
error: message.error(),
timestamp: message.get_timestamp(),
sort_timestamp: message.get_sort_timestamp(),