🗑️ WorkerTask::GetRoomMembers isn't used, remove it

This commit is contained in:
2024-05-22 16:06:44 +02:00
parent 8c244ce4a7
commit 35e191eb62
5 changed files with 4 additions and 48 deletions

View File

@@ -10,7 +10,7 @@ use matrix_sdk::{
config::SyncSettings,
event_handler::Ctx,
media::{MediaFormat, MediaRequest, MediaThumbnailSize},
room::{ParentSpace, Room, RoomMember},
room::{ParentSpace, Room},
ruma::{
api::client::media::get_content_thumbnail::v3::Method,
events::{
@@ -26,7 +26,7 @@ use matrix_sdk::{
},
uint, OwnedMxcUri, OwnedRoomId, OwnedUserId, RoomId, UserId,
},
Client as MatrixClient, RoomMemberships, RoomState,
Client as MatrixClient, RoomState,
};
use tokio::sync::{
broadcast,
@@ -702,21 +702,6 @@ impl Client {
}
}
async fn get_room_members(&mut self, room_id: &OwnedRoomId) -> anyhow::Result<Vec<RoomMember>> {
let client = self.client.as_ref().unwrap();
if let Some(room) = client.get_room(room_id) {
match room.members(RoomMemberships::ACTIVE).await {
Ok(room_members) => Ok(room_members),
Err(err) => Err(err.into()),
}
} else {
warn!("No room found with the \"{}\" id", room_id.as_str());
// TODO: Return an error if the room has not been found
Ok(vec![])
}
}
// TODO: Share MediaRequest with other media requests
async fn get_thumbnail(&self, media_url: OwnedMxcUri) -> anyhow::Result<Vec<u8>> {
let client = self.client.as_ref().unwrap();
@@ -814,10 +799,6 @@ impl Client {
WorkerTask::GetRoomAvatar(id, reply) => {
reply.send(self.get_room_avatar(&id).await).await;
}
WorkerTask::GetRoomMembers(id, reply) => {
reply.send(self.get_room_members(&id).await).await;
}
WorkerTask::GetRoomMemberAvatar(room_id, user_id, avatar_url, reply) => {
reply
.send(