2022-01-22 16:58:32 +01:00
|
|
|
use std::collections::BTreeMap;
|
2024-03-05 19:48:54 -05:00
|
|
|
|
2025-04-04 03:30:13 +00:00
|
|
|
use conduwuit::Result;
|
2022-02-18 15:33:14 +01:00
|
|
|
use ruma::api::client::thirdparty::get_protocols;
|
2020-07-30 18:14:47 +02:00
|
|
|
|
2025-04-04 03:30:13 +00:00
|
|
|
use crate::{Ruma, RumaResponse};
|
2020-07-30 18:14:47 +02:00
|
|
|
|
2021-08-31 19:14:37 +02:00
|
|
|
/// # `GET /_matrix/client/r0/thirdparty/protocols`
|
|
|
|
///
|
|
|
|
/// TODO: Fetches all metadata about protocols supported by the homeserver.
|
2024-04-22 23:48:57 -04:00
|
|
|
pub(crate) async fn get_protocols_route(
|
|
|
|
_body: Ruma<get_protocols::v3::Request>,
|
|
|
|
) -> Result<get_protocols::v3::Response> {
|
2021-03-23 22:01:14 +01:00
|
|
|
// TODO
|
2024-12-15 00:05:47 -05:00
|
|
|
Ok(get_protocols::v3::Response { protocols: BTreeMap::new() })
|
2020-07-30 18:14:47 +02:00
|
|
|
}
|
2024-07-05 16:39:57 -04:00
|
|
|
|
|
|
|
/// # `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)
|
|
|
|
}
|