diff --git a/ruma-federation-api/CHANGELOG.md b/ruma-federation-api/CHANGELOG.md index a955c286..70a65310 100644 --- a/ruma-federation-api/CHANGELOG.md +++ b/ruma-federation-api/CHANGELOG.md @@ -5,7 +5,8 @@ Breaking Changes: * Replace `directory::get_public_rooms::v1::{PublicRoomsChunk, RoomNetwork}` with types from `ruma_common::directory` * Wrap `PduStub`s in `membership::create_join_event` in `Raw` -* Use `Pdu` instead of `PduStub` in `membership::create_join_event` endpoints +* Remove `PduStub` (it only existed because of the spec being misleading) + * Rename `pdu_stub` fields to `pdu` Improvements: diff --git a/ruma-federation-api/src/membership/create_join_event/v1.rs b/ruma-federation-api/src/membership/create_join_event/v1.rs index db5df191..1749ec91 100644 --- a/ruma-federation-api/src/membership/create_join_event/v1.rs +++ b/ruma-federation-api/src/membership/create_join_event/v1.rs @@ -19,16 +19,18 @@ ruma_api! { request: { /// The room ID that is about to be joined. + /// + /// Do not use this. Instead, use the `room_id` field inside the PDU. #[ruma_api(path)] pub room_id: &'a RoomId, - /// The user ID the join event will be for. + /// The event ID for the join event. #[ruma_api(path)] pub event_id: &'a EventId, - /// PDU type + /// The PDU. #[ruma_api(body)] - pub pdu_stub: Raw, + pub pdu: Raw, } response: { @@ -41,8 +43,8 @@ ruma_api! { impl<'a> Request<'a> { /// Creates a `Request` from the given room ID, event ID and `Pdu`. - pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu_stub: Raw) -> Self { - Self { room_id, event_id, pdu_stub } + pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Raw) -> Self { + Self { room_id, event_id, pdu } } } diff --git a/ruma-federation-api/src/membership/create_join_event/v2.rs b/ruma-federation-api/src/membership/create_join_event/v2.rs index 21918ee6..caf347dc 100644 --- a/ruma-federation-api/src/membership/create_join_event/v2.rs +++ b/ruma-federation-api/src/membership/create_join_event/v2.rs @@ -19,16 +19,18 @@ ruma_api! { request: { /// The room ID that is about to be joined. + /// + /// Do not use this. Instead, use the `room_id` field inside the PDU. #[ruma_api(path)] pub room_id: &'a RoomId, - /// The user ID the join event will be for. + /// The event ID for the join event. #[ruma_api(path)] pub event_id: &'a EventId, - /// PDU type + /// The PDU. #[ruma_api(body)] - pub pdu_stub: Raw, + pub pdu: Raw, } response: { @@ -40,8 +42,8 @@ ruma_api! { impl<'a> Request<'a> { /// Creates a `Request` from the given room ID, event ID and `Pdu`. - pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu_stub: Raw) -> Self { - Self { room_id, event_id, pdu_stub } + pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Raw) -> Self { + Self { room_id, event_id, pdu } } }