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 59c47fb commit bdfe641
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 { value: String },
}

impl TryFrom<matrix_sdk::ruma::events::room::member::MembershipState> for MembershipState {
Expand All @@ -43,6 +46,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 { value: m.to_string() })
}
_ => {
tracing::warn!("Other membership state change not yet implemented");
Err(NotYetImplemented)
Expand Down

0 comments on commit bdfe641

Please sign in to comment.