fix: don't send new events from left rooms

This commit is contained in:
Timo Kösters 2020-10-27 20:25:43 +01:00
parent 2f5df4aac9
commit 0762196963
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
6 changed files with 79 additions and 48 deletions

View file

@ -103,6 +103,7 @@ pub async fn leave_room_route(
ErrorKind::BadState,
"Cannot leave a room you are not a member of.",
))?
.1
.content,
)
.expect("from_value::<Raw<..>> can never fail")
@ -193,6 +194,7 @@ pub async fn kick_user_route(
ErrorKind::BadState,
"Cannot kick member that's not in the room.",
))?
.1
.content,
)
.expect("Raw::from_value always works")
@ -249,7 +251,7 @@ pub async fn ban_user_route(
is_direct: None,
third_party_invite: None,
}),
|event| {
|(_, event)| {
let mut event =
serde_json::from_value::<Raw<member::MemberEventContent>>(event.content)
.expect("Raw::from_value always works")
@ -301,6 +303,7 @@ pub async fn unban_user_route(
ErrorKind::BadState,
"Cannot unban a user who is not banned.",
))?
.1
.content,
)
.expect("from_value::<Raw<..>> can never fail")