federation-api: Update origin field type

This commit is contained in:
Jonas Platte 2020-08-12 22:40:43 +02:00
parent c6e625a85f
commit edc38b340c
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -5,7 +5,7 @@ use std::time::SystemTime;
use js_int::UInt;
use ruma_api::ruma_api;
use ruma_events::pdu::Pdu;
use ruma_identifiers::{EventId, RoomId};
use ruma_identifiers::{EventId, RoomId, ServerName};
ruma_api! {
metadata: {
@ -33,7 +33,7 @@ ruma_api! {
response: {
/// The `server_name` of the homeserver sending this transaction.
pub origin: String,
pub origin: Box<ServerName>,
/// POSIX timestamp in milliseconds on originating homeserver when this transaction started.
#[serde(with = "ruma_serde::time::ms_since_unix_epoch")]
@ -59,7 +59,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: String, origin_server_ts: SystemTime, pdus: Vec<Pdu>) -> Self {
pub fn new(origin: Box<ServerName>, origin_server_ts: SystemTime, pdus: Vec<Pdu>) -> Self {
Self { origin, origin_server_ts, pdus }
}
}