From 94dd352cc577a79456dc3ebef1eb3c411e7ed8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 23 Feb 2022 11:26:29 +0100 Subject: [PATCH] federation-api: Add cross-signing fields to get_devices::Response --- .../src/device/get_devices.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/ruma-federation-api/src/device/get_devices.rs b/crates/ruma-federation-api/src/device/get_devices.rs index df7a44bd..3541df7b 100644 --- a/crates/ruma-federation-api/src/device/get_devices.rs +++ b/crates/ruma-federation-api/src/device/get_devices.rs @@ -9,7 +9,7 @@ pub mod v1 { use js_int::UInt; use ruma_api::ruma_api; - use ruma_common::encryption::DeviceKeys; + use ruma_common::encryption::{CrossSigningKey, DeviceKeys}; use ruma_identifiers::{DeviceId, UserId}; use ruma_serde::Raw; use serde::{Deserialize, Serialize}; @@ -45,6 +45,14 @@ pub mod v1 { /// The user's devices. pub devices: Vec, + + /// The user's master key. + #[serde(skip_serializing_if = "Option::is_none")] + pub master_key: Option>, + + /// The users's self-signing key. + #[serde(skip_serializing_if = "Option::is_none")] + pub self_signing_key: Option>, } } @@ -60,7 +68,13 @@ pub mod v1 { /// /// The device list will be empty. pub fn new(user_id: Box, stream_id: UInt) -> Self { - Self { user_id, stream_id, devices: Vec::new() } + Self { + user_id, + stream_id, + devices: Vec::new(), + master_key: None, + self_signing_key: None, + } } }