Replaces call option condition with isDirect

This commit is contained in:
ericdecanini 2022-03-15 19:09:19 +01:00
parent d74d569f4b
commit 82ead4f3f5
1 changed files with 1 additions and 9 deletions

View File

@ -88,15 +88,7 @@ data class RoomDetailViewState(
rootThreadEventId = args.threadTimelineArgs?.rootThreadEventId
)
// TODO: Add condition here to check that room is DM-based group chat and not group room
fun isWebRTCCallOptionAvailable() = asyncRoomSummary.invoke()?.let { roomSummary ->
val joinedMembersCount = roomSummary.joinedMembersCount ?: 0
val isDirect = roomSummary.isDirect
Timber.d("WebRTCTest roomSummary: $roomSummary")
Timber.d("WebRTCTest joined members: $joinedMembersCount")
Timber.d("WebRTCTest isDirect: $isDirect")
joinedMembersCount <= 2
} ?: true // if room summary cannot be found, assume call option should be available
fun isWebRTCCallOptionAvailable() = asyncRoomSummary.invoke()?.isDirect ?: true
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false