Show call icon if there is an active element call widget.
This commit is contained in:
parent
7dfe5264cd
commit
0d4697b7e1
|
@ -93,7 +93,8 @@ data class RoomDetailViewState(
|
|||
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
|
||||
asyncRoomSummary.invoke()?.joinedMembersCount == 1 ||
|
||||
hasActiveElementCallWidget()
|
||||
}
|
||||
|
||||
fun isSearchAvailable() = asyncRoomSummary()?.isEncrypted == false
|
||||
|
|
|
@ -1088,8 +1088,8 @@ class TimelineFragment @Inject constructor(
|
|||
val hasCallInRoom = callManager.getCallsByRoomId(state.roomId).isNotEmpty() || state.jitsiState.hasJoined
|
||||
val callButtonsEnabled = !hasCallInRoom && when (state.asyncRoomSummary.invoke()?.joinedMembersCount) {
|
||||
1 -> false
|
||||
2 -> state.isAllowedToStartWebRTCCall
|
||||
else -> state.isAllowedToManageWidgets
|
||||
2 -> state.isAllowedToStartWebRTCCall || state.hasActiveElementCallWidget()
|
||||
else -> state.isAllowedToManageWidgets || state.hasActiveElementCallWidget()
|
||||
}
|
||||
setOf(R.id.voice_call, R.id.video_call).forEach {
|
||||
menu.findItem(it).icon?.alpha = if (callButtonsEnabled) 0xFF else 0x40
|
||||
|
|
|
@ -752,7 +752,7 @@ class TimelineViewModel @AssistedInject constructor(
|
|||
R.id.timeline_setting -> true
|
||||
R.id.invite -> state.canInvite
|
||||
R.id.open_matrix_apps -> true
|
||||
R.id.voice_call -> state.isCallOptionAvailable()
|
||||
R.id.voice_call -> state.isCallOptionAvailable() || state.hasActiveElementCallWidget()
|
||||
R.id.video_call -> state.isCallOptionAvailable() || state.jitsiState.confId == null || state.jitsiState.hasJoined
|
||||
// Show Join conference button only if there is an active conf id not joined. Otherwise fallback to default video disabled. ^
|
||||
R.id.join_conference -> !state.isCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
|
||||
|
|
Loading…
Reference in New Issue