From a85b7031a30fd7046ae308a826826426ea449068 Mon Sep 17 00:00:00 2001 From: gnieto Date: Sun, 17 Jan 2021 16:57:30 +0100 Subject: [PATCH] Wrap PDUs in Raw on federation backfill endpoint Wrap the PDU as done in all the other federation endpoints. --- ruma-federation-api/CHANGELOG.md | 1 + ruma-federation-api/src/backfill/get_backfill/v1.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ruma-federation-api/CHANGELOG.md b/ruma-federation-api/CHANGELOG.md index bbfefaab..beea27f9 100644 --- a/ruma-federation-api/CHANGELOG.md +++ b/ruma-federation-api/CHANGELOG.md @@ -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: diff --git a/ruma-federation-api/src/backfill/get_backfill/v1.rs b/ruma-federation-api/src/backfill/get_backfill/v1.rs index 36a9ac76..51f5306a 100644 --- a/ruma-federation-api/src/backfill/get_backfill/v1.rs +++ b/ruma-federation-api/src/backfill/get_backfill/v1.rs @@ -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, + pub pdus: Vec>, } } @@ -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) -> Self { + pub fn new(origin: ServerNameBox, origin_server_ts: SystemTime, pdus: Vec>) -> Self { Self { origin, origin_server_ts, pdus } } }