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
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>,
}