Merge pull request #2130 from element-hq/feature/bma/roomListBadge

Some rework on the codebase
This commit is contained in:
Benoit Marty 2024-01-22 10:17:38 +01:00 committed by GitHub
commit c3538e500d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 147 additions and 169 deletions

View file

@ -428,7 +428,7 @@ class RustMatrixClient(
}
}
override suspend fun loadUserAvatarURLString(): Result<String?> = withContext(sessionDispatcher) {
override suspend fun loadUserAvatarUrl(): Result<String?> = withContext(sessionDispatcher) {
runCatching {
client.avatarUrl()
}

View file

@ -34,13 +34,12 @@ class RoomSummaryDetailsFactory(private val roomMessageFactory: RoomMessageFacto
name = roomInfo.name ?: roomInfo.id,
canonicalAlias = roomInfo.canonicalAlias,
isDirect = roomInfo.isDirect,
avatarURLString = roomInfo.avatarUrl,
avatarUrl = roomInfo.avatarUrl,
unreadNotificationCount = roomInfo.notificationCount.toInt(),
lastMessage = latestRoomMessage,
lastMessageTimestamp = latestRoomMessage?.originServerTs,
inviter = roomInfo.inviter?.let(RoomMemberMapper::map),
notificationMode = roomInfo.userDefinedNotificationMode?.let(RoomNotificationSettingsMapper::mapMode),
hasOngoingCall = roomInfo.hasRoomCall,
userDefinedNotificationMode = roomInfo.userDefinedNotificationMode?.let(RoomNotificationSettingsMapper::mapMode),
hasRoomCall = roomInfo.hasRoomCall,
isDm = roomInfo.isDirect && roomInfo.activeMembersCount.toLong() == 2L,
)
}