Skip to content

Commit

Permalink
matrix_sdk_base: expose RoomMember
Browse files Browse the repository at this point in the history
  • Loading branch information
martinetd committed Oct 8, 2020
1 parent bc48674 commit f7039d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion matrix_sdk_base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mod state;

pub use client::{BaseClient, BaseClientConfig, RoomState, RoomStateType};
pub use event_emitter::{CustomEvent, EventEmitter, SyncRoom};
pub use models::Room;
pub use models::{Room, RoomMember};
pub use state::{AllRooms, ClientState};

#[cfg(feature = "encryption")]
Expand Down
8 changes: 8 additions & 0 deletions matrix_sdk_base/src/models/room_member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ impl PartialEq for RoomMember {
}

impl RoomMember {
/// Create a new room member.
///
/// # Arguments
///
/// * `event` - event associated with a member joining, leaving or getting
/// invited to a room.
///
/// * `room_id` - The unique id of the room this member is part of.
pub fn new(event: &SyncStateEvent<MemberEventContent>, room_id: &RoomId) -> Self {
Self {
name: event.state_key.clone(),
Expand Down

0 comments on commit f7039d9

Please sign in to comment.