Allow default users to join an existing element call.

This commit is contained in:
Onuray Sahin 2022-07-12 12:33:40 +03:00
parent cc12f4db4a
commit d595683efa
2 changed files with 3 additions and 3 deletions

View File

@ -1090,8 +1090,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

View File

@ -783,7 +783,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.isAllowedToManageWidgets
R.id.voice_call -> state.isAllowedToManageWidgets || 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