From b00361d27420cf18844dd71ed120092447f95bb7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 4 Aug 2025 03:29:56 +0000 Subject: [PATCH] Add specific shorteventid to shortstatehash query function. Signed-off-by: Jason Volk --- src/service/rooms/state_accessor/state.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/service/rooms/state_accessor/state.rs b/src/service/rooms/state_accessor/state.rs index 7c0c7a45..c83b687a 100644 --- a/src/service/rooms/state_accessor/state.rs +++ b/src/service/rooms/state_accessor/state.rs @@ -420,19 +420,24 @@ async fn load_full_state(&self, shortstatehash: ShortStateHash) -> Result Result { - const BUFSIZE: usize = size_of::(); - self.services .short .get_shorteventid(event_id) - .and_then(|shorteventid| { - self.db - .shorteventid_shortstatehash - .aqry::(&shorteventid) - }) + .and_then(|shorteventid| self.get_shortstatehash(shorteventid)) + .await +} + +/// Returns the state hash at this event. +#[implement(super::Service)] +pub async fn get_shortstatehash(&self, shorteventid: ShortEventId) -> Result { + const BUFSIZE: usize = size_of::(); + + self.db + .shorteventid_shortstatehash + .aqry::(&shorteventid) .await .deserialized() }