federation-api: Minor fixes to create_join_event

This commit is contained in:
Jonas Platte 2020-11-18 19:36:32 +01:00
parent 34c4b6c110
commit d809066c9c
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
3 changed files with 16 additions and 11 deletions

View File

@ -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:

View File

@ -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<Pdu>,
pub pdu: Raw<Pdu>,
}
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<Pdu>) -> Self {
Self { room_id, event_id, pdu_stub }
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Raw<Pdu>) -> Self {
Self { room_id, event_id, pdu }
}
}

View File

@ -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<Pdu>,
pub pdu: Raw<Pdu>,
}
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<Pdu>) -> Self {
Self { room_id, event_id, pdu_stub }
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Raw<Pdu>) -> Self {
Self { room_id, event_id, pdu }
}
}