@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
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import type {
|
|
4
|
+
P2PCallController,
|
|
5
|
+
P2PSnapshot,
|
|
6
|
+
} from '../../calls/p2p/P2PCallController';
|
|
7
|
+
import { loadLiveKit } from './livekitRuntime';
|
|
8
|
+
import { translateCallString } from './callActions';
|
|
9
|
+
import { CallSessionSnapshot, IDLE_SESSION } from './callSessionTypes';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The peer to peer call, seen through the same snapshot the LiveKit session
|
|
13
|
+
* produces (callSessionController.ts), so the call screen, the minimized
|
|
14
|
+
* strip, CallKit and the ongoing-call notification serve both transports.
|
|
15
|
+
*
|
|
16
|
+
* Like the LiveKit session it is owned outside React: P2PCallRunner binds the
|
|
17
|
+
* controller of the current call here and unbinds it when the call stops.
|
|
18
|
+
* Video is handed to the UI as a `{ streamURL, key }` handle for RTCView;
|
|
19
|
+
* remote audio needs nothing, react-native-webrtc plays it on its own.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// The controller words its failures in English (it is shared with the web
|
|
23
|
+
// SDK); the strings the user can see are mapped to the translated tables here.
|
|
24
|
+
const MESSAGE_KEYS: Record<string, string> = {
|
|
25
|
+
'Camera or microphone permission denied': 'call.error.deviceBlocked',
|
|
26
|
+
'No camera or microphone found on this device': 'call.error.deviceNotFound',
|
|
27
|
+
'Your camera or microphone is already in use by another app':
|
|
28
|
+
'call.error.deviceInUse',
|
|
29
|
+
'Could not access your camera or microphone': 'call.error.deviceGeneric',
|
|
30
|
+
'The other person could not access their camera or microphone':
|
|
31
|
+
'call.error.p2pPeerMedia',
|
|
32
|
+
'The call could not be connected': 'call.error.p2pConnect',
|
|
33
|
+
'Could not connect the call': 'call.error.p2pConnect',
|
|
34
|
+
'Could not start the call': 'call.error.p2pSetup',
|
|
35
|
+
'Could not set up the call': 'call.error.p2pSetup',
|
|
36
|
+
'Connection lost': 'call.error.p2pConnectionLost',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** Translated version of a message the p2p controller produced. */
|
|
40
|
+
export const localizeP2PMessage = (message: string): string => {
|
|
41
|
+
const key = MESSAGE_KEYS[message];
|
|
42
|
+
return key ? translateCallString(key) : message;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
interface Bound {
|
|
46
|
+
controller: P2PCallController;
|
|
47
|
+
kind: 'audio' | 'video';
|
|
48
|
+
unsubscribe: () => void;
|
|
49
|
+
/** First time media flowed; kept across reconnects. */
|
|
50
|
+
connectedAt: number | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let bound: Bound | null = null;
|
|
54
|
+
let snapshot: CallSessionSnapshot = IDLE_SESSION;
|
|
55
|
+
let speakerOn = false;
|
|
56
|
+
let facingMode: 'user' | 'environment' = 'user';
|
|
57
|
+
let remoteHandle: any = null;
|
|
58
|
+
let localHandle: any = null;
|
|
59
|
+
const listeners = new Set<() => void>();
|
|
60
|
+
|
|
61
|
+
const emit = (next: CallSessionSnapshot) => {
|
|
62
|
+
snapshot = next;
|
|
63
|
+
listeners.forEach((listener) => listener());
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const subscribe = (listener: () => void) => {
|
|
67
|
+
listeners.add(listener);
|
|
68
|
+
return () => {
|
|
69
|
+
listeners.delete(listener);
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const getP2PSessionSnapshot = (): CallSessionSnapshot => snapshot;
|
|
74
|
+
|
|
75
|
+
export const isP2PSessionActive = (): boolean => bound !== null;
|
|
76
|
+
|
|
77
|
+
export const useP2PSession = (): CallSessionSnapshot =>
|
|
78
|
+
useSyncExternalStore(subscribe, getP2PSessionSnapshot, getP2PSessionSnapshot);
|
|
79
|
+
|
|
80
|
+
// A video handle for RTCView. RTCView binds to the stream's video track when
|
|
81
|
+
// the stream URL is set, so the key carries the track ids: a camera that is
|
|
82
|
+
// turned off and on again, or a remote video that arrives late, remounts the
|
|
83
|
+
// view onto the stream as it is now.
|
|
84
|
+
const videoHandle = (
|
|
85
|
+
stream: MediaStream | null,
|
|
86
|
+
previous: any
|
|
87
|
+
): { handle: any } => {
|
|
88
|
+
const tracks = stream?.getVideoTracks?.() || [];
|
|
89
|
+
if (!stream || tracks.length === 0) return { handle: null };
|
|
90
|
+
const streamURL = String((stream as any).toURL?.() ?? '');
|
|
91
|
+
if (!streamURL) return { handle: null };
|
|
92
|
+
const key = `${streamURL}|${tracks.map((t) => t.id).join(',')}`;
|
|
93
|
+
if (previous && previous.key === key) return { handle: previous };
|
|
94
|
+
return { handle: { streamURL, key } };
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const connectedStatus = (status: P2PSnapshot['status']): boolean =>
|
|
98
|
+
status === 'waiting' || status === 'connected';
|
|
99
|
+
|
|
100
|
+
const build = (current: Bound, p2p: P2PSnapshot): CallSessionSnapshot => {
|
|
101
|
+
const hasMedia = p2p.status === 'connected' || p2p.status === 'reconnecting';
|
|
102
|
+
if (hasMedia && current.connectedAt === null) {
|
|
103
|
+
current.connectedAt = Date.now();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const remote = videoHandle(
|
|
107
|
+
p2p.remoteVideoLive ? p2p.remoteStream : null,
|
|
108
|
+
remoteHandle
|
|
109
|
+
);
|
|
110
|
+
remoteHandle = remote.handle;
|
|
111
|
+
const local = videoHandle(
|
|
112
|
+
current.kind === 'video' && p2p.camEnabled ? p2p.localStream : null,
|
|
113
|
+
localHandle
|
|
114
|
+
);
|
|
115
|
+
localHandle = local.handle;
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
...IDLE_SESSION,
|
|
119
|
+
active: true,
|
|
120
|
+
// "Connected" here means the offer is out or media flows, i.e. the
|
|
121
|
+
// screen may say "waiting for the other person" instead of "connecting".
|
|
122
|
+
connected: connectedStatus(p2p.status),
|
|
123
|
+
deviceError: p2p.notice ? localizeP2PMessage(p2p.notice) : null,
|
|
124
|
+
micOn: p2p.micEnabled,
|
|
125
|
+
cameraOn: current.kind === 'video' && p2p.camEnabled,
|
|
126
|
+
speakerOn,
|
|
127
|
+
facingMode,
|
|
128
|
+
remoteVideo: remoteHandle,
|
|
129
|
+
localVideo: localHandle,
|
|
130
|
+
remoteJoined: hasMedia,
|
|
131
|
+
anchorAt: current.connectedAt,
|
|
132
|
+
reconnecting: p2p.status === 'reconnecting',
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const refresh = () => {
|
|
137
|
+
if (!bound) return;
|
|
138
|
+
emit(build(bound, bound.controller.getSnapshot()));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Show `controller`'s call through the session snapshot. Returns the unbind
|
|
143
|
+
* function. Only one call is ever bound; binding another replaces it.
|
|
144
|
+
*/
|
|
145
|
+
export const bindP2PSession = (
|
|
146
|
+
controller: P2PCallController,
|
|
147
|
+
kind: 'audio' | 'video'
|
|
148
|
+
): (() => void) => {
|
|
149
|
+
if (bound?.controller === controller) return unbindFor(controller);
|
|
150
|
+
if (bound) unbindP2PSession();
|
|
151
|
+
speakerOn = kind === 'video';
|
|
152
|
+
facingMode = 'user';
|
|
153
|
+
remoteHandle = null;
|
|
154
|
+
localHandle = null;
|
|
155
|
+
const current: Bound = {
|
|
156
|
+
controller,
|
|
157
|
+
kind,
|
|
158
|
+
unsubscribe: controller.subscribe(refresh),
|
|
159
|
+
connectedAt: null,
|
|
160
|
+
};
|
|
161
|
+
bound = current;
|
|
162
|
+
refresh();
|
|
163
|
+
return unbindFor(controller);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const unbindFor = (controller: P2PCallController) => () => {
|
|
167
|
+
if (bound?.controller === controller) unbindP2PSession();
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const unbindP2PSession = (): void => {
|
|
171
|
+
const current = bound;
|
|
172
|
+
if (!current) return;
|
|
173
|
+
bound = null;
|
|
174
|
+
current.unsubscribe();
|
|
175
|
+
remoteHandle = null;
|
|
176
|
+
localHandle = null;
|
|
177
|
+
try {
|
|
178
|
+
void loadLiveKit()?.AudioSession?.stopAudioSession();
|
|
179
|
+
} catch {
|
|
180
|
+
// Never let teardown throw.
|
|
181
|
+
}
|
|
182
|
+
emit(IDLE_SESSION);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Claim the native audio session before the connection comes up. Without
|
|
187
|
+
* this the first seconds route to the earpiece on Android even for a video
|
|
188
|
+
* call (the LiveKit session does the same before `room.connect`). Best
|
|
189
|
+
* effort: a call answered from CallKit already owns the iOS session.
|
|
190
|
+
*/
|
|
191
|
+
export const prepareP2PAudio = async (
|
|
192
|
+
kind: 'audio' | 'video'
|
|
193
|
+
): Promise<void> => {
|
|
194
|
+
const audio = loadLiveKit()?.AudioSession;
|
|
195
|
+
if (!audio) return;
|
|
196
|
+
try {
|
|
197
|
+
await audio.startAudioSession();
|
|
198
|
+
} catch {
|
|
199
|
+
// CallKit activates the iOS audio session itself.
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
await audio.setAppleAudioConfiguration?.({
|
|
203
|
+
audioCategory: 'playAndRecord',
|
|
204
|
+
audioCategoryOptions: kind === 'video' ? ['defaultToSpeaker'] : [],
|
|
205
|
+
audioMode: kind === 'video' ? 'videoChat' : 'voiceChat',
|
|
206
|
+
});
|
|
207
|
+
} catch {
|
|
208
|
+
// iOS-only helper.
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/** Audio session first, then media and the offer / answer. */
|
|
213
|
+
export const startP2PController = async (
|
|
214
|
+
controller: P2PCallController,
|
|
215
|
+
kind: 'audio' | 'video'
|
|
216
|
+
): Promise<void> => {
|
|
217
|
+
await prepareP2PAudio(kind);
|
|
218
|
+
if (bound?.controller !== controller) {
|
|
219
|
+
// The call was cancelled while the audio session was coming up.
|
|
220
|
+
try {
|
|
221
|
+
void loadLiveKit()?.AudioSession?.stopAudioSession();
|
|
222
|
+
} catch {
|
|
223
|
+
// Never let teardown throw.
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
await controller.start();
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// ---- controls -----------------------------------------------------------
|
|
231
|
+
|
|
232
|
+
export const setP2PMicEnabled = (next: boolean): void => {
|
|
233
|
+
const current = bound;
|
|
234
|
+
if (!current || current.controller.getSnapshot().micEnabled === next) return;
|
|
235
|
+
current.controller.toggleMic();
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const toggleP2PCamera = async (): Promise<void> => {
|
|
239
|
+
const current = bound;
|
|
240
|
+
if (!current) return;
|
|
241
|
+
await current.controller.toggleCamera();
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/** Front / back camera of the live local video track. */
|
|
245
|
+
export const switchP2PCamera = (): void => {
|
|
246
|
+
const current = bound;
|
|
247
|
+
if (!current) return;
|
|
248
|
+
const track: any = current.controller.getSnapshot().localStream?.getVideoTracks?.()[0];
|
|
249
|
+
if (!track || typeof track._switchCamera !== 'function') return;
|
|
250
|
+
try {
|
|
251
|
+
track._switchCamera();
|
|
252
|
+
facingMode = facingMode === 'user' ? 'environment' : 'user';
|
|
253
|
+
refresh();
|
|
254
|
+
} catch {
|
|
255
|
+
// The camera stays where it was.
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export const toggleP2PSpeaker = async (): Promise<void> => {
|
|
260
|
+
const current = bound;
|
|
261
|
+
const audio = loadLiveKit()?.AudioSession;
|
|
262
|
+
if (!current || !audio) return;
|
|
263
|
+
const next = !speakerOn;
|
|
264
|
+
speakerOn = next;
|
|
265
|
+
refresh();
|
|
266
|
+
try {
|
|
267
|
+
if (Platform.OS === 'android') {
|
|
268
|
+
await audio.selectAudioOutput(next ? 'speaker' : 'earpiece');
|
|
269
|
+
} else {
|
|
270
|
+
await audio.setAppleAudioConfiguration?.({
|
|
271
|
+
audioCategory: 'playAndRecord',
|
|
272
|
+
audioCategoryOptions: next ? ['defaultToSpeaker'] : [],
|
|
273
|
+
audioMode: next ? 'videoChat' : 'voiceChat',
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
} catch {
|
|
277
|
+
speakerOn = !next;
|
|
278
|
+
refresh();
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const dismissP2PDeviceError = (): void => {
|
|
283
|
+
bound?.controller.dismissNotice();
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/** Reset module state. Test seam only. */
|
|
287
|
+
export const __resetP2PCallSessionForTests = (): void => {
|
|
288
|
+
unbindP2PSession();
|
|
289
|
+
speakerOn = false;
|
|
290
|
+
facingMode = 'user';
|
|
291
|
+
};
|
|
@@ -6,6 +6,7 @@ import { acceptIncomingCall } from '../../roomStore/callSlice';
|
|
|
6
6
|
import { declineActiveCallWhenOnline, terminateActiveCall } from './callActions';
|
|
7
7
|
import { setCallMicEnabled, useCallSession } from './callSessionController';
|
|
8
8
|
import { loadLiveKit } from './livekitRuntime';
|
|
9
|
+
import { loadWebRTC } from '../../calls/p2p/webrtcRuntime';
|
|
9
10
|
import { setCallSystemRinging } from './callUiStore';
|
|
10
11
|
import {
|
|
11
12
|
callKitUuid,
|
|
@@ -42,6 +43,12 @@ import {
|
|
|
42
43
|
|
|
43
44
|
export { loadCallKeep };
|
|
44
45
|
|
|
46
|
+
// WebRTC's view of the iOS audio session. The LiveKit bridge and the p2p one
|
|
47
|
+
// load the same class from the same fork; a p2p-only host may have no
|
|
48
|
+
// LiveKit JS at all.
|
|
49
|
+
const rtcAudioSession = () =>
|
|
50
|
+
loadLiveKit()?.RTCAudioSession ?? loadWebRTC()?.RTCAudioSession ?? null;
|
|
51
|
+
|
|
45
52
|
const trace = (...args: unknown[]) => {
|
|
46
53
|
if (__DEV__) {console.log('[calls] CallKit:', ...args);}
|
|
47
54
|
};
|
|
@@ -183,14 +190,14 @@ export const useCallKeep = (): void => {
|
|
|
183
190
|
// unit once CallKit has activated the session.
|
|
184
191
|
const onAudioActivated = () => {
|
|
185
192
|
try {
|
|
186
|
-
|
|
193
|
+
rtcAudioSession()?.audioSessionDidActivate?.();
|
|
187
194
|
} catch {
|
|
188
195
|
// Older webrtc builds manage the session on their own.
|
|
189
196
|
}
|
|
190
197
|
};
|
|
191
198
|
const onAudioDeactivated = () => {
|
|
192
199
|
try {
|
|
193
|
-
|
|
200
|
+
rtcAudioSession()?.audioSessionDidDeactivate?.();
|
|
194
201
|
} catch {
|
|
195
202
|
// noop
|
|
196
203
|
}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
import { terminateActiveCall } from './callActions';
|
|
10
10
|
import { toggleCallCamera, toggleCallMic, useCallSession } from './callSessionController';
|
|
11
11
|
import { setCallMinimized } from './callUiStore';
|
|
12
|
+
import { callCanRenderSession } from './callLive';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Drives the host's ongoing-call notification (`videoCalls.
|
|
@@ -25,8 +26,7 @@ export const useOngoingCallNotification = (
|
|
|
25
26
|
const session = useCallSession();
|
|
26
27
|
const shownRef = useRef(false);
|
|
27
28
|
|
|
28
|
-
const live =
|
|
29
|
-
!!call.token && (call.phase === 'connecting' || call.phase === 'in-call');
|
|
29
|
+
const live = callCanRenderSession(call);
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
32
32
|
if (!adapter) {return;}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
setActiveModal,
|
|
12
12
|
} from '../../roomStore/chatSettingsSlice';
|
|
13
13
|
import { MODAL_TYPES } from '../../helpers/constants/MODAL_TYPES';
|
|
14
|
+
import { useMediaSource } from '../../context/MediaSourceContext';
|
|
14
15
|
import { ActivityIndicator, Image, TouchableOpacity, View } from 'react-native';
|
|
15
16
|
import {
|
|
16
17
|
defaultMediaDims,
|
|
@@ -72,6 +73,7 @@ const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
|
72
73
|
const dims: MediaDims = tile ?? measured;
|
|
73
74
|
|
|
74
75
|
const dispatch = useDispatch();
|
|
76
|
+
const source = useMediaSource();
|
|
75
77
|
|
|
76
78
|
useEffect(() => {
|
|
77
79
|
if (!displayURL || tile) {
|
|
@@ -105,7 +107,7 @@ const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
|
105
107
|
onOpen();
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
dispatch(setActiveFile({ fileName, fileURL, mimetype, originalName }));
|
|
110
|
+
dispatch(setActiveFile({ fileName, fileURL, mimetype, originalName, source }));
|
|
109
111
|
dispatch(setActiveModal(MODAL_TYPES.FILE_PREVIEW));
|
|
110
112
|
};
|
|
111
113
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
setActiveModal,
|
|
11
11
|
} from '../../roomStore/chatSettingsSlice';
|
|
12
12
|
import { MODAL_TYPES } from '../../helpers/constants/MODAL_TYPES';
|
|
13
|
+
import { useMediaSource } from '../../context/MediaSourceContext';
|
|
13
14
|
import { PlayIcon } from '../../assets/icons';
|
|
14
15
|
import {
|
|
15
16
|
defaultMediaDims,
|
|
@@ -155,6 +156,7 @@ const CustomMessageVideo: React.FC<CustomMessageVideoProps> = ({
|
|
|
155
156
|
onOpen,
|
|
156
157
|
}) => {
|
|
157
158
|
const dispatch = useDispatch();
|
|
159
|
+
const source = useMediaSource();
|
|
158
160
|
const [posterFailed, setPosterFailed] = useState(false);
|
|
159
161
|
|
|
160
162
|
const handleOpen = () => {
|
|
@@ -162,7 +164,9 @@ const CustomMessageVideo: React.FC<CustomMessageVideoProps> = ({
|
|
|
162
164
|
onOpen();
|
|
163
165
|
return;
|
|
164
166
|
}
|
|
165
|
-
dispatch(
|
|
167
|
+
dispatch(
|
|
168
|
+
setActiveFile({ fileName, fileURL, mimetype, originalName, previewURL, source })
|
|
169
|
+
);
|
|
166
170
|
dispatch(setActiveModal(MODAL_TYPES.FILE_PREVIEW));
|
|
167
171
|
};
|
|
168
172
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import type { ModalFileSource } from '../types/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The message a bubble's pictures and videos belong to. MediaMessage provides
|
|
6
|
+
* it, and the image / video / album components that open the viewer read it,
|
|
7
|
+
* so the viewer knows what its Reply and Delete act on without every card in
|
|
8
|
+
* between passing the message along.
|
|
9
|
+
*/
|
|
10
|
+
const MediaSourceContext = createContext<ModalFileSource | undefined>(undefined);
|
|
11
|
+
|
|
12
|
+
export const MediaSourceProvider = MediaSourceContext.Provider;
|
|
13
|
+
|
|
14
|
+
export const useMediaSource = () => useContext(MediaSourceContext);
|
|
@@ -11,6 +11,7 @@ import React, {
|
|
|
11
11
|
import { AppState, DeviceEventEmitter } from 'react-native';
|
|
12
12
|
import NetInfo from '@react-native-community/netinfo';
|
|
13
13
|
import { VideoCallOverlay } from '../components/VideoCalls/VideoCallOverlay';
|
|
14
|
+
import { ScheduledCallHost } from '../components/Booking/ScheduledCallHost';
|
|
14
15
|
import XmppClient, {
|
|
15
16
|
XmppCredentialsProvider,
|
|
16
17
|
} from '../networking/xmppClient';
|
|
@@ -976,6 +977,8 @@ export const XmppProvider: React.FC<XmppProviderProps> = ({ children, config, is
|
|
|
976
977
|
config and call state from Redux itself, so it needs nothing
|
|
977
978
|
passed in, and renders null whenever no call is in flight. */}
|
|
978
979
|
<VideoCallOverlay />
|
|
980
|
+
{/* Schedule / edit sheet and the pre-join screen of a scheduled call. */}
|
|
981
|
+
<ScheduledCallHost />
|
|
979
982
|
</XmppContext.Provider>
|
|
980
983
|
);
|
|
981
984
|
};
|
package/src/helpers/callPush.ts
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
export interface ParsedCallPush {
|
|
11
11
|
callId: string | null;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* LiveKit token, if the push carried one (lets us ring + accept offline).
|
|
14
|
+
* Empty for a peer to peer call: there is no room to join with it.
|
|
15
|
+
*/
|
|
13
16
|
token: string | null;
|
|
14
17
|
kind: 'audio' | 'video';
|
|
15
18
|
/** Bare room name (JID localpart) the call belongs to. */
|
|
@@ -20,6 +23,13 @@ export interface ParsedCallPush {
|
|
|
20
23
|
callerName: string | null;
|
|
21
24
|
/** Caller's xmpp localpart, when provided. */
|
|
22
25
|
callerXmppUsername: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* How the call is carried. `p2p` pushes carry an empty token; an older push
|
|
28
|
+
* service sends no `mode`, which means `livekit`.
|
|
29
|
+
*/
|
|
30
|
+
mode: 'p2p' | 'livekit';
|
|
31
|
+
/** The call is for a group room (always LiveKit). */
|
|
32
|
+
isGroup: boolean;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
const pick = (data: Record<string, any>, keys: string[]): string => {
|
|
@@ -86,5 +96,7 @@ export const parseCallPush = (
|
|
|
86
96
|
callerXmppUsername:
|
|
87
97
|
pick(d, ['callerXmppUsername', 'callerUsername', 'userJid', 'senderJid'])
|
|
88
98
|
.split('@')[0] || null,
|
|
99
|
+
mode: pick(d, ['mode', 'callMode']).toLowerCase() === 'p2p' ? 'p2p' : 'livekit',
|
|
100
|
+
isGroup: ['true', '1'].includes(pick(d, ['group', 'isGroup']).toLowerCase()),
|
|
89
101
|
};
|
|
90
102
|
};
|
|
@@ -7,7 +7,9 @@ import React from 'react';
|
|
|
7
7
|
import { MODAL_TYPES } from './MODAL_TYPES';
|
|
8
8
|
import ChatProfileModal from '../../components/Modals/ChatProfileModal/ChatProfileModal';
|
|
9
9
|
import FilePreviewModal from '../../components/Modals/FilePreviewModal/FilePreviewModal';
|
|
10
|
-
import MessageSearchModal
|
|
10
|
+
import MessageSearchModal, {
|
|
11
|
+
ChatMessageSearchModal,
|
|
12
|
+
} from '../../components/Modals/MessageSearchModal/MessageSearchModal';
|
|
11
13
|
import PublicChatsModal from '../../components/Modals/PublicChatsModal/PublicChatsModal';
|
|
12
14
|
import NewChatModal from '../../components/Modals/NewChatModal/NewChatModal';
|
|
13
15
|
import BlockedUsersModal from '../../components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal';
|
|
@@ -37,5 +39,6 @@ export const MODAL_COMPONENTS: Record<
|
|
|
37
39
|
[MODAL_TYPES.BLOCKED_USERS]: BlockedUsersModal,
|
|
38
40
|
[MODAL_TYPES.FILE_PREVIEW]: FilePreviewModal,
|
|
39
41
|
[MODAL_TYPES.MESSAGE_SEARCH]: MessageSearchModal,
|
|
42
|
+
[MODAL_TYPES.CHAT_MESSAGE_SEARCH]: ChatMessageSearchModal,
|
|
40
43
|
[MODAL_TYPES.PUBLIC_CHATS]: PublicChatsModal,
|
|
41
44
|
};
|
|
@@ -2,6 +2,10 @@ import { store } from '../roomStore';
|
|
|
2
2
|
import { acceptIncomingCall, setIncomingCallToken } from '../roomStore/callSlice';
|
|
3
3
|
import { endSystemIncomingCall } from '../components/VideoCalls/systemCall';
|
|
4
4
|
import { declineActiveCallWhenOnline } from '../components/VideoCalls/callActions';
|
|
5
|
+
import { reportCallDeclined, reportCallEnded } from '../networking/api-requests/callState.api';
|
|
6
|
+
import { sendCallStateSignal } from '../networking/callTokenStanza';
|
|
7
|
+
import { decideIncomingWhileBusy } from '../calls/callMode';
|
|
8
|
+
import { busySnapshot } from '../calls/callBusy';
|
|
5
9
|
import { isCallPush, parseCallPush } from './callPush';
|
|
6
10
|
import { normalizeRoomJid } from './normalizeRoomJid';
|
|
7
11
|
|
|
@@ -58,11 +62,53 @@ const ringFromPush = (data: Record<string, any>, intent: CallPushIntent): boolea
|
|
|
58
62
|
return false;
|
|
59
63
|
}
|
|
60
64
|
|
|
65
|
+
const isP2P = parsed.mode === 'p2p';
|
|
66
|
+
|
|
67
|
+
// A peer to peer call is correlated by its callId alone (there is no room
|
|
68
|
+
// token), and one call at a time: decided the way the call-token stanza
|
|
69
|
+
// decides it. The caller is told when we cannot take it.
|
|
70
|
+
if (isP2P) {
|
|
71
|
+
if (!parsed.callId) {
|
|
72
|
+
trace('p2p call push without a callId, dropping');
|
|
73
|
+
endSystemIncomingCall(parsed.callId);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const decision = decideIncomingWhileBusy(busySnapshot(state.call), {
|
|
77
|
+
mode: 'p2p',
|
|
78
|
+
callId: parsed.callId,
|
|
79
|
+
roomBareName: parsed.roomBareName,
|
|
80
|
+
});
|
|
81
|
+
if (decision === 'duplicate') {
|
|
82
|
+
applyIntent(intent);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
if (decision === 'busy' || decision === 'replace') {
|
|
86
|
+
trace('busy, declining p2p call', parsed.callId);
|
|
87
|
+
reportCallDeclined(parsed.callId);
|
|
88
|
+
sendCallStateSignal('declined', {
|
|
89
|
+
peerXmppUsername: parsed.callerXmppUsername,
|
|
90
|
+
callId: parsed.callId,
|
|
91
|
+
roomBareName: parsed.roomBareName,
|
|
92
|
+
});
|
|
93
|
+
endSystemIncomingCall(parsed.callId);
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (decision === 'glare-keep') {
|
|
97
|
+
endSystemIncomingCall(parsed.callId);
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (decision === 'glare-yield') {
|
|
101
|
+
// Both sides dialled at once and theirs has the smaller id: drop ours.
|
|
102
|
+
sendCallStateSignal('cancelled');
|
|
103
|
+
reportCallEnded(state.call.callId);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
61
107
|
// Already ringing or in this exact call (the push raced the stanza, or
|
|
62
108
|
// two pushes arrived). Re-dispatching would reset startedAt and restart
|
|
63
109
|
// the ring, so leave the existing call alone.
|
|
64
110
|
const current = state.call;
|
|
65
|
-
if (current.phase !== 'idle') {
|
|
111
|
+
if (!isP2P && current.phase !== 'idle') {
|
|
66
112
|
const sameCall =
|
|
67
113
|
(!!parsed.callId && parsed.callId === current.callId) ||
|
|
68
114
|
(!!parsed.roomBareName && parsed.roomBareName === current.roomBareName);
|
|
@@ -70,8 +116,9 @@ const ringFromPush = (data: Record<string, any>, intent: CallPushIntent): boolea
|
|
|
70
116
|
applyIntent(intent);
|
|
71
117
|
return true;
|
|
72
118
|
}
|
|
73
|
-
if (current.phase === 'in-call') {
|
|
74
|
-
// Busy with another call: no second ring.
|
|
119
|
+
if (current.phase === 'in-call' || current.mode === 'p2p') {
|
|
120
|
+
// Busy with another call: no second ring. (A p2p call is never
|
|
121
|
+
// replaced by a LiveKit one, whatever phase it is in.)
|
|
75
122
|
endSystemIncomingCall(parsed.callId);
|
|
76
123
|
return false;
|
|
77
124
|
}
|
|
@@ -81,7 +128,8 @@ const ringFromPush = (data: Record<string, any>, intent: CallPushIntent): boolea
|
|
|
81
128
|
// an alert. Ringing anyway would give the user an Accept button that
|
|
82
129
|
// cannot work, so treat it as handled and let the stanza (once the
|
|
83
130
|
// socket is back up) open the real ring screen.
|
|
84
|
-
|
|
131
|
+
// A p2p call carries no token by design: it is answered over XMPP.
|
|
132
|
+
if (!parsed.token && !isP2P) {
|
|
85
133
|
endSystemIncomingCall(parsed.callId);
|
|
86
134
|
return false;
|
|
87
135
|
}
|
|
@@ -107,15 +155,25 @@ const ringFromPush = (data: Record<string, any>, intent: CallPushIntent): boolea
|
|
|
107
155
|
return false;
|
|
108
156
|
}
|
|
109
157
|
|
|
158
|
+
// In a group the call is the ROOM and the caller is a separate line; a
|
|
159
|
+
// 1:1 call is named after the caller.
|
|
160
|
+
const roomTitle = resolved?.title || resolved?.name || null;
|
|
110
161
|
store.dispatch(
|
|
111
162
|
setIncomingCallToken({
|
|
112
163
|
roomJid,
|
|
113
|
-
roomName: parsed.
|
|
164
|
+
roomName: parsed.isGroup
|
|
165
|
+
? roomTitle
|
|
166
|
+
: parsed.callerName || roomTitle,
|
|
114
167
|
roomBareName: parsed.roomBareName,
|
|
115
|
-
token: parsed.token,
|
|
168
|
+
token: parsed.token || '',
|
|
116
169
|
kind: parsed.kind,
|
|
117
170
|
callId: parsed.callId,
|
|
118
|
-
|
|
171
|
+
// A group has no single peer to signal.
|
|
172
|
+
peerXmppUsername: parsed.isGroup ? null : parsed.callerXmppUsername,
|
|
173
|
+
mode: parsed.mode,
|
|
174
|
+
isGroup: parsed.isGroup,
|
|
175
|
+
callerName: parsed.callerName,
|
|
176
|
+
callerXmppUsername: parsed.callerXmppUsername,
|
|
119
177
|
})
|
|
120
178
|
);
|
|
121
179
|
trace('ringing', parsed.callId, intent);
|
|
@@ -2,14 +2,15 @@ import type { IConfig } from '../types/types';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* "Discover chats" lives in the room list menu sheet. A host that takes the
|
|
5
|
-
* burger over (`headerMenu` as a function)
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* header
|
|
9
|
-
*
|
|
5
|
+
* burger over (`headerMenu` as a function) would otherwise have no obvious
|
|
6
|
+
* way to reach the directory, so it also gets a button of its own in the
|
|
7
|
+
* room list header. `chatHeaderSettings.disableMenu` does not count: the
|
|
8
|
+
* header avatar still opens the sheet, Discover included, and a second
|
|
9
|
+
* compass next to it was a duplicate. `disableRoomMenu` removes the menu
|
|
10
|
+
* entry point, and with it the button; `disablePublicChatsDirectory`
|
|
11
|
+
* removes the feature altogether.
|
|
10
12
|
*/
|
|
11
13
|
export const showsStandaloneDiscoverButton = (config?: IConfig): boolean =>
|
|
12
14
|
!config?.disablePublicChatsDirectory &&
|
|
13
15
|
!config?.disableRoomMenu &&
|
|
14
|
-
|
|
15
|
-
typeof config?.headerMenu === 'function');
|
|
16
|
+
typeof config?.headerMenu === 'function';
|
|
@@ -7,8 +7,14 @@ import {
|
|
|
7
7
|
} from '../roomStore/roomsSlice';
|
|
8
8
|
import { handleCallPush } from './incomingCallFromPush';
|
|
9
9
|
import { normalizeRoomJid } from './normalizeRoomJid';
|
|
10
|
+
import { handleScheduledCallPush } from '../booking/pendingScheduledCall';
|
|
10
11
|
|
|
11
|
-
export type PushPayloadOutcome =
|
|
12
|
+
export type PushPayloadOutcome =
|
|
13
|
+
| 'call'
|
|
14
|
+
| 'scheduledCall'
|
|
15
|
+
| 'room'
|
|
16
|
+
| 'pending'
|
|
17
|
+
| 'unknown';
|
|
12
18
|
|
|
13
19
|
export const PENDING_NOTIFICATION_JID_KEY = 'ethora_pending_notification_jid';
|
|
14
20
|
export const PENDING_NOTIFICATION_TTL_MS = 5 * 60 * 1000;
|
|
@@ -54,6 +60,8 @@ export const handlePushPayload = (
|
|
|
54
60
|
): PushPayloadOutcome => {
|
|
55
61
|
if (!data) {return 'unknown';}
|
|
56
62
|
if (handleCallPush(data as Record<string, any>)) {return 'call';}
|
|
63
|
+
// The reminder before a scheduled call opens the same flow as its link.
|
|
64
|
+
if (handleScheduledCallPush(data)) {return 'scheduledCall';}
|
|
57
65
|
const jid = data.jid ?? data.chatJid ?? data.roomJid ?? data.roomJID;
|
|
58
66
|
if (typeof jid === 'string' && jid) {
|
|
59
67
|
return openRoomFromPush(jid);
|