Ensure voice call menu item is visible to the user when there is only one room member. The video call menu item is already visible (for other previous reason).

This commit is contained in:
Benoit Marty 2022-04-28 16:55:46 +02:00
parent f48be229c8
commit 2a8134af89

View File

@ -87,7 +87,12 @@ data class RoomDetailViewState(
rootThreadEventId = args.threadTimelineArgs?.rootThreadEventId
)
fun isCallOptionAvailable() = asyncRoomSummary.invoke()?.isDirect ?: true
fun isCallOptionAvailable(): Boolean {
return asyncRoomSummary.invoke()?.isDirect ?: true ||
// When there is only one member, a warning will be displayed when the user
// clicks on the menu item to start a call
asyncRoomSummary.invoke()?.joinedMembersCount == 1
}
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false