Show not supported warning for e2e rooms.

This commit is contained in:
Onuray Sahin 2020-09-24 10:20:36 +03:00 committed by Benoit Marty
parent d6fcf63230
commit 6c6d0dbc3d

View file

@ -674,13 +674,21 @@ class RoomDetailFragment @Inject constructor(
true
}
R.id.search -> {
navigator.openSearch(requireContext(), roomDetailArgs.roomId)
handleSearchAction()
true
}
else -> super.onOptionsItemSelected(item)
}
}
private fun handleSearchAction() {
if (session.getRoom(roomDetailArgs.roomId)?.isEncrypted() == false) {
navigator.openSearch(requireContext(), roomDetailArgs.roomId)
} else {
showDialogWithMessage(getString(R.string.search_is_not_supported_in_e2e_room))
}
}
private fun handleCallRequest(item: MenuItem) = withState(roomDetailViewModel) { state ->
val roomSummary = state.asyncRoomSummary.invoke() ?: return@withState
val isVideoCall = item.itemId == R.id.video_call