use multiget for shortid conversions

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-22 16:01:27 +00:00
parent 3789d60b6a
commit c519a40cb8
3 changed files with 86 additions and 70 deletions

View file

@ -41,7 +41,10 @@ use serde::Deserialize;
use self::data::Data;
use crate::{
rooms,
rooms::{short::ShortStateHash, state::RoomMutexGuard},
rooms::{
short::{ShortEventId, ShortStateHash, ShortStateKey},
state::RoomMutexGuard,
},
Dep,
};
@ -102,6 +105,13 @@ impl Service {
self.db.state_full_ids(shortstatehash).await
}
#[inline]
pub async fn state_full_shortids(
&self, shortstatehash: ShortStateHash,
) -> Result<Vec<(ShortStateKey, ShortEventId)>> {
self.db.state_full_shortids(shortstatehash).await
}
pub async fn state_full(
&self, shortstatehash: ShortStateHash,
) -> Result<HashMap<(StateEventType, String), Arc<PduEvent>>> {