From 412452ea2e25b5ae9ab08f82a7046d21c73b8f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 22 Feb 2022 18:43:25 +0100 Subject: [PATCH] client-api: Add is_guest to account::whoami::Response According to MSC3069 --- crates/ruma-client-api/src/account/whoami.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ruma-client-api/src/account/whoami.rs b/crates/ruma-client-api/src/account/whoami.rs index 37512205..90c56d3d 100644 --- a/crates/ruma-client-api/src/account/whoami.rs +++ b/crates/ruma-client-api/src/account/whoami.rs @@ -30,6 +30,10 @@ pub mod v3 { /// The device ID associated with the access token, if any. #[serde(skip_serializing_if = "Option::is_none")] pub device_id: Option>, + + /// If `true`, the user is a guest user. + #[serde(default, skip_serializing_if = "ruma_serde::is_default")] + pub is_guest: bool, } error: crate::Error @@ -44,8 +48,8 @@ pub mod v3 { impl Response { /// Creates a new `Response` with the given user ID. - pub fn new(user_id: Box) -> Self { - Self { user_id, device_id: None } + pub fn new(user_id: Box, is_guest: bool) -> Self { + Self { user_id, device_id: None, is_guest } } } }