Bump Ruma w/ PushRule type optimizations.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-28 18:37:57 +00:00
parent af0e01e016
commit 3694ffbab3
5 changed files with 22 additions and 16 deletions

View File

@@ -335,7 +335,7 @@ pub(crate) async fn set_pushrule_actions_route(
if account_data
.content
.global
.set_actions(body.kind.clone(), &body.rule_id, body.actions.clone())
.set_actions(body.kind.clone(), &body.rule_id, body.actions.clone().into())
.is_err()
{
return Err!(Request(NotFound("Push rule not found.")));

View File

@@ -54,6 +54,7 @@ use tuwunel_core::{
future::{OptionStream, ReadyEqExt},
math::ruma_from_u64,
stream::{BroadbandExt, Tools, TryExpect, WidebandExt},
string::to_small_string,
},
warn,
};
@@ -218,7 +219,7 @@ async fn build_empty_response(
.count_one_time_keys(body.sender_user(), body.sender_device())
.await,
..sync_events::v3::Response::new(next_batch.to_string())
..sync_events::v3::Response::new(to_small_string(next_batch))
}
}
@@ -442,7 +443,7 @@ async fn build_sync_events(
device_one_time_keys_count,
// Fallback keys are not yet supported
device_unused_fallback_key_types: None,
next_batch: next_batch.to_string(),
next_batch: to_small_string(next_batch),
presence: Presence { events: presence_events },
rooms: Rooms {
leave: left_rooms,

View File

@@ -257,7 +257,9 @@ async fn db_lt_12(services: &Services) -> Result {
if let Some(rule) = rule {
let mut rule = rule.clone();
content_rule_transformation[1].clone_into(&mut rule.rule_id);
let mut rule_id = String::new();
content_rule_transformation[1].clone_into(&mut rule_id);
rule.rule_id = rule_id.into();
rules_list
.content
.shift_remove(content_rule_transformation[0]);
@@ -280,7 +282,9 @@ async fn db_lt_12(services: &Services) -> Result {
let rule = rules_list.underride.get(transformation[0]);
if let Some(rule) = rule {
let mut rule = rule.clone();
transformation[1].clone_into(&mut rule.rule_id);
let mut rule_id = String::new();
transformation[1].clone_into(&mut rule_id);
rule.rule_id = rule_id.into();
rules_list
.underride
.shift_remove(transformation[0]);