From acac994a18da9044e405cff85524fc1addda4ab4 Mon Sep 17 00:00:00 2001 From: Nathan Musoke Date: Thu, 25 Jan 2018 17:13:18 +1300 Subject: [PATCH] r0.3.0/login: Add device_id to request & response Version 0.3.0 of the client-server spec adds a `device_id` field to the login request and response. It is optional in the request. See https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-login for details. I don't think this will be backwards compatible with ruma-client. --- src/r0/session.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/r0/session.rs b/src/r0/session.rs index b08c9b85..386878d3 100644 --- a/src/r0/session.rs +++ b/src/r0/session.rs @@ -28,7 +28,10 @@ pub mod login { pub user: String, /// Third party identifier for the user. #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option + pub address: Option, + /// ID of the client device + #[serde(skip_serializing_if = "Option::is_none")] + pub device_id: Option, } response { @@ -42,6 +45,11 @@ pub mod login { pub refresh_token: Option, /// The fully-qualified Matrix ID that has been registered. pub user_id: UserId, + /// ID of the logged-in device. + /// + /// Will be the same as the corresponging parameter in the request, if one was + /// specified. + pub device_id: String, } }