diff --git a/ruma-federation-api/CHANGELOG.md b/ruma-federation-api/CHANGELOG.md index 864476de..56a8fa9a 100644 --- a/ruma-federation-api/CHANGELOG.md +++ b/ruma-federation-api/CHANGELOG.md @@ -16,7 +16,7 @@ Improvements: get_server_version::v1 }, membership::{ - create_join_event::v1, + create_join_event::{v1, v2}, create_join_event_template::v1 }, openid::{ diff --git a/ruma-federation-api/src/membership/create_join_event/v2.rs b/ruma-federation-api/src/membership/create_join_event/v2.rs new file mode 100644 index 00000000..dfb1eb39 --- /dev/null +++ b/ruma-federation-api/src/membership/create_join_event/v2.rs @@ -0,0 +1,36 @@ +//! [PUT /_matrix/federation/v2/send_join/{roomId}/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v2-send-join-roomid-eventid) + +use ruma_api::ruma_api; +use ruma_events::pdu::PduStub; +use ruma_identifiers::{EventId, RoomId}; + +use super::RoomState; + +ruma_api! { + metadata: { + description: "Send a join event to a resident server.", + name: "create_join_event", + method: PUT, + path: "/_matrix/federation/v2/send_join/:room_id/:event_id", + rate_limited: false, + requires_authentication: true, + } + + request: { + /// The room ID that is about to be joined. + #[ruma_api(path)] + pub room_id: RoomId, + /// The user ID the join event will be for. + #[ruma_api(path)] + pub event_id: EventId, + + /// PDU type without event and room IDs. + #[ruma_api(body)] + pub pdu_stub: PduStub, + } + + response: { + /// Full state of the room. + pub room_state: RoomState, + } +}