Skip to main content

tuwunel_api/client/account/3pid/
third_party.rs

1use axum::extract::State;
2use futures::StreamExt;
3use ruma::api::client::account::get_3pids::{self, v3::Response};
4use tuwunel_core::Result;
5
6use crate::Ruma;
7
8/// # `GET _matrix/client/v3/account/3pid`
9///
10/// Get the third party identifiers bound to this account.
11pub(crate) async fn third_party_route(
12	State(services): State<crate::State>,
13	body: Ruma<get_3pids::v3::Request>,
14) -> Result<Response> {
15	let threepids = services
16		.threepid
17		.get_bindings(body.sender_user())
18		.collect()
19		.await;
20
21	Ok(Response::new(threepids))
22}