convert_to_outgoing_federation_event takes CanonicalJsonObj

This commit is contained in:
Devin Ragotzy 2020-11-30 14:46:47 -05:00 committed by Timo Kösters
parent 27e686f9ff
commit c173ce43a5
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
3 changed files with 19 additions and 21 deletions

View file

@ -385,8 +385,8 @@ impl Rooms {
})
}
/// Returns the pdu.
pub fn get_pdu_json_from_id(&self, pdu_id: &[u8]) -> Result<Option<serde_json::Value>> {
/// Returns the pdu as a `BTreeMap<String, CanonicalJsonValue>`.
pub fn get_pdu_json_from_id(&self, pdu_id: &[u8]) -> Result<Option<CanonicalJsonObject>> {
self.pduid_pdu.get(pdu_id)?.map_or(Ok(None), |pdu| {
Ok(Some(
serde_json::from_slice(&pdu)