Use Raw<Pdu> in get_event Response over Pdu
This commit is contained in:
parent
e8882fe814
commit
f17c5fc619
@ -1,9 +1,11 @@
|
|||||||
//! [GET /_matrix/federation/v1/event/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#get-matrix-federation-v1-event-eventid)
|
//! [GET /_matrix/federation/v1/event/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#get-matrix-federation-v1-event-eventid)
|
||||||
|
|
||||||
|
use std::time::SystemTime;
|
||||||
|
|
||||||
use ruma_api::ruma_api;
|
use ruma_api::ruma_api;
|
||||||
use ruma_events::pdu::Pdu;
|
use ruma_events::pdu::Pdu;
|
||||||
use ruma_identifiers::{EventId, ServerNameBox};
|
use ruma_identifiers::{EventId, ServerNameBox};
|
||||||
use std::time::SystemTime;
|
use ruma_serde::Raw;
|
||||||
|
|
||||||
ruma_api! {
|
ruma_api! {
|
||||||
metadata: {
|
metadata: {
|
||||||
@ -31,7 +33,7 @@ ruma_api! {
|
|||||||
|
|
||||||
/// The event.
|
/// The event.
|
||||||
#[serde(rename = "pdus", with = "ruma_serde::single_element_seq")]
|
#[serde(rename = "pdus", with = "ruma_serde::single_element_seq")]
|
||||||
pub pdu: Pdu,
|
pub pdu: Raw<Pdu>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ impl<'a> Request<'a> {
|
|||||||
|
|
||||||
impl Response {
|
impl Response {
|
||||||
/// Creates a new `Response` with the given server name, timestamp, and event.
|
/// Creates a new `Response` with the given server name, timestamp, and event.
|
||||||
pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdu: Pdu) -> Self {
|
pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdu: Raw<Pdu>) -> Self {
|
||||||
Self { origin, origin_server_ts, pdu }
|
Self { origin, origin_server_ts, pdu }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user