Fields in m.receipt are optional.

This commit is contained in:
Jimmy Cuadra 2019-06-13 17:34:03 -07:00
parent dd2e0afd47
commit c745db7eba

View File

@ -25,7 +25,7 @@ pub struct Receipts {
/// A collection of users who have sent *m.read* receipts for this event.
#[serde(rename = "m.read")]
#[serde(default)]
pub read: UserReceipts,
pub read: Option<UserReceipts>,
}
/// A mapping of user ID to receipt.
@ -37,5 +37,5 @@ pub type UserReceipts = HashMap<UserId, Receipt>;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Receipt {
/// The timestamp (milliseconds since the Unix epoch) when the receipt was sent.
pub ts: u64,
pub ts: Option<u64>,
}