Skip to content
Snippets Groups Projects
Commit 567b24e4 authored by 🥺's avatar 🥺 :transgender_flag: Committed by 🥺
Browse files

add `/_conduwuit/server_version` route

parent 4f1f6fa5
No related branches found
No related tags found
No related merge requests found
...@@ -76,6 +76,17 @@ pub async fn syncv3_client_server_json() -> Result<impl IntoResponse> { ...@@ -76,6 +76,17 @@ pub async fn syncv3_client_server_json() -> Result<impl IntoResponse> {
Ok(Json(serde_json::json!({ Ok(Json(serde_json::json!({
"server": server_url, "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<impl IntoResponse> {
Ok(Json(serde_json::json!({
"name": "Conduwuit",
"version": env!("CARGO_PKG_VERSION"),
}))) })))
} }
...@@ -779,6 +779,7 @@ fn routes() -> Router { ...@@ -779,6 +779,7 @@ fn routes() -> Router {
.ruma_route(server_server::get_keys_route) .ruma_route(server_server::get_keys_route)
.ruma_route(server_server::claim_keys_route) .ruma_route(server_server::claim_keys_route)
.ruma_route(server_server::get_hierarchy_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/r0/rooms/:room_id/initialSync", get(initial_sync))
.route("/_matrix/client/v3/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)) .route("/client/server.json", get(client_server::syncv3_client_server_json))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment