Jitsi conf: don't show ui in DM

This commit is contained in:
ganfra 2021-08-13 14:54:09 +02:00
parent 6e55076f7c
commit 4821852430
2 changed files with 5 additions and 3 deletions

View file

@ -44,7 +44,6 @@ import org.matrix.android.sdk.api.session.room.model.Membership
object Progress : State()
}
private val dimensionConverter = DimensionConverter(context.resources)
private val views: ViewRemoveJitsiWidgetBinding
private var state: State = State.Unmount
var onCompleteSliding: (() -> Unit)? = null
@ -89,7 +88,10 @@ import org.matrix.android.sdk.api.session.room.model.Membership
fun render(roomDetailViewState: RoomDetailViewState) {
val summary = roomDetailViewState.asyncRoomSummary()
val newState = if (summary?.membership != Membership.JOIN || !roomDetailViewState.isAllowedToManageWidgets || roomDetailViewState.jitsiState.widgetId == null) {
val newState = if (summary?.membership != Membership.JOIN ||
roomDetailViewState.isWebRTCCallOptionAvailable() ||
!roomDetailViewState.isAllowedToManageWidgets ||
roomDetailViewState.jitsiState.widgetId == null) {
State.Unmount
} else if (roomDetailViewState.jitsiState.deleteWidgetInProgress) {
State.Progress

View file

@ -745,7 +745,7 @@ class RoomDetailViewModel @AssistedInject constructor(
R.id.voice_call -> state.isWebRTCCallOptionAvailable()
R.id.video_call -> state.isWebRTCCallOptionAvailable() || 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.jitsiState.confId != null && !state.jitsiState.hasJoined
R.id.join_conference -> !state.isWebRTCCallOptionAvailable() && state.jitsiState.confId != null && !state.jitsiState.hasJoined
R.id.search -> true
R.id.dev_tools -> vectorPreferences.developerMode()
else -> false