Wrap PDUs in Raw on federation backfill endpoint

Wrap the PDU as done in all the other federation endpoints.
This commit is contained in:
gnieto 2021-01-17 16:57:30 +01:00 committed by GitHub
parent f5a0add846
commit a85b7031a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ Breaking Changes:
* Remove `PduStub` (it only existed because of the spec being misleading)
* Rename `pdu_stub` fields to `pdu`
* Upgrade dependencies
* Wrap `Pdu`s in `backfill::get_backfill` in `Raw`
Improvements:

View File

@ -6,6 +6,7 @@ use js_int::UInt;
use ruma_api::ruma_api;
use ruma_events::pdu::Pdu;
use ruma_identifiers::{EventId, RoomId, ServerNameBox};
use ruma_serde::Raw;
ruma_api! {
metadata: {
@ -40,7 +41,7 @@ ruma_api! {
pub origin_server_ts: SystemTime,
/// List of persistent updates to rooms.
pub pdus: Vec<Pdu>,
pub pdus: Vec<Raw<Pdu>>,
}
}
@ -59,7 +60,7 @@ impl Response {
/// * the `server_name` of the homeserver.
/// * the timestamp in milliseconds of when this transaction started.
/// * the list of persistent updates to rooms.
pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdus: Vec<Pdu>) -> Self {
pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdus: Vec<Raw<Pdu>>) -> Self {
Self { origin, origin_server_ts, pdus }
}
}