@ethora/chat-component-rn 26.10.9 → 26.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +126 -1
- package/lib/commonjs/booking/index.js +44 -0
- package/lib/commonjs/booking/index.js.map +1 -0
- package/lib/commonjs/booking/pendingScheduledCall.js +275 -0
- package/lib/commonjs/booking/pendingScheduledCall.js.map +1 -0
- package/lib/commonjs/booking/scheduleForm.js +91 -0
- package/lib/commonjs/booking/scheduleForm.js.map +1 -0
- package/lib/commonjs/booking/scheduledCall.js +141 -0
- package/lib/commonjs/booking/scheduledCall.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallActions.js +128 -0
- package/lib/commonjs/booking/scheduledCallActions.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallLink.js +143 -0
- package/lib/commonjs/booking/scheduledCallLink.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallStore.js +64 -0
- package/lib/commonjs/booking/scheduledCallStore.js.map +1 -0
- package/lib/commonjs/booking/startRoomCall.js +84 -0
- package/lib/commonjs/booking/startRoomCall.js.map +1 -0
- package/lib/commonjs/calls/callBusy.js +18 -0
- package/lib/commonjs/calls/callBusy.js.map +1 -0
- package/lib/commonjs/calls/callDisplay.js +73 -0
- package/lib/commonjs/calls/callDisplay.js.map +1 -0
- package/lib/commonjs/calls/callMode.js +175 -0
- package/lib/commonjs/calls/callMode.js.map +1 -0
- package/lib/commonjs/calls/declineReport.js +20 -0
- package/lib/commonjs/calls/declineReport.js.map +1 -0
- package/lib/commonjs/calls/p2p/P2PCallController.js +724 -0
- package/lib/commonjs/calls/p2p/P2PCallController.js.map +1 -0
- package/lib/commonjs/calls/p2p/icePolicy.js +107 -0
- package/lib/commonjs/calls/p2p/icePolicy.js.map +1 -0
- package/lib/commonjs/calls/p2p/negotiator.js +202 -0
- package/lib/commonjs/calls/p2p/negotiator.js.map +1 -0
- package/lib/commonjs/calls/p2p/p2pRuntime.js +147 -0
- package/lib/commonjs/calls/p2p/p2pRuntime.js.map +1 -0
- package/lib/commonjs/calls/p2p/signalInbox.js +98 -0
- package/lib/commonjs/calls/p2p/signalInbox.js.map +1 -0
- package/lib/commonjs/calls/p2p/signalStanza.js +141 -0
- package/lib/commonjs/calls/p2p/signalStanza.js.map +1 -0
- package/lib/commonjs/calls/p2p/webrtcRuntime.js +53 -0
- package/lib/commonjs/calls/p2p/webrtcRuntime.js.map +1 -0
- package/lib/commonjs/calls/senderTrust.js +43 -0
- package/lib/commonjs/calls/senderTrust.js.map +1 -0
- package/lib/commonjs/calls/startCall.js +51 -0
- package/lib/commonjs/calls/startCall.js.map +1 -0
- package/lib/commonjs/components/Booking/BookingIcons.js +55 -0
- package/lib/commonjs/components/Booking/BookingIcons.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduleCallButton.js +64 -0
- package/lib/commonjs/components/Booking/ScheduleCallButton.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduleCallSheet.js +351 -0
- package/lib/commonjs/components/Booking/ScheduleCallSheet.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallCard.js +203 -0
- package/lib/commonjs/components/Booking/ScheduledCallCard.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallHost.js +23 -0
- package/lib/commonjs/components/Booking/ScheduledCallHost.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallMessage.js +55 -0
- package/lib/commonjs/components/Booking/ScheduledCallMessage.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js +235 -0
- package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js.map +1 -0
- package/lib/commonjs/components/Booking/bookingShared.js +305 -0
- package/lib/commonjs/components/Booking/bookingShared.js.map +1 -0
- package/lib/commonjs/components/MainComponents/AlbumGrid.js +6 -2
- package/lib/commonjs/components/MainComponents/AlbumGrid.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +18 -12
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js +5 -2
- package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +6 -3
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +13 -0
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +13 -0
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +10 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +7 -16
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +27 -1
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatMediaGrid.js +159 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatMediaGrid.js.map +1 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +203 -134
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/LeaveChatModal.js +180 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/LeaveChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +19 -15
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +100 -162
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/MediaViewer.js +824 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/MediaViewer.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/useSaveFile.js +179 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/useSaveFile.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js +22 -5
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +15 -8
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js +3 -2
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/CallButtons.js +19 -11
- package/lib/commonjs/components/VideoCalls/CallButtons.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/CallControlBar.js +119 -0
- package/lib/commonjs/components/VideoCalls/CallControlBar.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/CallVideo.js +49 -0
- package/lib/commonjs/components/VideoCalls/CallVideo.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/GroupCallView.js +281 -0
- package/lib/commonjs/components/VideoCalls/GroupCallView.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/P2PCallRunner.js +151 -0
- package/lib/commonjs/components/VideoCalls/P2PCallRunner.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +38 -14
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +57 -128
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callActions.js +3 -0
- package/lib/commonjs/components/VideoCalls/callActions.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callElapsed.js +38 -0
- package/lib/commonjs/components/VideoCalls/callElapsed.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/callLive.js +15 -0
- package/lib/commonjs/components/VideoCalls/callLive.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/callSessionController.js +81 -24
- package/lib/commonjs/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callSessionTypes.js +41 -0
- package/lib/commonjs/components/VideoCalls/callSessionTypes.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/groupLayout.js +43 -0
- package/lib/commonjs/components/VideoCalls/groupLayout.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/p2pCallSession.js +272 -0
- package/lib/commonjs/components/VideoCalls/p2pCallSession.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/useCallKeep.js +7 -2
- package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js +2 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +4 -1
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +5 -1
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/MediaSourceContext.js +18 -0
- package/lib/commonjs/context/MediaSourceContext.js.map +1 -0
- package/lib/commonjs/context/xmppProvider.js +2 -1
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/callPush.js +3 -1
- package/lib/commonjs/helpers/callPush.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js +3 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js +2 -0
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/commonjs/helpers/incomingCallFromPush.js +63 -7
- package/lib/commonjs/helpers/incomingCallFromPush.js.map +1 -1
- package/lib/commonjs/helpers/publicChatsEntry.js +8 -6
- package/lib/commonjs/helpers/publicChatsEntry.js.map +1 -1
- package/lib/commonjs/helpers/pushPayload.js +5 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -1
- package/lib/commonjs/helpers/reportRoom.js +76 -0
- package/lib/commonjs/helpers/reportRoom.js.map +1 -0
- package/lib/commonjs/helpers/roomMedia.js +118 -0
- package/lib/commonjs/helpers/roomMedia.js.map +1 -0
- package/lib/commonjs/i18n/strings.js +480 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +93 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/callState.api.js +75 -0
- package/lib/commonjs/networking/api-requests/callState.api.js.map +1 -0
- package/lib/commonjs/networking/api-requests/push.api.js +29 -6
- package/lib/commonjs/networking/api-requests/push.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +17 -15
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/scheduledCalls.api.js +141 -0
- package/lib/commonjs/networking/api-requests/scheduledCalls.api.js.map +1 -0
- package/lib/commonjs/networking/callTokenStanza.js +210 -50
- package/lib/commonjs/networking/callTokenStanza.js.map +1 -1
- package/lib/commonjs/roomStore/callSlice.js +59 -4
- package/lib/commonjs/roomStore/callSlice.js.map +1 -1
- package/lib/commonjs/services/appBadge.js +80 -0
- package/lib/commonjs/services/appBadge.js.map +1 -0
- package/lib/commonjs/services/languageSettings.js +47 -15
- package/lib/commonjs/services/languageSettings.js.map +1 -1
- package/lib/commonjs/services/pushRegistration.js +21 -5
- package/lib/commonjs/services/pushRegistration.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/booking/index.js +5 -0
- package/lib/module/booking/index.js.map +1 -0
- package/lib/module/booking/pendingScheduledCall.js +261 -0
- package/lib/module/booking/pendingScheduledCall.js.map +1 -0
- package/lib/module/booking/scheduleForm.js +79 -0
- package/lib/module/booking/scheduleForm.js.map +1 -0
- package/lib/module/booking/scheduledCall.js +129 -0
- package/lib/module/booking/scheduledCall.js.map +1 -0
- package/lib/module/booking/scheduledCallActions.js +118 -0
- package/lib/module/booking/scheduledCallActions.js.map +1 -0
- package/lib/module/booking/scheduledCallLink.js +136 -0
- package/lib/module/booking/scheduledCallLink.js.map +1 -0
- package/lib/module/booking/scheduledCallStore.js +60 -0
- package/lib/module/booking/scheduledCallStore.js.map +1 -0
- package/lib/module/booking/startRoomCall.js +80 -0
- package/lib/module/booking/startRoomCall.js.map +1 -0
- package/lib/module/calls/callBusy.js +13 -0
- package/lib/module/calls/callBusy.js.map +1 -0
- package/lib/module/calls/callDisplay.js +65 -0
- package/lib/module/calls/callDisplay.js.map +1 -0
- package/lib/module/calls/callMode.js +168 -0
- package/lib/module/calls/callMode.js.map +1 -0
- package/lib/module/calls/declineReport.js +16 -0
- package/lib/module/calls/declineReport.js.map +1 -0
- package/lib/module/calls/p2p/P2PCallController.js +718 -0
- package/lib/module/calls/p2p/P2PCallController.js.map +1 -0
- package/lib/module/calls/p2p/icePolicy.js +102 -0
- package/lib/module/calls/p2p/icePolicy.js.map +1 -0
- package/lib/module/calls/p2p/negotiator.js +197 -0
- package/lib/module/calls/p2p/negotiator.js.map +1 -0
- package/lib/module/calls/p2p/p2pRuntime.js +137 -0
- package/lib/module/calls/p2p/p2pRuntime.js.map +1 -0
- package/lib/module/calls/p2p/signalInbox.js +93 -0
- package/lib/module/calls/p2p/signalInbox.js.map +1 -0
- package/lib/module/calls/p2p/signalStanza.js +135 -0
- package/lib/module/calls/p2p/signalStanza.js.map +1 -0
- package/lib/module/calls/p2p/webrtcRuntime.js +46 -0
- package/lib/module/calls/p2p/webrtcRuntime.js.map +1 -0
- package/lib/module/calls/senderTrust.js +38 -0
- package/lib/module/calls/senderTrust.js.map +1 -0
- package/lib/module/calls/startCall.js +47 -0
- package/lib/module/calls/startCall.js.map +1 -0
- package/lib/module/components/Booking/BookingIcons.js +48 -0
- package/lib/module/components/Booking/BookingIcons.js.map +1 -0
- package/lib/module/components/Booking/ScheduleCallButton.js +59 -0
- package/lib/module/components/Booking/ScheduleCallButton.js.map +1 -0
- package/lib/module/components/Booking/ScheduleCallSheet.js +345 -0
- package/lib/module/components/Booking/ScheduleCallSheet.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallCard.js +197 -0
- package/lib/module/components/Booking/ScheduledCallCard.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallHost.js +18 -0
- package/lib/module/components/Booking/ScheduledCallHost.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallMessage.js +48 -0
- package/lib/module/components/Booking/ScheduledCallMessage.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallPreJoin.js +229 -0
- package/lib/module/components/Booking/ScheduledCallPreJoin.js.map +1 -0
- package/lib/module/components/Booking/bookingShared.js +291 -0
- package/lib/module/components/Booking/bookingShared.js.map +1 -0
- package/lib/module/components/MainComponents/AlbumGrid.js +6 -2
- package/lib/module/components/MainComponents/AlbumGrid.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +20 -14
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorButton.js +5 -2
- package/lib/module/components/MainComponents/LanguageSelectorButton.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorModal.js +7 -4
- package/lib/module/components/MainComponents/LanguageSelectorModal.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +13 -0
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +13 -0
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +10 -0
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +7 -16
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +27 -1
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatMediaGrid.js +154 -0
- package/lib/module/components/Modals/ChatProfileModal/ChatMediaGrid.js.map +1 -0
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +204 -136
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/LeaveChatModal.js +175 -0
- package/lib/module/components/Modals/ChatProfileModal/LeaveChatModal.js.map +1 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +21 -15
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +100 -163
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/MediaViewer.js +819 -0
- package/lib/module/components/Modals/FilePreviewModal/MediaViewer.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/useSaveFile.js +172 -0
- package/lib/module/components/Modals/FilePreviewModal/useSaveFile.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js +20 -4
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +17 -10
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
- package/lib/module/components/VideoCalls/ActiveCallBar.js +3 -2
- package/lib/module/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/module/components/VideoCalls/CallButtons.js +19 -11
- package/lib/module/components/VideoCalls/CallButtons.js.map +1 -1
- package/lib/module/components/VideoCalls/CallControlBar.js +113 -0
- package/lib/module/components/VideoCalls/CallControlBar.js.map +1 -0
- package/lib/module/components/VideoCalls/CallVideo.js +43 -0
- package/lib/module/components/VideoCalls/CallVideo.js.map +1 -0
- package/lib/module/components/VideoCalls/GroupCallView.js +275 -0
- package/lib/module/components/VideoCalls/GroupCallView.js.map +1 -0
- package/lib/module/components/VideoCalls/P2PCallRunner.js +147 -0
- package/lib/module/components/VideoCalls/P2PCallRunner.js.map +1 -0
- package/lib/module/components/VideoCalls/VideoCallOverlay.js +38 -14
- package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +46 -127
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/VideoCalls/callActions.js +3 -0
- package/lib/module/components/VideoCalls/callActions.js.map +1 -1
- package/lib/module/components/VideoCalls/callElapsed.js +33 -0
- package/lib/module/components/VideoCalls/callElapsed.js.map +1 -0
- package/lib/module/components/VideoCalls/callLive.js +10 -0
- package/lib/module/components/VideoCalls/callLive.js.map +1 -0
- package/lib/module/components/VideoCalls/callSessionController.js +80 -24
- package/lib/module/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/module/components/VideoCalls/callSessionTypes.js +37 -0
- package/lib/module/components/VideoCalls/callSessionTypes.js.map +1 -0
- package/lib/module/components/VideoCalls/groupLayout.js +36 -0
- package/lib/module/components/VideoCalls/groupLayout.js.map +1 -0
- package/lib/module/components/VideoCalls/p2pCallSession.js +256 -0
- package/lib/module/components/VideoCalls/p2pCallSession.js.map +1 -0
- package/lib/module/components/VideoCalls/useCallKeep.js +8 -2
- package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js +2 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +4 -1
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +5 -1
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/MediaSourceContext.js +13 -0
- package/lib/module/context/MediaSourceContext.js.map +1 -0
- package/lib/module/context/xmppProvider.js +2 -1
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/callPush.js +3 -1
- package/lib/module/helpers/callPush.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js +2 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_TYPES.js +2 -0
- package/lib/module/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/module/helpers/incomingCallFromPush.js +63 -7
- package/lib/module/helpers/incomingCallFromPush.js.map +1 -1
- package/lib/module/helpers/publicChatsEntry.js +8 -6
- package/lib/module/helpers/publicChatsEntry.js.map +1 -1
- package/lib/module/helpers/pushPayload.js +5 -0
- package/lib/module/helpers/pushPayload.js.map +1 -1
- package/lib/module/helpers/reportRoom.js +70 -0
- package/lib/module/helpers/reportRoom.js.map +1 -0
- package/lib/module/helpers/roomMedia.js +112 -0
- package/lib/module/helpers/roomMedia.js.map +1 -0
- package/lib/module/i18n/strings.js +480 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +5 -0
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/callState.api.js +66 -0
- package/lib/module/networking/api-requests/callState.api.js.map +1 -0
- package/lib/module/networking/api-requests/push.api.js +29 -6
- package/lib/module/networking/api-requests/push.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +17 -15
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/scheduledCalls.api.js +130 -0
- package/lib/module/networking/api-requests/scheduledCalls.api.js.map +1 -0
- package/lib/module/networking/callTokenStanza.js +210 -50
- package/lib/module/networking/callTokenStanza.js.map +1 -1
- package/lib/module/roomStore/callSlice.js +57 -3
- package/lib/module/roomStore/callSlice.js.map +1 -1
- package/lib/module/services/appBadge.js +74 -0
- package/lib/module/services/appBadge.js.map +1 -0
- package/lib/module/services/languageSettings.js +44 -13
- package/lib/module/services/languageSettings.js.map +1 -1
- package/lib/module/services/pushRegistration.js +21 -5
- package/lib/module/services/pushRegistration.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/booking/index.d.ts +3 -0
- package/lib/typescript/booking/index.d.ts.map +1 -0
- package/lib/typescript/booking/pendingScheduledCall.d.ts +80 -0
- package/lib/typescript/booking/pendingScheduledCall.d.ts.map +1 -0
- package/lib/typescript/booking/scheduleForm.d.ts +28 -0
- package/lib/typescript/booking/scheduleForm.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCall.d.ts +52 -0
- package/lib/typescript/booking/scheduledCall.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallActions.d.ts +22 -0
- package/lib/typescript/booking/scheduledCallActions.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallLink.d.ts +37 -0
- package/lib/typescript/booking/scheduledCallLink.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallStore.d.ts +47 -0
- package/lib/typescript/booking/scheduledCallStore.d.ts.map +1 -0
- package/lib/typescript/booking/startRoomCall.d.ts +12 -0
- package/lib/typescript/booking/startRoomCall.d.ts.map +1 -0
- package/lib/typescript/calls/callBusy.d.ts +9 -0
- package/lib/typescript/calls/callBusy.d.ts.map +1 -0
- package/lib/typescript/calls/callDisplay.d.ts +23 -0
- package/lib/typescript/calls/callDisplay.d.ts.map +1 -0
- package/lib/typescript/calls/callMode.d.ts +106 -0
- package/lib/typescript/calls/callMode.d.ts.map +1 -0
- package/lib/typescript/calls/declineReport.d.ts +11 -0
- package/lib/typescript/calls/declineReport.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/P2PCallController.d.ts +150 -0
- package/lib/typescript/calls/p2p/P2PCallController.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/icePolicy.d.ts +37 -0
- package/lib/typescript/calls/p2p/icePolicy.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/negotiator.d.ts +57 -0
- package/lib/typescript/calls/p2p/negotiator.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/p2pRuntime.d.ts +41 -0
- package/lib/typescript/calls/p2p/p2pRuntime.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/signalInbox.d.ts +35 -0
- package/lib/typescript/calls/p2p/signalInbox.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/signalStanza.d.ts +52 -0
- package/lib/typescript/calls/p2p/signalStanza.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/webrtcRuntime.d.ts +32 -0
- package/lib/typescript/calls/p2p/webrtcRuntime.d.ts.map +1 -0
- package/lib/typescript/calls/senderTrust.d.ts +8 -0
- package/lib/typescript/calls/senderTrust.d.ts.map +1 -0
- package/lib/typescript/calls/startCall.d.ts +17 -0
- package/lib/typescript/calls/startCall.d.ts.map +1 -0
- package/lib/typescript/components/Booking/BookingIcons.d.ts +9 -0
- package/lib/typescript/components/Booking/BookingIcons.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduleCallButton.d.ts +11 -0
- package/lib/typescript/components/Booking/ScheduleCallButton.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts +4 -0
- package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallCard.d.ts +14 -0
- package/lib/typescript/components/Booking/ScheduledCallCard.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallHost.d.ts +10 -0
- package/lib/typescript/components/Booking/ScheduledCallHost.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts +20 -0
- package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts +8 -0
- package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts.map +1 -0
- package/lib/typescript/components/Booking/bookingShared.d.ts +199 -0
- package/lib/typescript/components/Booking/bookingShared.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/AlbumGrid.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts +3 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts +3 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatMediaGrid.d.ts +16 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatMediaGrid.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/LeaveChatModal.d.ts +18 -0
- package/lib/typescript/components/Modals/ChatProfileModal/LeaveChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +16 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/MediaViewer.d.ts +27 -0
- package/lib/typescript/components/Modals/FilePreviewModal/MediaViewer.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/useSaveFile.d.ts +9 -0
- package/lib/typescript/components/Modals/FilePreviewModal/useSaveFile.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts +8 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/LanguageCard.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/CallButtons.d.ts +2 -1
- package/lib/typescript/components/VideoCalls/CallButtons.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/CallControlBar.d.ts +17 -0
- package/lib/typescript/components/VideoCalls/CallControlBar.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/CallVideo.d.ts +23 -0
- package/lib/typescript/components/VideoCalls/CallVideo.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/GroupCallView.d.ts +22 -0
- package/lib/typescript/components/VideoCalls/GroupCallView.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts +2 -0
- package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts +10 -12
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callActions.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callElapsed.d.ts +8 -0
- package/lib/typescript/components/VideoCalls/callElapsed.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/callLive.d.ts +9 -0
- package/lib/typescript/components/VideoCalls/callLive.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts +10 -31
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts +60 -0
- package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/groupLayout.d.ts +23 -0
- package/lib/typescript/components/VideoCalls/groupLayout.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts +31 -0
- package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/MediaSourceContext.d.ts +4 -0
- package/lib/typescript/context/MediaSourceContext.d.ts.map +1 -0
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/callPush.d.ts +11 -1
- package/lib/typescript/helpers/callPush.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_COMPONENTS.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts +2 -0
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts.map +1 -1
- package/lib/typescript/helpers/incomingCallFromPush.d.ts.map +1 -1
- package/lib/typescript/helpers/publicChatsEntry.d.ts +7 -5
- package/lib/typescript/helpers/publicChatsEntry.d.ts.map +1 -1
- package/lib/typescript/helpers/pushPayload.d.ts +1 -1
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -1
- package/lib/typescript/helpers/reportRoom.d.ts +19 -0
- package/lib/typescript/helpers/reportRoom.d.ts.map +1 -0
- package/lib/typescript/helpers/roomMedia.d.ts +26 -0
- package/lib/typescript/helpers/roomMedia.d.ts.map +1 -0
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +6 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/callState.api.d.ts +25 -0
- package/lib/typescript/networking/api-requests/callState.api.d.ts.map +1 -0
- package/lib/typescript/networking/api-requests/push.api.d.ts +9 -2
- package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts +8 -6
- package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts +86 -0
- package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts.map +1 -0
- package/lib/typescript/networking/callTokenStanza.d.ts.map +1 -1
- package/lib/typescript/roomStore/callSlice.d.ts +23 -1
- package/lib/typescript/roomStore/callSlice.d.ts.map +1 -1
- package/lib/typescript/services/appBadge.d.ts +3 -0
- package/lib/typescript/services/appBadge.d.ts.map +1 -0
- package/lib/typescript/services/languageSettings.d.ts +7 -0
- package/lib/typescript/services/languageSettings.d.ts.map +1 -1
- package/lib/typescript/services/pushRegistration.d.ts.map +1 -1
- package/lib/typescript/types/models/modal.model.d.ts +18 -0
- package/lib/typescript/types/models/modal.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +85 -4
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +9 -2
- package/src/booking/index.ts +10 -0
- package/src/booking/pendingScheduledCall.ts +272 -0
- package/src/booking/scheduleForm.ts +84 -0
- package/src/booking/scheduledCall.ts +163 -0
- package/src/booking/scheduledCallActions.ts +141 -0
- package/src/booking/scheduledCallLink.ts +145 -0
- package/src/booking/scheduledCallStore.ts +69 -0
- package/src/booking/startRoomCall.ts +103 -0
- package/src/calls/callBusy.ts +10 -0
- package/src/calls/callDisplay.ts +74 -0
- package/src/calls/callMode.ts +286 -0
- package/src/calls/declineReport.ts +16 -0
- package/src/calls/p2p/P2PCallController.ts +813 -0
- package/src/calls/p2p/icePolicy.ts +99 -0
- package/src/calls/p2p/negotiator.ts +186 -0
- package/src/calls/p2p/p2pRuntime.ts +164 -0
- package/src/calls/p2p/signalInbox.ts +117 -0
- package/src/calls/p2p/signalStanza.ts +205 -0
- package/src/calls/p2p/webrtcRuntime.ts +60 -0
- package/src/calls/senderTrust.ts +40 -0
- package/src/calls/startCall.ts +56 -0
- package/src/components/Booking/BookingIcons.tsx +44 -0
- package/src/components/Booking/ScheduleCallButton.tsx +66 -0
- package/src/components/Booking/ScheduleCallSheet.tsx +380 -0
- package/src/components/Booking/ScheduledCallCard.tsx +216 -0
- package/src/components/Booking/ScheduledCallHost.tsx +18 -0
- package/src/components/Booking/ScheduledCallMessage.tsx +62 -0
- package/src/components/Booking/ScheduledCallPreJoin.tsx +230 -0
- package/src/components/Booking/bookingShared.tsx +295 -0
- package/src/components/MainComponents/AlbumGrid.tsx +5 -1
- package/src/components/MainComponents/ChatHeader.tsx +18 -11
- package/src/components/MainComponents/LanguageSelectorButton.tsx +9 -2
- package/src/components/MainComponents/LanguageSelectorModal.tsx +10 -6
- package/src/components/MainComponents/MediaMessage.tsx +13 -2
- package/src/components/MainComponents/MessageContainer.tsx +15 -0
- package/src/components/MainComponents/ReduxWrapper.tsx +10 -0
- package/src/components/MainComponents/RoomList.tsx +8 -19
- package/src/components/MessageBubble/Message.tsx +24 -1
- package/src/components/Modals/ChatProfileModal/ChatMediaGrid.tsx +174 -0
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +119 -48
- package/src/components/Modals/ChatProfileModal/LeaveChatModal.tsx +191 -0
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +22 -22
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +115 -185
- package/src/components/Modals/FilePreviewModal/MediaViewer.tsx +880 -0
- package/src/components/Modals/FilePreviewModal/useSaveFile.ts +207 -0
- package/src/components/Modals/MessageSearchModal/MessageSearchModal.tsx +56 -30
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +28 -9
- package/src/components/Modals/UserSettingsModal/LanguageCard.tsx +9 -7
- package/src/components/VideoCalls/ActiveCallBar.tsx +6 -5
- package/src/components/VideoCalls/CallButtons.tsx +23 -12
- package/src/components/VideoCalls/CallControlBar.tsx +131 -0
- package/src/components/VideoCalls/CallVideo.tsx +59 -0
- package/src/components/VideoCalls/GroupCallView.tsx +324 -0
- package/src/components/VideoCalls/P2PCallRunner.tsx +192 -0
- package/src/components/VideoCalls/VideoCallOverlay.tsx +62 -17
- package/src/components/VideoCalls/VideoCallSession.tsx +55 -133
- package/src/components/VideoCalls/callActions.ts +3 -0
- package/src/components/VideoCalls/callElapsed.ts +27 -0
- package/src/components/VideoCalls/callLive.ts +13 -0
- package/src/components/VideoCalls/callSessionController.ts +130 -55
- package/src/components/VideoCalls/callSessionTypes.ts +80 -0
- package/src/components/VideoCalls/groupLayout.ts +48 -0
- package/src/components/VideoCalls/p2pCallSession.ts +291 -0
- package/src/components/VideoCalls/useCallKeep.ts +9 -2
- package/src/components/VideoCalls/useOngoingCallNotification.ts +2 -2
- package/src/components/styled/MessageImage.tsx +3 -1
- package/src/components/styled/VideoMessage.tsx +5 -1
- package/src/context/MediaSourceContext.tsx +14 -0
- package/src/context/xmppProvider.tsx +3 -0
- package/src/helpers/callPush.ts +13 -1
- package/src/helpers/constants/MODAL_COMPONENTS.tsx +4 -1
- package/src/helpers/constants/MODAL_TYPES.ts +2 -0
- package/src/helpers/incomingCallFromPush.ts +65 -7
- package/src/helpers/publicChatsEntry.ts +8 -7
- package/src/helpers/pushPayload.ts +9 -1
- package/src/helpers/reportRoom.ts +93 -0
- package/src/helpers/roomMedia.ts +126 -0
- package/src/i18n/strings.ts +480 -0
- package/src/main.ts +33 -0
- package/src/networking/api-requests/callState.api.ts +83 -0
- package/src/networking/api-requests/push.api.ts +28 -3
- package/src/networking/api-requests/rooms.api.ts +25 -15
- package/src/networking/api-requests/scheduledCalls.api.ts +232 -0
- package/src/networking/callTokenStanza.ts +247 -50
- package/src/roomStore/callSlice.ts +86 -2
- package/src/services/appBadge.ts +85 -0
- package/src/services/languageSettings.ts +43 -8
- package/src/services/pushRegistration.ts +34 -3
- package/src/types/models/modal.model.ts +16 -0
- package/src/types/types.ts +86 -4
- package/src/version.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC, useCallback } from 'react';
|
|
1
|
+
import React, { FC, useCallback, useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Modal,
|
|
4
4
|
Pressable,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
setTranslateMode,
|
|
16
16
|
} from '../../roomStore/chatSettingsSlice';
|
|
17
17
|
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
18
|
-
import {
|
|
18
|
+
import { chatLanguageChoices } from '../../services/languageSettings';
|
|
19
19
|
import { Iso639_1Codes } from '../../types/models/language.model';
|
|
20
20
|
import {
|
|
21
21
|
canReaderChooseTranslateMode,
|
|
@@ -79,12 +79,16 @@ export const LanguageSelectorModal: FC<{
|
|
|
79
79
|
const translates = config?.translates;
|
|
80
80
|
const effectiveMode = resolveTranslateMode(translates, translateMode);
|
|
81
81
|
const showModeSwitcher = canReaderChooseTranslateMode(translates);
|
|
82
|
-
|
|
82
|
+
// The install's translateLanguages (get-config) when the host passed
|
|
83
|
+
// them, the built-in list otherwise; empty hides the list.
|
|
84
|
+
const languageChoices = useMemo(() => chatLanguageChoices(config), [config]);
|
|
85
|
+
const showLanguageList =
|
|
86
|
+
translates?.showLanguageList !== false && languageChoices.length > 0;
|
|
83
87
|
const activeLocale = translates?.readerLocale || langSource;
|
|
84
88
|
|
|
85
89
|
const selectLanguage = useCallback(
|
|
86
|
-
(id:
|
|
87
|
-
dispatch(setLangSource(id));
|
|
90
|
+
(id: string) => {
|
|
91
|
+
dispatch(setLangSource(id as Iso639_1Codes));
|
|
88
92
|
onClose();
|
|
89
93
|
},
|
|
90
94
|
[dispatch, onClose]
|
|
@@ -166,7 +170,7 @@ export const LanguageSelectorModal: FC<{
|
|
|
166
170
|
{t('language.select')}
|
|
167
171
|
</Text>
|
|
168
172
|
<ScrollView style={styles.list}>
|
|
169
|
-
{
|
|
173
|
+
{languageChoices.map((option) => {
|
|
170
174
|
// Compare on the base language so a reader on "fr" still
|
|
171
175
|
// sees "Français" (id fr-CA) ticked.
|
|
172
176
|
const selected =
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { IAttachment, IMessage } from '../../types/types';
|
|
2
|
+
import { IAttachment, IMessage, ModalFileSource } from '../../types/types';
|
|
3
3
|
import FileDownload from '../styled/UnsupportedType';
|
|
4
4
|
import CustomMessageImage from '../styled/MessageImage';
|
|
5
5
|
import CustomMessageVideo from '../styled/VideoMessage';
|
|
@@ -25,6 +25,7 @@ import AlbumGrid from './AlbumGrid';
|
|
|
25
25
|
import MediaCaption from '../MessageBubble/MediaCaption';
|
|
26
26
|
import MediaUploadOverlay from './MediaUploadOverlay';
|
|
27
27
|
import { requestMediaRetry } from '../../helpers/mediaSendRetry';
|
|
28
|
+
import { MediaSourceProvider } from '../../context/MediaSourceContext';
|
|
28
29
|
|
|
29
30
|
interface MediaMessageProps {
|
|
30
31
|
mimeType?: string;
|
|
@@ -32,6 +33,8 @@ interface MediaMessageProps {
|
|
|
32
33
|
location?: string;
|
|
33
34
|
messageText?: string;
|
|
34
35
|
isUser: boolean;
|
|
36
|
+
/** What the file viewer's Reply and Delete act on, when opened from here. */
|
|
37
|
+
viewerSource?: ModalFileSource;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
const pendingImageDims = defaultMediaDims();
|
|
@@ -289,7 +292,15 @@ const AttachmentCard: React.FC<AttachmentCardProps> = ({
|
|
|
289
292
|
}
|
|
290
293
|
};
|
|
291
294
|
|
|
292
|
-
|
|
295
|
+
// The viewer source wraps the whole bubble, so every picture and video in it
|
|
296
|
+
// (single card or album tile) opens the viewer with it.
|
|
297
|
+
const MediaMessage: React.FC<MediaMessageProps> = ({ viewerSource, ...props }) => (
|
|
298
|
+
<MediaSourceProvider value={viewerSource}>
|
|
299
|
+
<MediaMessageBody {...props} />
|
|
300
|
+
</MediaSourceProvider>
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
const MediaMessageBody: React.FC<Omit<MediaMessageProps, 'viewerSource'>> = ({
|
|
293
304
|
mimeType,
|
|
294
305
|
location: rawLocation,
|
|
295
306
|
messageText: rawMessageText,
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
import { View } from 'react-native';
|
|
11
11
|
import { useT } from '../../i18n/useT';
|
|
12
12
|
import { formatCallLogLabel } from '../../helpers/callLogMessage';
|
|
13
|
+
import { isScheduledCallMessage } from '../../booking/scheduledCall';
|
|
14
|
+
import ScheduledCallMessage from '../Booking/ScheduledCallMessage';
|
|
13
15
|
|
|
14
16
|
interface MessageContainerProps {
|
|
15
17
|
CustomMessage?: React.ComponentType<{
|
|
@@ -54,6 +56,19 @@ const MessageContainerImpl: FC<MessageContainerProps> = ({
|
|
|
54
56
|
|
|
55
57
|
const messageDate = new Date(message.date);
|
|
56
58
|
|
|
59
|
+
// Before the system-message branch: the backend sends the invite from the
|
|
60
|
+
// system account, but it is a card, not a centred pill.
|
|
61
|
+
if (isScheduledCallMessage(message)) {
|
|
62
|
+
return (
|
|
63
|
+
<ScheduledCallMessage
|
|
64
|
+
message={message}
|
|
65
|
+
config={config}
|
|
66
|
+
showDateLabel={showDateLabel}
|
|
67
|
+
CustomDaySeparator={CustomDaySeparator}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
if (message?.isSystemMessage === 'true') {
|
|
58
73
|
const SystemMessageComponent = config?.customSystemMessage;
|
|
59
74
|
return (
|
|
@@ -26,7 +26,9 @@ import '../../helpers/storeConsole';
|
|
|
26
26
|
import {installPromiseRejectionTracker} from '../../utils/installPromiseRejectionTracker';
|
|
27
27
|
import {useChatFonts} from '../../hooks/useChatFonts';
|
|
28
28
|
import {installPushTokenHook} from '../../services/pushRegistration';
|
|
29
|
+
import {installAppBadgeSync} from '../../services/appBadge';
|
|
29
30
|
import {setE2eeEnabled} from '../../e2ee';
|
|
31
|
+
import {installScheduledCallHook} from '../../booking/pendingScheduledCall';
|
|
30
32
|
|
|
31
33
|
const gestureRootStyle = {flex: 1};
|
|
32
34
|
|
|
@@ -41,6 +43,14 @@ installPromiseRejectionTracker();
|
|
|
41
43
|
// (one store subscription), no-op for hosts that never use push.
|
|
42
44
|
installPushTokenHook();
|
|
43
45
|
|
|
46
|
+
// The server sets the icon badge only with a push; in the foreground it
|
|
47
|
+
// follows the unread total instead, so opening the app clears a stale one.
|
|
48
|
+
installAppBadgeSync();
|
|
49
|
+
|
|
50
|
+
// Arms the scheduled-call link watcher: a link held before sign-in or before
|
|
51
|
+
// the chat was up opens as soon as both are true.
|
|
52
|
+
installScheduledCallHook();
|
|
53
|
+
|
|
44
54
|
interface ChatWrapperProps {
|
|
45
55
|
token?: string;
|
|
46
56
|
roomJID?: string;
|
|
@@ -32,7 +32,7 @@ import { getIconColor } from '../../helpers/getIconColor';
|
|
|
32
32
|
import { useT } from '../../i18n/useT';
|
|
33
33
|
import { useTheme } from '../../hooks/useTheme';
|
|
34
34
|
import { useRoomMute } from '../../hooks/useRoomMute';
|
|
35
|
-
import
|
|
35
|
+
import LeaveChatModal from '../Modals/ChatProfileModal/LeaveChatModal';
|
|
36
36
|
import { isMessageSearchEnabled } from '../../helpers/isMessageSearchEnabled';
|
|
37
37
|
import { useMessageSearch } from '../Modals/MessageSearchModal/useMessageSearch';
|
|
38
38
|
import type { MessageSearchHit } from '../../networking/api-requests/messageSearch.api';
|
|
@@ -97,6 +97,8 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
97
97
|
const [open, setOpen] = useState(false);
|
|
98
98
|
// The room a swiped row's Report opened the form for.
|
|
99
99
|
const [reportJid, setReportJid] = useState<string | null>(null);
|
|
100
|
+
// The room a swiped row's Leave is asking about.
|
|
101
|
+
const [leaveJid, setLeaveJid] = useState<string | null>(null);
|
|
100
102
|
const [searchTerm, setSearchTerm] = useState('');
|
|
101
103
|
const [isLongPress, setIsLongPress] = useState(false);
|
|
102
104
|
const [isDrawerOpen, setDrawerOpen] = useState(false);
|
|
@@ -140,24 +142,7 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
140
142
|
// Behind a row swiped left. Leaving is the chat profile's flow: the
|
|
141
143
|
// server takes us out of the members, then the MUC and the store.
|
|
142
144
|
const swipeActions = !config?.disableRoomSwipeActions;
|
|
143
|
-
const
|
|
144
|
-
const handleLeaveRoom = useCallback(
|
|
145
|
-
(jid: string) => {
|
|
146
|
-
Alert.alert(t('modal.leaveChat.title'), t('modal.leaveChat.description'), [
|
|
147
|
-
{ text: t('action.cancel'), style: 'cancel' },
|
|
148
|
-
{
|
|
149
|
-
text: t('action.leave'),
|
|
150
|
-
style: 'destructive',
|
|
151
|
-
onPress: async () => {
|
|
152
|
-
if (!(await leaveRoom(jid))) {
|
|
153
|
-
Alert.alert(t('toast.error'), t('toast.leaveFailed'));
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
]);
|
|
158
|
-
},
|
|
159
|
-
[leaveRoom, t]
|
|
160
|
-
);
|
|
145
|
+
const handleLeaveRoom = useCallback((jid: string) => setLeaveJid(jid), []);
|
|
161
146
|
const handleReportRoom = useCallback((jid: string) => setReportJid(jid), []);
|
|
162
147
|
const toggleRoomMuted = useRoomMute();
|
|
163
148
|
const handleToggleMute = useCallback(
|
|
@@ -592,6 +577,10 @@ const RoomList: React.FC<RoomListProps> = ({
|
|
|
592
577
|
onClose={() => setReportJid(null)}
|
|
593
578
|
/>
|
|
594
579
|
)}
|
|
580
|
+
<LeaveChatModal
|
|
581
|
+
roomJid={leaveJid}
|
|
582
|
+
onClose={() => setLeaveJid(null)}
|
|
583
|
+
/>
|
|
595
584
|
</View>
|
|
596
585
|
</>
|
|
597
586
|
)}
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import { MODAL_TYPES } from '../../helpers/constants/MODAL_TYPES';
|
|
34
34
|
import { setActiveMessage, setEditAction } from '../../roomStore/roomsSlice';
|
|
35
35
|
import styled from 'styled-components/native';
|
|
36
|
-
import { IUser, MessageProps } from '../../types/types';
|
|
36
|
+
import { IUser, MessageProps, ModalFileSource } from '../../types/types';
|
|
37
37
|
import MediaMessage from '../MainComponents/MediaMessage';
|
|
38
38
|
import MessageTranslate from './MessageTranslate';
|
|
39
39
|
import { isUnresolvedSenderId } from '../../helpers/isUnresolvedSenderId';
|
|
@@ -376,6 +376,28 @@ const Message: React.FC<MessageProps> = ({ message, isUser, isReply }) => {
|
|
|
376
376
|
return setIsPressed(false);
|
|
377
377
|
};
|
|
378
378
|
|
|
379
|
+
// What the file viewer offers for this message's pictures and videos: the
|
|
380
|
+
// same Reply and Delete as the long-press menu, under the same rules.
|
|
381
|
+
const viewerSource = useMemo<ModalFileSource | undefined>(() => {
|
|
382
|
+
if (!message?.id || !message.roomJid) {return undefined;}
|
|
383
|
+
const interactive = !config?.disableInteractions && !message.pending;
|
|
384
|
+
const parent = parseMessageReference(message);
|
|
385
|
+
const sentAt = new Date(message.date as any).getTime();
|
|
386
|
+
return {
|
|
387
|
+
messageId: message.id,
|
|
388
|
+
roomJid: message.roomJid,
|
|
389
|
+
own: interactive && isUser,
|
|
390
|
+
replyTo:
|
|
391
|
+
interactive && !isReply && !config?.disableReplies
|
|
392
|
+
? parent
|
|
393
|
+
? { id: parent.id, chatJID: parent.roomJid || message.roomJid }
|
|
394
|
+
: { id: message.id, chatJID: message.roomJid }
|
|
395
|
+
: undefined,
|
|
396
|
+
senderName: senderNamePending ? undefined : senderDisplayName,
|
|
397
|
+
timestamp: Number.isFinite(sentAt) ? sentAt : undefined,
|
|
398
|
+
};
|
|
399
|
+
}, [message, isUser, isReply, config?.disableInteractions, config?.disableReplies, senderNamePending, senderDisplayName]);
|
|
400
|
+
|
|
379
401
|
const handleDeleteMessage = () => {
|
|
380
402
|
dispatch(
|
|
381
403
|
setDeleteModal({
|
|
@@ -625,6 +647,7 @@ const Message: React.FC<MessageProps> = ({ message, isUser, isReply }) => {
|
|
|
625
647
|
location={message?.location}
|
|
626
648
|
message={message}
|
|
627
649
|
isUser={isUser}
|
|
650
|
+
viewerSource={viewerSource}
|
|
628
651
|
/>
|
|
629
652
|
) : (
|
|
630
653
|
<>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
import React, { useMemo, useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ActivityIndicator,
|
|
6
|
+
Image,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
TouchableOpacity,
|
|
10
|
+
View,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { useSelector, useStore } from 'react-redux';
|
|
13
|
+
import type { RootState } from '../../../roomStore';
|
|
14
|
+
import type { ModalFile } from '../../../types/types';
|
|
15
|
+
import { collectRoomMedia } from '../../../helpers/roomMedia';
|
|
16
|
+
import { loadRoomHistory } from '../../../helpers/loadRoomHistory';
|
|
17
|
+
import { useFileToken } from '../../../hooks/useFileToken';
|
|
18
|
+
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
19
|
+
import { useXmppClient } from '../../../context/xmppProvider';
|
|
20
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
21
|
+
import { getIconColor } from '../../../helpers/getIconColor';
|
|
22
|
+
import { useT } from '../../../i18n/useT';
|
|
23
|
+
import { PlayIcon } from '../../../assets/icons';
|
|
24
|
+
import type { ChatTheme } from '../../../theme/theme';
|
|
25
|
+
|
|
26
|
+
/** Older history pages asked for from here; one at a time per room. */
|
|
27
|
+
const inFlight = new Set<string>();
|
|
28
|
+
const PAGE_SIZE = 30;
|
|
29
|
+
|
|
30
|
+
interface ChatMediaGridProps {
|
|
31
|
+
roomJid: string;
|
|
32
|
+
/** Opens the viewer; the file comes with the whole grid as its siblings. */
|
|
33
|
+
onOpen: (file: ModalFile) => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The chat profile's Media tab: a three-column grid of the room's pictures
|
|
38
|
+
* and videos. It shows what history is loaded and pages older history in on
|
|
39
|
+
* demand, the same MAM pages the message list asks for.
|
|
40
|
+
*/
|
|
41
|
+
const ChatMediaGrid: React.FC<ChatMediaGridProps> = ({ roomJid, onOpen }) => {
|
|
42
|
+
const t = useT();
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
45
|
+
const store = useStore<RootState>();
|
|
46
|
+
const { client } = useXmppClient();
|
|
47
|
+
const fileToken = useFileToken();
|
|
48
|
+
const { user, config } = useChatSettingState();
|
|
49
|
+
const messages = useSelector(
|
|
50
|
+
(state: RootState) => state.rooms.rooms?.[roomJid]?.messages
|
|
51
|
+
);
|
|
52
|
+
const historyComplete = useSelector(
|
|
53
|
+
(state: RootState) => !!state.rooms.rooms?.[roomJid]?.historyComplete
|
|
54
|
+
);
|
|
55
|
+
const [loadingMore, setLoadingMore] = useState(false);
|
|
56
|
+
|
|
57
|
+
const files = useMemo(
|
|
58
|
+
() =>
|
|
59
|
+
collectRoomMedia(messages, roomJid, {
|
|
60
|
+
me: user,
|
|
61
|
+
fileToken,
|
|
62
|
+
interactive: !config?.disableInteractions,
|
|
63
|
+
repliesOn: !config?.disableReplies,
|
|
64
|
+
}),
|
|
65
|
+
[messages, roomJid, user, fileToken, config?.disableInteractions, config?.disableReplies]
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const loadMore = () =>
|
|
69
|
+
loadRoomHistory({
|
|
70
|
+
client,
|
|
71
|
+
room: store.getState().rooms.rooms?.[roomJid],
|
|
72
|
+
inFlight,
|
|
73
|
+
chatJID: roomJid,
|
|
74
|
+
max: PAGE_SIZE,
|
|
75
|
+
onBusyChange: setLoadingMore,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<View>
|
|
80
|
+
{files.length === 0 && !loadingMore ? (
|
|
81
|
+
<Text testID="chat-profile-media-empty" style={styles.empty}>
|
|
82
|
+
{t('modal.chatProfile.mediaEmpty')}
|
|
83
|
+
</Text>
|
|
84
|
+
) : (
|
|
85
|
+
<View style={styles.grid}>
|
|
86
|
+
{files.map((file, index) => {
|
|
87
|
+
const isVideo = file.mimetype.startsWith('video/');
|
|
88
|
+
const thumb = isVideo ? file.previewURL : file.fileURL;
|
|
89
|
+
return (
|
|
90
|
+
<TouchableOpacity
|
|
91
|
+
key={`${file.source?.messageId}-${index}`}
|
|
92
|
+
testID={`chat-profile-media-${index}`}
|
|
93
|
+
activeOpacity={0.8}
|
|
94
|
+
style={styles.tile}
|
|
95
|
+
onPress={() => onOpen({ ...file, siblings: files, index })}
|
|
96
|
+
>
|
|
97
|
+
{!!thumb && (
|
|
98
|
+
<Image source={{ uri: thumb }} style={styles.image} resizeMode="cover" />
|
|
99
|
+
)}
|
|
100
|
+
{isVideo && (
|
|
101
|
+
<View style={styles.videoBadge} pointerEvents="none">
|
|
102
|
+
<PlayIcon width={18} height={18} />
|
|
103
|
+
</View>
|
|
104
|
+
)}
|
|
105
|
+
</TouchableOpacity>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</View>
|
|
109
|
+
)}
|
|
110
|
+
|
|
111
|
+
{loadingMore ? (
|
|
112
|
+
<ActivityIndicator style={styles.more} color={getIconColor(config)} />
|
|
113
|
+
) : (
|
|
114
|
+
!historyComplete && (
|
|
115
|
+
<TouchableOpacity
|
|
116
|
+
testID="chat-profile-media-load-more"
|
|
117
|
+
activeOpacity={0.7}
|
|
118
|
+
style={styles.more}
|
|
119
|
+
onPress={loadMore}
|
|
120
|
+
>
|
|
121
|
+
<Text style={[styles.moreLabel, { color: getIconColor(config) }]}>
|
|
122
|
+
{t('search.messages.loadMore')}
|
|
123
|
+
</Text>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
)
|
|
126
|
+
)}
|
|
127
|
+
</View>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const createStyles = (theme: ChatTheme) => StyleSheet.create({
|
|
132
|
+
grid: {
|
|
133
|
+
flexDirection: 'row',
|
|
134
|
+
flexWrap: 'wrap',
|
|
135
|
+
gap: 6,
|
|
136
|
+
},
|
|
137
|
+
tile: {
|
|
138
|
+
width: '31.8%',
|
|
139
|
+
aspectRatio: 1,
|
|
140
|
+
borderRadius: 10,
|
|
141
|
+
overflow: 'hidden',
|
|
142
|
+
backgroundColor: theme.dark ? theme.surfaceSecondary : '#1F1F1F',
|
|
143
|
+
},
|
|
144
|
+
image: {
|
|
145
|
+
width: '100%',
|
|
146
|
+
height: '100%',
|
|
147
|
+
},
|
|
148
|
+
videoBadge: {
|
|
149
|
+
position: 'absolute',
|
|
150
|
+
left: 6,
|
|
151
|
+
bottom: 6,
|
|
152
|
+
width: 28,
|
|
153
|
+
height: 28,
|
|
154
|
+
borderRadius: 14,
|
|
155
|
+
backgroundColor: 'rgba(0, 0, 0, 0.55)',
|
|
156
|
+
alignItems: 'center',
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
},
|
|
159
|
+
empty: {
|
|
160
|
+
paddingVertical: 16,
|
|
161
|
+
textAlign: 'center',
|
|
162
|
+
color: theme.textSecondary,
|
|
163
|
+
},
|
|
164
|
+
more: {
|
|
165
|
+
paddingVertical: 14,
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
},
|
|
168
|
+
moreLabel: {
|
|
169
|
+
fontSize: 15,
|
|
170
|
+
fontWeight: '500',
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export default ChatMediaGrid;
|
|
@@ -49,7 +49,7 @@ import { MODAL_TYPES } from '../../../helpers/constants/MODAL_TYPES';
|
|
|
49
49
|
import SelectUsersModal from '../SelectUsersModal/SelectUsersModal';
|
|
50
50
|
import { useToast } from '../../../context/ToastContext';
|
|
51
51
|
import { useRoomMute } from '../../../hooks/useRoomMute';
|
|
52
|
-
import
|
|
52
|
+
import LeaveChatModal from './LeaveChatModal';
|
|
53
53
|
import { useT } from '../../../i18n/useT';
|
|
54
54
|
import DeleteChatModal from './DeleteChatModal';
|
|
55
55
|
import { isMessageSearchEnabled } from '../../../helpers/isMessageSearchEnabled';
|
|
@@ -67,6 +67,10 @@ import {
|
|
|
67
67
|
isRoomMembersTruncated,
|
|
68
68
|
} from '../../../helpers/roomUserCount';
|
|
69
69
|
import { useRoomDirectory } from '../../../hooks/useRoomDirectory';
|
|
70
|
+
import ChatMediaGrid from './ChatMediaGrid';
|
|
71
|
+
import MediaViewer from '../FilePreviewModal/MediaViewer';
|
|
72
|
+
import { useSaveFile } from '../FilePreviewModal/useSaveFile';
|
|
73
|
+
import type { ModalFile } from '../../../types/types';
|
|
70
74
|
|
|
71
75
|
/** Member rows rendered per step; the rest sits behind a 'Show more' row. */
|
|
72
76
|
export const MEMBER_PAGE_SIZE = 50;
|
|
@@ -103,6 +107,11 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
103
107
|
const [loading, setLoading] = useState<boolean>(false);
|
|
104
108
|
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
|
105
109
|
const [isReportOpen, setIsReportOpen] = useState(false);
|
|
110
|
+
const [isLeaveOpen, setIsLeaveOpen] = useState(false);
|
|
111
|
+
const [activeTab, setActiveTab] = useState<'members' | 'media'>('members');
|
|
112
|
+
// A picture or video opened from the Media tab, shown over this screen.
|
|
113
|
+
const [viewerFile, setViewerFile] = useState<ModalFile | null>(null);
|
|
114
|
+
const saveFile = useSaveFile();
|
|
106
115
|
const [memberQuery, setMemberQuery] = useState('');
|
|
107
116
|
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
108
117
|
// Measured, not guessed: this screen renders inside whatever frame the
|
|
@@ -113,7 +122,6 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
113
122
|
const { showToast } = useToast();
|
|
114
123
|
const dispatch = useDispatch();
|
|
115
124
|
const { client } = useXmppClient();
|
|
116
|
-
const leaveRoom = useLeaveRoom();
|
|
117
125
|
const { user: stateUser, config } = useChatSettingState();
|
|
118
126
|
const theme = useTheme();
|
|
119
127
|
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
@@ -343,27 +351,13 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
343
351
|
// Leaving takes us out of the members on the server, then out of the MUC;
|
|
344
352
|
// dropping the room from the store is what takes the user out of the chat
|
|
345
353
|
// in the UI, and the `!activeRoom` effect above then closes this modal.
|
|
346
|
-
const handleLeave = () =>
|
|
347
|
-
Alert.alert(t('modal.leaveChat.title'), t('modal.leaveChat.description'), [
|
|
348
|
-
{ text: t('action.cancel'), style: 'cancel' },
|
|
349
|
-
{
|
|
350
|
-
text: t('action.leave'),
|
|
351
|
-
style: 'destructive',
|
|
352
|
-
onPress: async () => {
|
|
353
|
-
if (!(await leaveRoom(activeRoom?.jid || ''))) {
|
|
354
|
-
Alert.alert(t('toast.error'), t('toast.leaveFailed'));
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
handleCloseModal?.();
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
]);
|
|
361
|
-
};
|
|
354
|
+
const handleLeave = () => setIsLeaveOpen(true);
|
|
362
355
|
|
|
363
356
|
const isModerator = activeRoom?.role === 'moderator';
|
|
364
357
|
const canEditIcon =
|
|
365
358
|
!config?.disableChatInfo?.disableIconEdit && activeRoom?.role !== 'participant';
|
|
366
359
|
const canAddMembers = isModerator && activeRoom?.type === 'group';
|
|
360
|
+
const showMembers = !config?.disableChatInfo?.hideMembers;
|
|
367
361
|
const canDeleteChat = isModerator && activeRoom?.type !== 'private';
|
|
368
362
|
const hasIcon = !!activeRoom?.icon;
|
|
369
363
|
|
|
@@ -379,10 +373,19 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
379
373
|
collapsedForSearchRef.current = true;
|
|
380
374
|
scrollHeaderTo(target);
|
|
381
375
|
}
|
|
376
|
+
setActiveTab('members');
|
|
382
377
|
setIsSearchOpen(true);
|
|
383
378
|
setTimeout(() => searchInputRef.current?.focus(), 50);
|
|
384
379
|
};
|
|
385
380
|
|
|
381
|
+
// Search looks through this chat's messages, like the room list's search
|
|
382
|
+
// does across chats. Where message search is off it falls back to the
|
|
383
|
+
// member search it used to be; members keep their own magnifier either way.
|
|
384
|
+
const openSearch = () =>
|
|
385
|
+
isMessageSearchEnabled(config)
|
|
386
|
+
? dispatch(setActiveModal(MODAL_TYPES.CHAT_MESSAGE_SEARCH))
|
|
387
|
+
: openMemberSearch();
|
|
388
|
+
|
|
386
389
|
const restoreHeader = () => {
|
|
387
390
|
if (!collapsedForSearchRef.current) {return;}
|
|
388
391
|
collapsedForSearchRef.current = false;
|
|
@@ -432,7 +435,7 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
432
435
|
key: 'search',
|
|
433
436
|
label: t('action.search'),
|
|
434
437
|
icon: (color: string) => <SearchIcon color={color} />,
|
|
435
|
-
onPress:
|
|
438
|
+
onPress: openSearch,
|
|
436
439
|
},
|
|
437
440
|
{
|
|
438
441
|
key: 'leave',
|
|
@@ -478,7 +481,7 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
478
481
|
key: 'search',
|
|
479
482
|
label: t('action.search'),
|
|
480
483
|
icon: <SearchIcon color={theme.text} width={18} height={18} />,
|
|
481
|
-
onPress:
|
|
484
|
+
onPress: openSearch,
|
|
482
485
|
});
|
|
483
486
|
}
|
|
484
487
|
items.push({
|
|
@@ -593,24 +596,61 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
593
596
|
</View>
|
|
594
597
|
)}
|
|
595
598
|
|
|
596
|
-
{isMessageSearchEnabled(config) && (
|
|
597
|
-
<View style={styles.card}>
|
|
598
|
-
<TouchableOpacity
|
|
599
|
-
testID="chat-profile-search-messages"
|
|
600
|
-
activeOpacity={0.7}
|
|
601
|
-
style={styles.addMembersRow}
|
|
602
|
-
onPress={() => dispatch(setActiveModal(MODAL_TYPES.MESSAGE_SEARCH))}
|
|
603
|
-
>
|
|
604
|
-
<SearchIcon color={getIconColor(config)} />
|
|
605
|
-
<Text style={styles.addMembersLabel}>
|
|
606
|
-
{t('search.messages.title')}
|
|
607
|
-
</Text>
|
|
608
|
-
</TouchableOpacity>
|
|
609
|
-
</View>
|
|
610
|
-
)}
|
|
611
599
|
|
|
612
|
-
{
|
|
613
|
-
|
|
600
|
+
<View style={styles.card}>
|
|
601
|
+
{showMembers ? (
|
|
602
|
+
<View style={styles.tabsRow}>
|
|
603
|
+
{(['members', 'media'] as const).map((tab) => {
|
|
604
|
+
const active = tab === activeTab;
|
|
605
|
+
return (
|
|
606
|
+
<TouchableOpacity
|
|
607
|
+
key={tab}
|
|
608
|
+
testID={`chat-profile-tab-${tab}`}
|
|
609
|
+
activeOpacity={0.7}
|
|
610
|
+
style={[
|
|
611
|
+
styles.tab,
|
|
612
|
+
active && { borderBottomColor: getIconColor(config) },
|
|
613
|
+
]}
|
|
614
|
+
onPress={() => setActiveTab(tab)}
|
|
615
|
+
>
|
|
616
|
+
<Text
|
|
617
|
+
style={[
|
|
618
|
+
styles.tabLabel,
|
|
619
|
+
getElementFont(config, 'profileSectionLabel'),
|
|
620
|
+
active && { color: getIconColor(config) },
|
|
621
|
+
]}
|
|
622
|
+
>
|
|
623
|
+
{tab === 'members'
|
|
624
|
+
? t('modal.chatProfile.membersLabel', { count: memberCount })
|
|
625
|
+
: t('modal.chatProfile.media')}
|
|
626
|
+
</Text>
|
|
627
|
+
</TouchableOpacity>
|
|
628
|
+
);
|
|
629
|
+
})}
|
|
630
|
+
{activeTab === 'members' && !isSearchOpen && (
|
|
631
|
+
<TouchableOpacity
|
|
632
|
+
testID="chat-profile-member-search-open"
|
|
633
|
+
accessibilityRole="button"
|
|
634
|
+
accessibilityLabel={t('search.members')}
|
|
635
|
+
activeOpacity={0.7}
|
|
636
|
+
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
|
|
637
|
+
style={styles.tabsSearch}
|
|
638
|
+
onPress={openMemberSearch}
|
|
639
|
+
>
|
|
640
|
+
<SearchIcon color={theme.textSecondary} width={18} height={18} />
|
|
641
|
+
</TouchableOpacity>
|
|
642
|
+
)}
|
|
643
|
+
</View>
|
|
644
|
+
) : (
|
|
645
|
+
<Text style={[styles.cardLabel, getElementFont(config, 'profileSectionLabel')]}>
|
|
646
|
+
{t('modal.chatProfile.media')}
|
|
647
|
+
</Text>
|
|
648
|
+
)}
|
|
649
|
+
|
|
650
|
+
{!showMembers || activeTab === 'media' ? (
|
|
651
|
+
<ChatMediaGrid roomJid={activeRoom.jid} onOpen={setViewerFile} />
|
|
652
|
+
) : (
|
|
653
|
+
<>
|
|
614
654
|
{canAddMembers && (
|
|
615
655
|
<SelectUsersModal
|
|
616
656
|
trigger={(open) => (
|
|
@@ -629,15 +669,6 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
629
669
|
/>
|
|
630
670
|
)}
|
|
631
671
|
|
|
632
|
-
<Text
|
|
633
|
-
style={[
|
|
634
|
-
styles.cardLabel,
|
|
635
|
-
getElementFont(config, 'profileSectionLabel'),
|
|
636
|
-
]}
|
|
637
|
-
>
|
|
638
|
-
{t('modal.chatProfile.membersLabel', { count: memberCount })}
|
|
639
|
-
</Text>
|
|
640
|
-
|
|
641
672
|
{isSearchOpen && (
|
|
642
673
|
<View style={styles.searchRow}>
|
|
643
674
|
<SearchIcon color={theme.textSecondary} width={18} height={18} />
|
|
@@ -773,8 +804,9 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
773
804
|
</Text>
|
|
774
805
|
</TouchableOpacity>
|
|
775
806
|
)}
|
|
776
|
-
|
|
777
|
-
|
|
807
|
+
</>
|
|
808
|
+
)}
|
|
809
|
+
</View>
|
|
778
810
|
</View>
|
|
779
811
|
</Animated.ScrollView>
|
|
780
812
|
|
|
@@ -798,6 +830,24 @@ const ChatProfileModal: React.FC<ChatProfileModalProps> = ({
|
|
|
798
830
|
visible={isReportOpen}
|
|
799
831
|
onClose={() => setIsReportOpen(false)}
|
|
800
832
|
/>
|
|
833
|
+
<LeaveChatModal
|
|
834
|
+
roomJid={isLeaveOpen && activeRoom?.jid ? activeRoom.jid : null}
|
|
835
|
+
onClose={() => setIsLeaveOpen(false)}
|
|
836
|
+
onLeft={() => handleCloseModal?.()}
|
|
837
|
+
/>
|
|
838
|
+
{viewerFile && (
|
|
839
|
+
<MediaViewer
|
|
840
|
+
file={viewerFile}
|
|
841
|
+
onClose={() => setViewerFile(null)}
|
|
842
|
+
onPage={(index) => {
|
|
843
|
+
const next = viewerFile.siblings?.[index];
|
|
844
|
+
if (next) {setViewerFile({ ...next, siblings: viewerFile.siblings, index });}
|
|
845
|
+
}}
|
|
846
|
+
onSave={() => saveFile(viewerFile)}
|
|
847
|
+
// Reply opens the thread in the chat underneath this screen.
|
|
848
|
+
onReplyOpened={() => handleCloseModal?.()}
|
|
849
|
+
/>
|
|
850
|
+
)}
|
|
801
851
|
</ModalContainerFullScreen>
|
|
802
852
|
);
|
|
803
853
|
};
|
|
@@ -818,6 +868,27 @@ const createStyles = (theme: ChatTheme) => StyleSheet.create({
|
|
|
818
868
|
padding: 12,
|
|
819
869
|
gap: 12,
|
|
820
870
|
},
|
|
871
|
+
tabsRow: {
|
|
872
|
+
flexDirection: 'row',
|
|
873
|
+
gap: 20,
|
|
874
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
875
|
+
borderBottomColor: theme.border,
|
|
876
|
+
marginBottom: 12,
|
|
877
|
+
},
|
|
878
|
+
tabsSearch: {
|
|
879
|
+
marginLeft: 'auto',
|
|
880
|
+
paddingBottom: 10,
|
|
881
|
+
},
|
|
882
|
+
tab: {
|
|
883
|
+
paddingBottom: 10,
|
|
884
|
+
borderBottomWidth: 2,
|
|
885
|
+
borderBottomColor: 'transparent',
|
|
886
|
+
},
|
|
887
|
+
tabLabel: {
|
|
888
|
+
fontSize: 15,
|
|
889
|
+
fontWeight: '500',
|
|
890
|
+
color: theme.textSecondary,
|
|
891
|
+
},
|
|
821
892
|
card: {
|
|
822
893
|
backgroundColor: theme.surface,
|
|
823
894
|
borderRadius: 14,
|