base_client: only swap prev_content if outer is None
parent
86a01a0ca6
commit
ac4698f0d6
|
@ -85,22 +85,15 @@ fn deserialize_prev_content(event: &EventJson<RoomEvent>) -> Option<EventJson<Ro
|
||||||
.map(|more_unsigned| more_unsigned.unsigned)
|
.map(|more_unsigned| more_unsigned.unsigned)
|
||||||
.map(|additional| additional.prev_content)
|
.map(|additional| additional.prev_content)
|
||||||
.ok()
|
.ok()
|
||||||
.flatten();
|
.flatten()?;
|
||||||
|
|
||||||
if let Ok(mut ev) = event.deserialize() {
|
let mut ev = event.deserialize().ok()?;
|
||||||
if let Some(prev) = prev_content {
|
match &mut ev {
|
||||||
match &mut ev {
|
RoomEvent::RoomMember(ref mut member) if member.prev_content.is_none() => {
|
||||||
RoomEvent::RoomMember(ref mut member) => {
|
member.prev_content = prev_content.deserialize().ok();
|
||||||
member.prev_content = prev.deserialize().ok();
|
Some(EventJson::from(ev))
|
||||||
Some(EventJson::from(ev))
|
|
||||||
}
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
} else {
|
_ => None,
|
||||||
None
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue