matrix-sdk: Return the members response in our get members method.

master
Damir Jelić 2020-11-24 10:56:07 +01:00
parent e84d3b9950
commit c13d04ae18
1 changed files with 5 additions and 3 deletions

View File

@ -70,7 +70,8 @@ use matrix_sdk_common::{
filter::{create_filter::Request as FilterUploadRequest, FilterDefinition}, filter::{create_filter::Request as FilterUploadRequest, FilterDefinition},
media::create_content, media::create_content,
membership::{ membership::{
ban_user, forget_room, get_member_events, ban_user, forget_room,
get_member_events::{self, Response as MembersResponse},
invite_user::{self, InvitationRecipient}, invite_user::{self, InvitationRecipient},
join_room_by_id, join_room_by_id_or_alias, kick_user, leave_room, Invite3pid, join_room_by_id, join_room_by_id_or_alias, kick_user, leave_room, Invite3pid,
}, },
@ -1468,13 +1469,14 @@ impl Client {
self.send(request).await self.send(request).await
} }
async fn room_members(&self, room_id: &RoomId) -> Result<()> { /// Get the room members for the given room.
pub async fn room_members(&self, room_id: &RoomId) -> Result<MembersResponse> {
let request = get_member_events::Request::new(room_id); let request = get_member_events::Request::new(room_id);
let response = self.send(request).await?; let response = self.send(request).await?;
self.base_client.receive_members(room_id, &response).await?; self.base_client.receive_members(room_id, &response).await?;
Ok(()) Ok(response)
} }
/// Synchronize the client's state with the latest state on the server. /// Synchronize the client's state with the latest state on the server.