add type-safe accessors to account_data service

This commit is contained in:
Olivia Lee 2025-03-23 15:17:19 -07:00
parent b82458a460
commit 88ad596e8d
No known key found for this signature in database
GPG key ID: 54D568A15B9CD1F9
12 changed files with 202 additions and 179 deletions

View file

@ -773,15 +773,9 @@ impl Service {
// Initial account data
services().account_data.update_global(
&user_id,
&ruma::events::GlobalAccountDataEventType::PushRules,
&Raw::new(
&PushRulesEventContent {
global: ruma::push::Ruleset::server_default(
&user_id,
),
}
.into(),
)
&Raw::new(&PushRulesEventContent {
global: ruma::push::Ruleset::server_default(&user_id),
})
.expect("json serialization should always succeed"),
)?;