From 879aeafa9e1e81e3816962c50d413d62e92d5840 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Mon, 9 Aug 2021 12:29:35 -0700 Subject: [PATCH] Add support for a minimal `r0/account/3pid`. --- src/client_server/account.rs | 12 +++++++----- src/main.rs | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client_server/account.rs b/src/client_server/account.rs index 87e3731..5d399b8 100644 --- a/src/client_server/account.rs +++ b/src/client_server/account.rs @@ -14,6 +14,7 @@ use ruma::{ change_password, deactivate, get_username_availability, register, whoami, ThirdPartyIdRemovalStatus, }, + contact::get_contacts, uiaa::{AuthFlow, UiaaInfo}, }, }, @@ -715,16 +716,17 @@ pub async fn deactivate_route( .into()) } -/*/ +/// # `GET _matrix/client/r0/account/3pid` +/// +/// Get a list of third party identifiers associated with this account. #[cfg_attr( feature = "conduit_bin", get("/_matrix/client/r0/account/3pid", data = "") )] pub async fn third_party_route( - body: Ruma>, -) -> ConduitResult { + body: Ruma, +) -> ConduitResult { let sender_user = body.sender_user.as_ref().expect("user is authenticated"); - Ok(account::add_3pid::Response::default().into()) + Ok(get_contacts::Response::new(Vec::new()).into()) } -*/ diff --git a/src/main.rs b/src/main.rs index 9f6cced..5a6f8c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,7 @@ fn setup_rocket(config: Figment, data: Arc>) -> rocket::Rocket< client_server::logout_all_route, client_server::change_password_route, client_server::deactivate_route, + client_server::third_party_route, client_server::get_capabilities_route, client_server::get_pushrules_all_route, client_server::set_pushrule_route,