diff --git a/src/api/client_server/unversioned.rs b/src/api/client_server/unversioned.rs index 523983a4..652fb8ca 100644 --- a/src/api/client_server/unversioned.rs +++ b/src/api/client_server/unversioned.rs @@ -76,6 +76,17 @@ pub async fn syncv3_client_server_json() -> Result { Ok(Json(serde_json::json!({ "server": server_url, - "version": format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")) + "version": format!("Conduwuit {}", env!("CARGO_PKG_VERSION")) + }))) +} + +/// # `GET /_conduwuit/server_version` +/// +/// Conduwuit-specific API to get the server version, results akin to +/// `/_matrix/federation/v1/version` +pub async fn conduwuit_server_version() -> Result { + Ok(Json(serde_json::json!({ + "name": "Conduwuit", + "version": env!("CARGO_PKG_VERSION"), }))) } diff --git a/src/main.rs b/src/main.rs index bf0f5486..149b1157 100644 --- a/src/main.rs +++ b/src/main.rs @@ -779,6 +779,7 @@ fn routes() -> Router { .ruma_route(server_server::get_keys_route) .ruma_route(server_server::claim_keys_route) .ruma_route(server_server::get_hierarchy_route) + .route("/_conduwuit/server_version", get(client_server::conduwuit_server_version)) .route("/_matrix/client/r0/rooms/:room_id/initialSync", get(initial_sync)) .route("/_matrix/client/v3/rooms/:room_id/initialSync", get(initial_sync)) .route("/client/server.json", get(client_server::syncv3_client_server_json))