From f8eedfe44d5bb09ee828800e87cf4138d6b7458f Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Fri, 5 Feb 2021 13:49:12 +0100 Subject: [PATCH] client-api: use authentication for profile api for synapse --- ruma-client-api/Cargo.toml | 1 + ruma-client-api/src/r0/profile/get_avatar_url.rs | 3 +++ ruma-client-api/src/r0/profile/get_display_name.rs | 3 +++ ruma-client-api/src/r0/profile/get_profile.rs | 3 +++ 4 files changed, 10 insertions(+) diff --git a/ruma-client-api/Cargo.toml b/ruma-client-api/Cargo.toml index 47256d4c..a8e98b69 100644 --- a/ruma-client-api/Cargo.toml +++ b/ruma-client-api/Cargo.toml @@ -36,3 +36,4 @@ matches = "0.1.8" [features] unstable-exhaustive-types = [] unstable-pre-spec = [] +unstable-synapse-quirks = [] diff --git a/ruma-client-api/src/r0/profile/get_avatar_url.rs b/ruma-client-api/src/r0/profile/get_avatar_url.rs index 427492ca..0abe2c9f 100644 --- a/ruma-client-api/src/r0/profile/get_avatar_url.rs +++ b/ruma-client-api/src/r0/profile/get_avatar_url.rs @@ -10,7 +10,10 @@ ruma_api! { name: "get_avatar_url", path: "/_matrix/client/r0/profile/:user_id/avatar_url", rate_limited: false, + #[cfg(not(feature = "unstable-synapse-quirks"))] authentication: None, + #[cfg(feature = "unstable-synapse-quirks")] + authentication: AccessToken, } request: { diff --git a/ruma-client-api/src/r0/profile/get_display_name.rs b/ruma-client-api/src/r0/profile/get_display_name.rs index a1e517a9..ecd471c6 100644 --- a/ruma-client-api/src/r0/profile/get_display_name.rs +++ b/ruma-client-api/src/r0/profile/get_display_name.rs @@ -10,7 +10,10 @@ ruma_api! { name: "get_display_name", path: "/_matrix/client/r0/profile/:user_id/displayname", rate_limited: false, + #[cfg(not(feature = "unstable-synapse-quirks"))] authentication: None, + #[cfg(feature = "unstable-synapse-quirks")] + authentication: AccessToken, } request: { diff --git a/ruma-client-api/src/r0/profile/get_profile.rs b/ruma-client-api/src/r0/profile/get_profile.rs index 7605b44f..ad6ea6bd 100644 --- a/ruma-client-api/src/r0/profile/get_profile.rs +++ b/ruma-client-api/src/r0/profile/get_profile.rs @@ -10,7 +10,10 @@ ruma_api! { name: "get_profile", path: "/_matrix/client/r0/profile/:user_id", rate_limited: false, + #[cfg(not(feature = "unstable-synapse-quirks"))] authentication: None, + #[cfg(feature = "unstable-synapse-quirks")] + authentication: AccessToken, } request: {