Skip to content

Commit

Permalink
feat(ffi): support custom membership state value in MembershipState
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Oct 17, 2024
1 parent 154a690 commit b74371b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bindings/matrix-sdk-ffi/src/room_member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pub enum MembershipState {

/// The user has left.
Leave,

/// A custom membership state value.
Custom(String),
}

/// Something has not been implemented yet.
Expand Down Expand Up @@ -48,6 +51,9 @@ impl TryFrom<matrix_sdk::ruma::events::room::member::MembershipState> for Member
matrix_sdk::ruma::events::room::member::MembershipState::Leave => {
Ok(MembershipState::Leave)
}
matrix_sdk::ruma::events::room::member::MembershipState::_Custom(_) => {
Ok(MembershipState::Custom(m.to_string()))
}
_ => {
tracing::warn!("Other membership state change not yet implemented");
Err(NotYetImplemented)
Expand Down

0 comments on commit b74371b

Please sign in to comment.