From 05eeba067ccb29acd576ce1e02705473c765d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 26 Jul 2021 15:55:44 +0200 Subject: [PATCH] base: Add docs to the newly public hoist and deserialize method --- matrix_sdk_base/src/client.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index 7c7497ea..399b5348 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -89,8 +89,8 @@ pub struct AdditionalUnsignedData { pub prev_content: Option>, } -/// Transform state event by hoisting `prev_content` field from `unsigned` to -/// the top level. +/// Transform an `AnySyncStateEvent` by hoisting `prev_content` field from +/// `unsigned` to the top level. /// /// Due to a [bug in synapse][synapse-bug], `prev_content` often ends up in /// `unsigned` contrary to the C2S spec. Some more discussion can be found @@ -129,6 +129,16 @@ fn hoist_member_event( Ok(e) } +/// Transform an `AnySyncRoomEvent` by hoisting `prev_content` field from +/// `unsigned` to the top level. +/// +/// Due to a [bug in synapse][synapse-bug], `prev_content` often ends up in +/// `unsigned` contrary to the C2S spec. Some more discussion can be found +/// [here][discussion]. Until this is fixed in synapse or handled in Ruma, we +/// use this to hoist up `prev_content` to the top level. +/// +/// [synapse-bug]: +/// [discussion]: pub fn hoist_room_event_prev_content( event: &Raw, ) -> StdResult {