Remove unnecessary Room.updateMembers() calls. (#2564)

* Remove unnecessary `updateMembers` calls.

Some of them can be directly removed since we have a way to automatically get member info updates based on membership changes.

Others can be replaced by a simpler `getUpdatedMember` method. This might still need a full member sync, but it's quite unlikely.
This commit is contained in:
Jorge Martin Espinosa 2024-03-18 15:57:25 +01:00 committed by GitHub
parent fde154a284
commit 883d834284
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 26 additions and 37 deletions

View file

@ -230,6 +230,12 @@ class RustMatrixRoom(
roomMemberListFetcher.fetchRoomMembers(source = source)
}
override suspend fun getUpdatedMember(userId: UserId): Result<RoomMember> = withContext(roomDispatcher) {
runCatching {
RoomMemberMapper.map(innerRoom.member(userId.value))
}
}
override suspend fun userDisplayName(userId: UserId): Result<String?> = withContext(roomDispatcher) {
runCatching {
innerRoom.memberDisplayName(userId.value)