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
1 changed files with 9 additions and 1 deletions

View File

@ -674,13 +674,21 @@ class RoomDetailFragment @Inject constructor(
true true
} }
R.id.search -> { R.id.search -> {
navigator.openSearch(requireContext(), roomDetailArgs.roomId) handleSearchAction()
true true
} }
else -> super.onOptionsItemSelected(item) 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 -> private fun handleCallRequest(item: MenuItem) = withState(roomDetailViewModel) { state ->
val roomSummary = state.asyncRoomSummary.invoke() ?: return@withState val roomSummary = state.asyncRoomSummary.invoke() ?: return@withState
val isVideoCall = item.itemId == R.id.video_call val isVideoCall = item.itemId == R.id.video_call