federation: Borrow more request fields
This commit is contained in:
parent
2bf17fd727
commit
ca49cf802d
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
Breaking changes:
|
Breaking changes:
|
||||||
|
|
||||||
* Replace `Raw<Pdu>` with `Box<RawJsonValue>`
|
* Replace `Raw<Pdu>` with `Box<RawJsonValue>` or `&RawJsonValue`
|
||||||
|
* Borrow more request fields
|
||||||
|
|
||||||
# 0.3.1
|
# 0.3.1
|
||||||
|
|
||||||
|
@ -19,20 +19,20 @@ ruma_api! {
|
|||||||
request: {
|
request: {
|
||||||
/// The room ID that the user is being invited to.
|
/// The room ID that the user is being invited to.
|
||||||
#[ruma_api(path)]
|
#[ruma_api(path)]
|
||||||
pub room_id: RoomId,
|
pub room_id: &'a RoomId,
|
||||||
|
|
||||||
/// The event ID for the invite event, generated by the inviting server.
|
/// The event ID for the invite event, generated by the inviting server.
|
||||||
#[ruma_api(path)]
|
#[ruma_api(path)]
|
||||||
pub event_id: EventId,
|
pub event_id: &'a EventId,
|
||||||
|
|
||||||
/// The version of the room where the user is being invited to.
|
/// The version of the room where the user is being invited to.
|
||||||
pub room_version: RoomVersionId,
|
pub room_version: &'a RoomVersionId,
|
||||||
|
|
||||||
/// The invite event which needs to be signed.
|
/// The invite event which needs to be signed.
|
||||||
pub event: Box<RawJsonValue>,
|
pub event: &'a RawJsonValue,
|
||||||
|
|
||||||
/// An optional list of simplified events to help the receiver of the invite identify the room.
|
/// An optional list of simplified events to help the receiver of the invite identify the room.
|
||||||
pub invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
|
pub invite_room_state: &'a [Raw<AnyStrippedStateEvent>],
|
||||||
}
|
}
|
||||||
|
|
||||||
response: {
|
response: {
|
||||||
@ -41,15 +41,15 @@ ruma_api! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Request {
|
impl<'a> Request<'a> {
|
||||||
/// Creates a new `Request` with the given room ID, event ID, room version, event and invite
|
/// Creates a new `Request` with the given room ID, event ID, room version, event and invite
|
||||||
/// room state.
|
/// room state.
|
||||||
pub fn new(
|
pub fn new(
|
||||||
room_id: RoomId,
|
room_id: &'a RoomId,
|
||||||
event_id: EventId,
|
event_id: &'a EventId,
|
||||||
room_version: RoomVersionId,
|
room_version: &'a RoomVersionId,
|
||||||
event: Box<RawJsonValue>,
|
event: &'a RawJsonValue,
|
||||||
invite_room_state: Vec<Raw<AnyStrippedStateEvent>>,
|
invite_room_state: &'a [Raw<AnyStrippedStateEvent>],
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self { room_id, event_id, room_version, event, invite_room_state }
|
Self { room_id, event_id, room_version, event, invite_room_state }
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ ruma_api! {
|
|||||||
|
|
||||||
/// The PDU.
|
/// The PDU.
|
||||||
#[ruma_api(body)]
|
#[ruma_api(body)]
|
||||||
pub pdu: Box<RawJsonValue>,
|
pub pdu: &'a RawJsonValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
response: {
|
response: {
|
||||||
@ -43,7 +43,7 @@ ruma_api! {
|
|||||||
|
|
||||||
impl<'a> Request<'a> {
|
impl<'a> Request<'a> {
|
||||||
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
||||||
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Box<RawJsonValue>) -> Self {
|
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: &'a RawJsonValue) -> Self {
|
||||||
Self { room_id, event_id, pdu }
|
Self { room_id, event_id, pdu }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ ruma_api! {
|
|||||||
|
|
||||||
/// The PDU.
|
/// The PDU.
|
||||||
#[ruma_api(body)]
|
#[ruma_api(body)]
|
||||||
pub pdu: Box<RawJsonValue>,
|
pub pdu: &'a RawJsonValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
response: {
|
response: {
|
||||||
@ -42,7 +42,7 @@ ruma_api! {
|
|||||||
|
|
||||||
impl<'a> Request<'a> {
|
impl<'a> Request<'a> {
|
||||||
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
||||||
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Box<RawJsonValue>) -> Self {
|
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: &'a RawJsonValue) -> Self {
|
||||||
Self { room_id, event_id, pdu }
|
Self { room_id, event_id, pdu }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ ruma_api! {
|
|||||||
|
|
||||||
/// The PDU.
|
/// The PDU.
|
||||||
#[ruma_api(body)]
|
#[ruma_api(body)]
|
||||||
pub pdu: Box<RawJsonValue>,
|
pub pdu: &'a RawJsonValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
@ -37,7 +37,7 @@ ruma_api! {
|
|||||||
|
|
||||||
impl<'a> Request<'a> {
|
impl<'a> Request<'a> {
|
||||||
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
/// Creates a new `Request` from the given room ID, event ID and PDU.
|
||||||
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: Box<RawJsonValue>) -> Self {
|
pub fn new(room_id: &'a RoomId, event_id: &'a EventId, pdu: &'a RawJsonValue) -> Self {
|
||||||
Self { room_id, event_id, pdu }
|
Self { room_id, event_id, pdu }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user