refactor for ruma identifiers optimizations

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-12-28 23:31:24 +00:00 committed by strawberry
parent d91570d0e6
commit 0a9b6c136f
19 changed files with 81 additions and 88 deletions

View file

@ -1,5 +1,5 @@
use conduwuit::{err, implement, pdu::gen_event_id_canonical_json, result::FlatOk, Result};
use ruma::{CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId};
use ruma::{CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId};
use serde_json::value::RawValue as RawJsonValue;
#[implement(super::Service)]
@ -14,7 +14,7 @@ pub async fn parse_incoming_pdu(
let room_id: OwnedRoomId = value
.get("room_id")
.and_then(CanonicalJsonValue::as_str)
.map(RoomId::parse)
.map(OwnedRoomId::parse)
.flat_ok_or(err!(Request(InvalidParam("Invalid room_id in pdu"))))?;
let room_version_id = self