From 2a8134af896d9272cfa8a5a219c88c70260c2245 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 28 Apr 2022 16:55:46 +0200 Subject: [PATCH] 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). --- .../app/features/home/room/detail/RoomDetailViewState.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewState.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewState.kt index 0c56d7e7eb..e01c5ba3b7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewState.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewState.kt @@ -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