From 6c6d0dbc3d9f907faf4dc85f3054fc17c4bd7d51 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 24 Sep 2020 10:20:36 +0300 Subject: [PATCH] Show not supported warning for e2e rooms. --- .../features/home/room/detail/RoomDetailFragment.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 34aa6a0831..51aeda2aab 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -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