mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Better way to get direct state of the room (using view state)
This commit is contained in:
parent
1986de36a6
commit
42a3a64b0d
2 changed files with 16 additions and 10 deletions
|
@ -704,11 +704,13 @@ class RoomDetailFragment @Inject constructor(
|
|||
// safeStartCall(it, isVideoCall)
|
||||
// }
|
||||
} else if (!state.isAllowedToStartWebRTCCall) {
|
||||
if (session.getRoom(state.roomId)?.roomSummary()?.isDirect == true) {
|
||||
showDialogWithMessage(getString(R.string.no_permissions_to_start_webrtc_call_in_direct_room))
|
||||
} else {
|
||||
showDialogWithMessage(getString(R.string.no_permissions_to_start_webrtc_call))
|
||||
}
|
||||
showDialogWithMessage(getString(
|
||||
if (state.isDm()) {
|
||||
R.string.no_permissions_to_start_webrtc_call_in_direct_room
|
||||
} else {
|
||||
R.string.no_permissions_to_start_webrtc_call
|
||||
})
|
||||
)
|
||||
} else {
|
||||
safeStartCall(isVideoCall)
|
||||
}
|
||||
|
@ -718,11 +720,13 @@ class RoomDetailFragment @Inject constructor(
|
|||
// can you add widgets??
|
||||
if (!state.isAllowedToManageWidgets) {
|
||||
// You do not have permission to start a conference call in this room
|
||||
if (session.getRoom(state.roomId)?.roomSummary()?.isDirect == true) {
|
||||
showDialogWithMessage(getString(R.string.no_permissions_to_start_conf_call_in_direct_room))
|
||||
} else {
|
||||
showDialogWithMessage(getString(R.string.no_permissions_to_start_conf_call))
|
||||
}
|
||||
showDialogWithMessage(getString(
|
||||
if (state.isDm()) {
|
||||
R.string.no_permissions_to_start_conf_call_in_direct_room
|
||||
} else {
|
||||
R.string.no_permissions_to_start_conf_call
|
||||
}
|
||||
))
|
||||
} else {
|
||||
if (state.activeRoomWidgets()?.filter { it.type == WidgetType.Jitsi }?.any() == true) {
|
||||
// A conference is already in progress!
|
||||
|
|
|
@ -77,4 +77,6 @@ data class RoomDetailViewState(
|
|||
// Also highlight the target event, if any
|
||||
highlightedEventId = args.eventId
|
||||
)
|
||||
|
||||
fun isDm() = asyncRoomSummary()?.isDirect == true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue