Browse Source

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

pull/1924/head
Jorge Martin Espinosa 10 months ago committed by GitHub
parent
commit
8b7c53262f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/1912.bugfix
  2. 6
      features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt

1
changelog.d/1912.bugfix

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

6
features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt

@ -133,10 +133,10 @@ class MessagesPresenter @AssistedInject constructor( @@ -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( @@ -224,7 +224,7 @@ class MessagesPresenter @AssistedInject constructor(
return AvatarData(
id = id,
name = name,
url = avatarUrl,
url = avatarUrl ?: room.avatarUrl,
size = AvatarSize.TimelineRoom
)
}

Loading…
Cancel
Save