Turn append_pdu args into struct PduBuilder

This commit is contained in:
Devin Ragotzy 2020-07-28 09:00:23 -04:00 committed by timokoesters
parent 1c6f211933
commit d948f896c0
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
4 changed files with 322 additions and 260 deletions

View file

@ -175,3 +175,15 @@ impl PduEvent {
serde_json::from_value(json).expect("Raw::from_value always works")
}
}
/// Build the start of a PDU in order to add it to the `Database`.
#[derive(Debug)]
pub struct PduBuilder {
pub room_id: RoomId,
pub sender: UserId,
pub event_type: EventType,
pub content: serde_json::Value,
pub unsigned: Option<serde_json::Map<String, serde_json::Value>>,
pub state_key: Option<String>,
pub redacts: Option<EventId>,
}