From beeacd4ef1b64fa97c1a05734045f586eec235f8 Mon Sep 17 00:00:00 2001 From: strawberry Date: Wed, 1 May 2024 00:00:22 -0400 Subject: [PATCH] initialise capabilities with default constructor Signed-off-by: strawberry --- src/api/client_server/capabilities.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/api/client_server/capabilities.rs b/src/api/client_server/capabilities.rs index 213430e1..f8572fe8 100644 --- a/src/api/client_server/capabilities.rs +++ b/src/api/client_server/capabilities.rs @@ -1,8 +1,7 @@ use std::collections::BTreeMap; use ruma::api::client::discovery::get_capabilities::{ - self, Capabilities, ChangePasswordCapability, RoomVersionStability, RoomVersionsCapability, SetAvatarUrlCapability, - SetDisplayNameCapability, ThirdPartyIdChangesCapability, + self, Capabilities, RoomVersionStability, RoomVersionsCapability, ThirdPartyIdChangesCapability, }; use crate::{services, Result, Ruma}; @@ -22,24 +21,12 @@ pub(crate) async fn get_capabilities_route( available.insert(room_version.clone(), RoomVersionStability::Stable); } - let mut capabilities = Capabilities::new(); + let mut capabilities = Capabilities::default(); capabilities.room_versions = RoomVersionsCapability { default: services().globals.default_room_version(), available, }; - capabilities.change_password = ChangePasswordCapability { - enabled: true, - }; - - capabilities.set_avatar_url = SetAvatarUrlCapability { - enabled: true, - }; - - capabilities.set_displayname = SetDisplayNameCapability { - enabled: true, - }; - // conduit does not implement 3PID stuff capabilities.thirdparty_id_changes = ThirdPartyIdChangesCapability { enabled: false,