Adds debug test to check roomSummary for voice call button

This commit is contained in:
ericdecanini 2022-03-15 15:30:02 +01:00
parent e0b93c2d2c
commit 38f3b88395
1 changed files with 10 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import org.matrix.android.sdk.api.session.sync.SyncState
import org.matrix.android.sdk.api.session.threads.ThreadNotificationBadgeState
import org.matrix.android.sdk.api.session.widgets.model.Widget
import org.matrix.android.sdk.api.session.widgets.model.WidgetType
import timber.log.Timber
sealed class UnreadState {
object Unknown : UnreadState()
@ -87,7 +88,15 @@ data class RoomDetailViewState(
rootThreadEventId = args.threadTimelineArgs?.rootThreadEventId
)
fun isWebRTCCallOptionAvailable() = (asyncRoomSummary.invoke()?.joinedMembersCount ?: 0) <= 2
// 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
}
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false