on show voice call only option in DMs
This commit is contained in:
parent
22a9e541fe
commit
fdd39fa17b
8 changed files with 32 additions and 15 deletions
|
|
@ -271,6 +271,7 @@ class MessagesPresenter(
|
|||
|
||||
return MessagesState(
|
||||
roomId = room.roomId,
|
||||
isDm = roomInfo.isDm,
|
||||
roomName = roomInfo.name,
|
||||
roomAvatar = roomAvatar,
|
||||
heroes = heroes,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
data class MessagesState(
|
||||
val roomId: RoomId,
|
||||
val roomName: String?,
|
||||
val isDm: Boolean,
|
||||
val roomAvatar: AvatarData,
|
||||
val heroes: ImmutableList<AvatarData>,
|
||||
val userEventPermissions: UserEventPermissions,
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ fun aMessagesState(
|
|||
) = MessagesState(
|
||||
roomId = RoomId("!id:domain"),
|
||||
roomName = roomName,
|
||||
isDm = false,
|
||||
roomAvatar = roomAvatar,
|
||||
heroes = persistentListOf(),
|
||||
userEventPermissions = userEventPermissions,
|
||||
|
|
|
|||
|
|
@ -67,15 +67,18 @@ private fun StandByCallMenuItem(
|
|||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Row(modifier = modifier) {
|
||||
IconButton(
|
||||
modifier = modifier,
|
||||
onClick = { onJoinCallClick(true) },
|
||||
enabled = roomCallState.canStartCall,
|
||||
) {
|
||||
Icon(
|
||||
imageVector = CompoundIcons.VoiceCallSolid(),
|
||||
contentDescription = stringResource(CommonStrings.a11y_start_call),
|
||||
)
|
||||
// Only show voice call in DMs
|
||||
if (roomCallState.isDM) {
|
||||
IconButton(
|
||||
modifier = modifier,
|
||||
onClick = { onJoinCallClick(true) },
|
||||
enabled = roomCallState.canStartCall,
|
||||
) {
|
||||
Icon(
|
||||
imageVector = CompoundIcons.VoiceCallSolid(),
|
||||
contentDescription = stringResource(CommonStrings.a11y_start_call),
|
||||
)
|
||||
}
|
||||
}
|
||||
IconButton(
|
||||
modifier = modifier,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue