Convert m.room.create to the new API.
This commit is contained in:
parent
5b505cc501
commit
0f49c5e7f6
@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
pub mod aliases;
|
pub mod aliases;
|
||||||
pub mod avatar;
|
pub mod avatar;
|
||||||
pub mod canonical_alias;
|
pub mod canonical_alias;
|
||||||
// pub mod create;
|
pub mod create;
|
||||||
// pub mod encrypted;
|
// pub mod encrypted;
|
||||||
pub mod encryption;
|
pub mod encryption;
|
||||||
pub mod guest_access;
|
pub mod guest_access;
|
||||||
|
@ -40,7 +40,7 @@ pub struct CanonicalAliasEvent {
|
|||||||
pub unsigned: Option<Value>,
|
pub unsigned: Option<Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The payload of a `CanonicalAliasEvent`.
|
/// The payload for `CanonicalAliasEvent`.
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize)]
|
||||||
pub struct CanonicalAliasEventContent {
|
pub struct CanonicalAliasEventContent {
|
||||||
/// The canonical alias.
|
/// The canonical alias.
|
||||||
|
@ -2,35 +2,35 @@
|
|||||||
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
use js_int::UInt;
|
use ruma_events_macros::ruma_event;
|
||||||
use ruma_identifiers::{EventId, RoomId, RoomVersionId, UserId};
|
use ruma_identifiers::{EventId, RoomId, RoomVersionId, UserId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::default_true;
|
use crate::default_true;
|
||||||
|
|
||||||
state_event! {
|
ruma_event! {
|
||||||
/// This is the first event in a room and cannot be changed. It acts as the root of all other
|
/// This is the first event in a room and cannot be changed. It acts as the root of all other
|
||||||
/// events.
|
/// events.
|
||||||
pub struct CreateEvent(CreateEventContent) {}
|
CreateEvent {
|
||||||
}
|
kind: StateEvent,
|
||||||
|
event_type: RoomCreate,
|
||||||
|
content: {
|
||||||
|
/// The `user_id` of the room creator. This is set by the homeserver.
|
||||||
|
pub creator: UserId,
|
||||||
|
|
||||||
/// The payload of a `CreateEvent`.
|
/// Whether or not this room's data should be transferred to other homeservers.
|
||||||
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
|
#[serde(rename = "m.federate")]
|
||||||
pub struct CreateEventContent {
|
#[serde(default = "default_true")]
|
||||||
/// The `user_id` of the room creator. This is set by the homeserver.
|
pub federate: bool,
|
||||||
pub creator: UserId,
|
|
||||||
|
|
||||||
/// Whether or not this room's data should be transferred to other homeservers.
|
/// The version of the room. Defaults to "1" if the key does not exist.
|
||||||
#[serde(rename = "m.federate")]
|
#[serde(default = "default_room_version_id")]
|
||||||
#[serde(default = "default_true")]
|
pub room_version: RoomVersionId,
|
||||||
pub federate: bool,
|
|
||||||
|
|
||||||
/// The version of the room. Defaults to "1" if the key does not exist.
|
/// A reference to the room this room replaces, if the previous room was upgraded.
|
||||||
#[serde(default = "default_room_version_id")]
|
pub predecessor: Option<PreviousRoom>,
|
||||||
pub room_version: RoomVersionId,
|
},
|
||||||
|
}
|
||||||
/// A reference to the room this room replaces, if the previous room was upgraded.
|
|
||||||
pub predecessor: Option<PreviousRoom>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A reference to an old room replaced during a room version upgrade.
|
/// A reference to an old room replaced during a room version upgrade.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user