initialise capabilities with default constructor
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e5735c81ed
commit
beeacd4ef1
1 changed files with 2 additions and 15 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue