From bdfe64179bd0b5ef5598774ac510d1539efc2184 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 17 Oct 2024 11:46:22 +0200 Subject: [PATCH] feat(ffi): support custom membership state value in `MembershipState` --- bindings/matrix-sdk-ffi/src/room_member.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/matrix-sdk-ffi/src/room_member.rs b/bindings/matrix-sdk-ffi/src/room_member.rs index 03dc0b9165..36e40743f6 100644 --- a/bindings/matrix-sdk-ffi/src/room_member.rs +++ b/bindings/matrix-sdk-ffi/src/room_member.rs @@ -19,6 +19,9 @@ pub enum MembershipState { /// The user has left. Leave, + + /// A custom membership state value. + Custom { value: String }, } impl TryFrom for MembershipState { @@ -43,6 +46,9 @@ impl TryFrom for Member matrix_sdk::ruma::events::room::member::MembershipState::Leave => { Ok(MembershipState::Leave) } + matrix_sdk::ruma::events::room::member::MembershipState::_Custom(_) => { + Ok(MembershipState::Custom { value: m.to_string() }) + } _ => { tracing::warn!("Other membership state change not yet implemented"); Err(NotYetImplemented)