Skip to content

Commit 61f5b70

Browse files
committed
[fork] client-api: Extend MSC4383 Server with implementation metadata fields
Extend the upstream `Server` type with optional `commit`, `compiler`, `kernel`, and `arch` fields. These fields are not specified by MSC4383 and remain absent from the upstream PR; they parallel the same-named fields on the federation `Server` type used by tuwunel. Signed-off-by: Jason Volk <jason@zemos.net>
1 parent 09138a5 commit 61f5b70

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

crates/ruma-client-api/src/discovery/get_supported_versions.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pub struct Response {
5151

5252
/// Identifying information about the homeserver implementation.
5353
///
54+
/// The `commit`, `compiler`, `kernel`, and `arch` fields are additions outside
55+
/// MSC4383 and are always optional.
56+
///
5457
/// This uses the unstable prefix defined in [MSC4383].
5558
///
5659
/// [MSC4383]: https://github.com/matrix-org/matrix-spec-proposals/pull/4383
@@ -65,13 +68,29 @@ pub struct Server {
6568
///
6669
/// The version format depends on the implementation.
6770
pub version: String,
71+
72+
/// Sourcecode version.
73+
#[serde(default, skip_serializing_if = "Option::is_none")]
74+
pub commit: Option<String>,
75+
76+
/// Compiler version.
77+
#[serde(default, skip_serializing_if = "Option::is_none")]
78+
pub compiler: Option<String>,
79+
80+
/// System version.
81+
#[serde(default, skip_serializing_if = "Option::is_none")]
82+
pub kernel: Option<String>,
83+
84+
/// Hardware architecture.
85+
#[serde(default, skip_serializing_if = "Option::is_none")]
86+
pub arch: Option<String>,
6887
}
6988

7089
#[cfg(feature = "unstable-msc4383")]
7190
impl Server {
7291
/// Creates a `Server` with the given implementation `name` and `version`.
7392
pub fn new(name: String, version: String) -> Self {
74-
Self { name, version }
93+
Self { name, version, commit: None, compiler: None, kernel: None, arch: None }
7594
}
7695
}
7796

0 commit comments

Comments
 (0)