federation-api: Add V2 send join

This commit is contained in:
Bernardo Yusti 2020-07-24 17:12:27 -07:00 committed by GitHub
parent e01706d1bb
commit ea2992a412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 1 deletions

View File

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

View File

@ -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,
}
}