Use the right avatar for DMs in DM rooms (#1917)

This commit is contained in:
Jorge Martin Espinosa
2023-11-29 13:06:48 +01:00
committed by GitHub
parent c6fdc79f83
commit c697baf585
2 changed files with 4 additions and 3 deletions

1
changelog.d/1912.bugfix Normal file
View File

@@ -0,0 +1 @@
Use the right avatar for DMs in DM rooms

View File

@@ -133,10 +133,10 @@ class MessagesPresenter @AssistedInject constructor(
val syncUpdateFlow = room.syncUpdateFlow.collectAsState()
val userHasPermissionToSendMessage by room.canSendMessageAsState(type = MessageEventType.ROOM_MESSAGE, updateKey = syncUpdateFlow.value)
val userHasPermissionToRedact by room.canRedactAsState(updateKey = syncUpdateFlow.value)
val roomName: Async<String> by remember {
val roomName: Async<String> by remember(roomInfo?.name) {
derivedStateOf { roomInfo?.name?.let { Async.Success(it) } ?: Async.Uninitialized }
}
val roomAvatar: Async<AvatarData> by remember {
val roomAvatar: Async<AvatarData> by remember(roomInfo?.avatarUrl) {
derivedStateOf { roomInfo?.avatarData()?.let { Async.Success(it) } ?: Async.Uninitialized }
}
@@ -224,7 +224,7 @@ class MessagesPresenter @AssistedInject constructor(
return AvatarData(
id = id,
name = name,
url = avatarUrl,
url = avatarUrl ?: room.avatarUrl,
size = AvatarSize.TimelineRoom
)
}