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