Add a constructor for create_room::Request

This commit is contained in:
Jonas Platte 2020-07-03 22:02:44 +02:00
parent 214c1b681f
commit ba95fd6c4e
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 21 additions and 0 deletions

View File

@ -24,6 +24,7 @@ Improvements:
* Add method `into_event_content` for `r0::room::create_room::CreationContent`
* Add room visibility endpoints: `r0::directory::{get_room_visibility, set_room_visibility}`.
* Add is_empty helpers for structs in `r0::sync::sync_events`
* Add a constructor for `r0::room::create_room::Request`
Deprecations:

View File

@ -92,6 +92,26 @@ ruma_api! {
error: crate::Error
}
impl Request {
/// Creates a `Request` will all-default parameters.
pub fn new() -> Self {
Self {
creation_content: None,
initial_state: Vec::new(),
invite: Vec::new(),
invite_3pid: Vec::new(),
is_direct: None,
name: None,
power_level_content_override: None,
preset: None,
room_alias_name: None,
room_version: None,
topic: None,
visibility: None,
}
}
}
/// Extra options to be added to the `m.room.create` event.
///
/// This is the same as the event content struct for `m.room.create`, but without some fields that