diff --git a/src/api/client/thirdparty.rs b/src/api/client/thirdparty.rs index de24c0ec783c078ef13afdca97530f3da98057b1..f6af8729c3ff1b87d610c5d7bba03b7577449067 100644 --- a/src/api/client/thirdparty.rs +++ b/src/api/client/thirdparty.rs @@ -2,7 +2,7 @@ use ruma::api::client::thirdparty::get_protocols; -use crate::{Result, Ruma}; +use crate::{Result, Ruma, RumaResponse}; /// # `GET /_matrix/client/r0/thirdparty/protocols` /// @@ -15,3 +15,13 @@ pub(crate) async fn get_protocols_route( protocols: BTreeMap::new(), }) } + +/// # `GET /_matrix/client/unstable/thirdparty/protocols` +/// +/// Same as `get_protocols_route`, except for some reason Element Android legacy +/// calls this +pub(crate) async fn get_protocols_route_unstable( + body: Ruma<get_protocols::v3::Request>, +) -> Result<RumaResponse<get_protocols::v3::Response>> { + get_protocols_route(body).await.map(RumaResponse) +} diff --git a/src/api/routes.rs b/src/api/routes.rs index 94951aecac969f2cff46420ef39a4248fb620b68..b22a32cb9bf2294f501125b0e4aae12493e2bffd 100644 --- a/src/api/routes.rs +++ b/src/api/routes.rs @@ -94,6 +94,8 @@ pub fn build(router: Router, server: &Server) -> Router { .ruma_route(client::search_users_route) .ruma_route(client::get_member_events_route) .ruma_route(client::get_protocols_route) + .route("/_matrix/client/unstable/thirdparty/protocols", + get(client::get_protocols_route_unstable)) .ruma_route(client::send_message_event_route) .ruma_route(client::send_state_event_for_key_route) .ruma_route(client::get_state_events_route)