@ethora/chat-component-rn 26.5.7 → 26.5.10
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 +133 -0
- package/README.md +67 -10
- package/index.js +24 -0
- package/lib/commonjs/assets/icons.js +5 -1
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +11 -5
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +64 -38
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +57 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +4 -2
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +2 -2
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +165 -28
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +17 -8
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/SystemMessage.js +34 -22
- package/lib/commonjs/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +84 -39
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +82 -22
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +16 -4
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js +104 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +140 -24
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +29 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +5 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +77 -47
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +4 -9
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/styled/MediaFilePreview.js +47 -28
- package/lib/commonjs/components/styled/MediaFilePreview.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +49 -9
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/NewMessageLabel.js +8 -6
- package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +49 -27
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +14 -4
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +5 -1
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +60 -14
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/MessageNotificationContext.js +7 -7
- package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +244 -32
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/chatAutoEnterer.js +2 -7
- package/lib/commonjs/helpers/chatAutoEnterer.js.map +1 -1
- package/lib/commonjs/helpers/historyPreloadScheduler.js +4 -1
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +15 -5
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/keyboardLayout.js +18 -0
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -0
- package/lib/commonjs/helpers/mediaDimensions.js +51 -0
- package/lib/commonjs/helpers/mediaDimensions.js.map +1 -0
- package/lib/commonjs/helpers/normalizeRoomJid.js +20 -0
- package/lib/commonjs/helpers/normalizeRoomJid.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +87 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -0
- package/lib/commonjs/hooks/useHeapSender.js +1 -1
- package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +3 -3
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePushNotifications.js +6 -2
- package/lib/commonjs/hooks/usePushNotifications.js.map +1 -1
- package/lib/commonjs/hooks/useRoomState.js +2 -0
- package/lib/commonjs/hooks/useRoomState.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +201 -10
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +12 -14
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/main.js +7 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +67 -0
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +2 -1
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +92 -0
- package/lib/commonjs/networking/outboundQueue.js.map +1 -0
- package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
- package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
- package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +26 -8
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +2 -1
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +294 -35
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +22 -6
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +157 -23
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/utils/installPromiseRejectionTracker.js +83 -0
- package/lib/commonjs/utils/installPromiseRejectionTracker.js.map +1 -0
- package/lib/commonjs/utils/resendMessage.js +1 -1
- package/lib/commonjs/utils/resendMessage.js.map +1 -1
- package/lib/module/assets/icons.js +5 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/ContextMenu/ContextMenuComponents.js +11 -5
- package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +65 -39
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +57 -13
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +4 -2
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +2 -2
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +166 -29
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +18 -8
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/SystemMessage.js +33 -21
- package/lib/module/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +85 -40
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +84 -24
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +15 -3
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js +99 -0
- package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +143 -25
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +31 -3
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +5 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +79 -49
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +4 -9
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/styled/MediaFilePreview.js +47 -28
- package/lib/module/components/styled/MediaFilePreview.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +51 -11
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/NewMessageLabel.js +8 -6
- package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +50 -28
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +14 -4
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +5 -1
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +61 -15
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/MessageNotificationContext.js +7 -7
- package/lib/module/context/MessageNotificationContext.js.map +1 -1
- package/lib/module/context/xmppProvider.js +246 -34
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/chatAutoEnterer.js +2 -7
- package/lib/module/helpers/chatAutoEnterer.js.map +1 -1
- package/lib/module/helpers/historyPreloadScheduler.js +4 -1
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +15 -5
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/keyboardLayout.js +12 -0
- package/lib/module/helpers/keyboardLayout.js.map +1 -0
- package/lib/module/helpers/mediaDimensions.js +46 -0
- package/lib/module/helpers/mediaDimensions.js.map +1 -0
- package/lib/module/helpers/normalizeRoomJid.js +15 -0
- package/lib/module/helpers/normalizeRoomJid.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +82 -0
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -0
- package/lib/module/hooks/useHeapSender.js +1 -1
- package/lib/module/hooks/useHeapSender.js.map +1 -1
- package/lib/module/hooks/useLogout.js +3 -3
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePushNotifications.js +6 -2
- package/lib/module/hooks/usePushNotifications.js.map +1 -1
- package/lib/module/hooks/useRoomState.js +2 -0
- package/lib/module/hooks/useRoomState.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +203 -12
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +12 -14
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/main.js +1 -0
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +67 -1
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +2 -1
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +84 -0
- package/lib/module/networking/outboundQueue.js.map +1 -0
- package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
- package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
- package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +26 -8
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +2 -1
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +294 -35
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/Middleware/unreadMidlleware.js +22 -6
- package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +154 -22
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/utils/installPromiseRejectionTracker.js +78 -0
- package/lib/module/utils/installPromiseRejectionTracker.js.map +1 -0
- package/lib/module/utils/resendMessage.js +1 -1
- package/lib/module/utils/resendMessage.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +8 -4
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/ContextMenu/ContextMenuComponents.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts +1 -0
- 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/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts +1 -0
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/SystemMessage.d.ts +0 -7
- package/lib/typescript/components/MainComponents/SystemMessage.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +4 -2
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts +29 -0
- package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +0 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/MediaFilePreview.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/NewMessageLabel.d.ts +1 -5
- package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts +9 -1
- package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/UnsupportedType.d.ts +1 -0
- package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts +1 -0
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/chatAutoEnterer.d.ts.map +1 -1
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts +9 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -0
- package/lib/typescript/helpers/mediaDimensions.d.ts +9 -0
- package/lib/typescript/helpers/mediaDimensions.d.ts.map +1 -0
- package/lib/typescript/helpers/normalizeRoomJid.d.ts +2 -0
- package/lib/typescript/helpers/normalizeRoomJid.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +42 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -0
- package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
- package/lib/typescript/hooks/usePushNotifications.d.ts.map +1 -1
- package/lib/typescript/hooks/useRoomState.d.ts +1 -0
- package/lib/typescript/hooks/useRoomState.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +1 -0
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -0
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +57 -0
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/createTimeoutPromise.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts +1 -1
- package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +33 -4
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +8 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/models/media.model.d.ts +1 -0
- package/lib/typescript/types/models/media.model.d.ts.map +1 -1
- package/lib/typescript/types/models/xmpp.model.d.ts +1 -1
- package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +4 -0
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/utils/installPromiseRejectionTracker.d.ts +20 -0
- package/lib/typescript/utils/installPromiseRejectionTracker.d.ts.map +1 -0
- package/lib/typescript/utils/resendMessage.d.ts.map +1 -1
- package/package.json +18 -2
- package/src/assets/icons.tsx +23 -14
- package/src/components/ContextMenu/ContextMenuComponents.tsx +10 -5
- package/src/components/MainComponents/ChatRoom.tsx +81 -66
- package/src/components/MainComponents/ChatWrapper.tsx +99 -21
- package/src/components/MainComponents/MediaMessage.tsx +3 -0
- package/src/components/MainComponents/MessageContainer.tsx +4 -2
- package/src/components/MainComponents/MessageList.tsx +175 -28
- package/src/components/MainComponents/ReduxWrapper.tsx +19 -9
- package/src/components/MainComponents/SystemMessage.tsx +38 -26
- package/src/components/MessageBubble/Message.tsx +91 -62
- package/src/components/MessageBubble/MessageInteractions.tsx +98 -29
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +17 -3
- package/src/components/Modals/FilePreviewModal/DocumentViewer.tsx +93 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +152 -25
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +32 -4
- package/src/components/Modals/Modal/Modal.tsx +4 -1
- package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +70 -58
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +19 -15
- package/src/components/Modals/styledModalComponents.tsx +4 -9
- package/src/components/styled/MediaFilePreview.tsx +46 -26
- package/src/components/styled/MessageImage.tsx +58 -13
- package/src/components/styled/NewMessageLabel.tsx +8 -5
- package/src/components/styled/SendInput.tsx +64 -29
- package/src/components/styled/StyledInputComponents/MediaComponents.tsx +15 -5
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +7 -2
- package/src/components/styled/UnsupportedType.tsx +7 -1
- package/src/components/styled/VideoMessage.tsx +59 -11
- package/src/context/MessageNotificationContext.tsx +8 -8
- package/src/context/xmppProvider.tsx +247 -30
- package/src/helpers/chatAutoEnterer.ts +2 -8
- package/src/helpers/historyPreloadScheduler.ts +4 -1
- package/src/helpers/insertMessageWithDelimiter.ts +22 -15
- package/src/helpers/keyboardLayout.ts +18 -0
- package/src/helpers/mediaDimensions.ts +47 -0
- package/src/helpers/normalizeRoomJid.ts +6 -0
- package/src/hooks/useChatRoomFocus.ts +95 -0
- package/src/hooks/useHeapSender.tsx +2 -1
- package/src/hooks/useLogout.tsx +3 -3
- package/src/hooks/usePushNotifications.ts +21 -8
- package/src/hooks/useRoomState.tsx +4 -0
- package/src/hooks/useSendMessage.tsx +258 -13
- package/src/hooks/useUnreadMessagesCounter.ts +13 -16
- package/src/main.ts +1 -0
- package/src/networking/api-requests/auth.api.ts +55 -1
- package/src/networking/apiClient.ts +2 -1
- package/src/networking/outboundQueue.ts +98 -0
- package/src/networking/xmpp/createTimeoutPromise.xmpp.ts +5 -1
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +11 -13
- package/src/networking/xmpp/getRoomsPaged.xmpp.ts +27 -3
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +24 -9
- package/src/networking/xmpp/sendTextMessage.xmpp.ts +2 -1
- package/src/networking/xmppClient.ts +317 -43
- package/src/roomStore/Middleware/unreadMidlleware.tsx +23 -5
- package/src/roomStore/roomsSlice.ts +177 -27
- package/src/types/models/media.model.ts +3 -0
- package/src/types/models/xmpp.model.ts +2 -1
- package/src/types/types.ts +15 -0
- package/src/utils/installPromiseRejectionTracker.ts +91 -0
- package/src/utils/resendMessage.ts +2 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OUTBOUND_QUEUE_TTL_MS = void 0;
|
|
7
|
+
exports.clearOutboundSends = clearOutboundSends;
|
|
8
|
+
exports.enqueueOutboundSend = enqueueOutboundSend;
|
|
9
|
+
exports.flushOutboundSends = flushOutboundSends;
|
|
10
|
+
exports.outboundQueueLength = outboundQueueLength;
|
|
11
|
+
/**
|
|
12
|
+
* Outbound-send queue — buffers message stanzas that can't reach the wire
|
|
13
|
+
* because there is no live XMPP stream at send time, and replays them once
|
|
14
|
+
* a stream comes (back) online.
|
|
15
|
+
*
|
|
16
|
+
* Lives at MODULE scope on purpose, NOT on the XmppClient instance: the
|
|
17
|
+
* exact windows we need to cover are the ones where the instance itself is
|
|
18
|
+
* gone or being swapped —
|
|
19
|
+
* 1. start race — a send fires before the provider's bootstrap has run
|
|
20
|
+
* `setClient(created)`, so `useSendMessage` sees `client === null` and
|
|
21
|
+
* used to throw "No XMPP client".
|
|
22
|
+
* 2. full-reinit race — after 3 failed reconnects the provider does
|
|
23
|
+
* `setClient(null)` then re-`initializeClient`s; sends in that gap
|
|
24
|
+
* also saw `client === null`.
|
|
25
|
+
* 3. reconnect window — the instance survives but its underlying stream
|
|
26
|
+
* is `connecting`/`offline`; a fire-and-forget stanza is silently lost
|
|
27
|
+
* and only the 30s watchdog notices.
|
|
28
|
+
*
|
|
29
|
+
* Each queued item carries a `send(client)` closure that captures the
|
|
30
|
+
* original args (text or media), so flush is type-agnostic.
|
|
31
|
+
*
|
|
32
|
+
* TTL is deliberately aligned with the 30s pending-send watchdog in
|
|
33
|
+
* useSendMessage (PENDING_WATCHDOG_MS): a queued item older than that has
|
|
34
|
+
* already been — or is about to be — flipped to "Failed → tap to retry" by
|
|
35
|
+
* the watchdog, so replaying it on a late reconnect would duplicate the
|
|
36
|
+
* bubble. We drop those on flush and let the watchdog own the failure.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
// Kept in lockstep with PENDING_WATCHDOG_MS in useSendMessage.
|
|
40
|
+
const OUTBOUND_QUEUE_TTL_MS = exports.OUTBOUND_QUEUE_TTL_MS = 30_000;
|
|
41
|
+
let queue = [];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Append (or, if the id is already queued, replace in place) a pending
|
|
45
|
+
* send. Order is preserved for FIFO flush.
|
|
46
|
+
*/
|
|
47
|
+
function enqueueOutboundSend(item) {
|
|
48
|
+
const idx = queue.findIndex(q => q.optimisticId === item.optimisticId);
|
|
49
|
+
if (idx >= 0) {
|
|
50
|
+
// Re-enqueue of the same id (e.g. a media retry): refresh in place so
|
|
51
|
+
// we don't grow a duplicate, and keep its original position.
|
|
52
|
+
queue[idx] = item;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
queue.push(item);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Replay every queued send (in order) against a now-online client. Items
|
|
60
|
+
* older than the TTL are dropped — the send watchdog has already failed
|
|
61
|
+
* them, so re-sending would duplicate. The queue is emptied either way.
|
|
62
|
+
*/
|
|
63
|
+
function flushOutboundSends(client, now) {
|
|
64
|
+
if (queue.length === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const pending = queue;
|
|
68
|
+
queue = [];
|
|
69
|
+
for (const item of pending) {
|
|
70
|
+
if (now - item.enqueuedAt > OUTBOUND_QUEUE_TTL_MS) {
|
|
71
|
+
// Stale — the 30s watchdog owns the failure; don't duplicate.
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
item.send(client);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
// A single bad replay must not strand the rest of the queue.
|
|
78
|
+
console.warn('flushOutboundSends: replay failed', item.optimisticId, err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Drop everything — called on permanent teardown (logout / close). */
|
|
84
|
+
function clearOutboundSends() {
|
|
85
|
+
queue = [];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Current depth — for tests and diagnostics. */
|
|
89
|
+
function outboundQueueLength() {
|
|
90
|
+
return queue.length;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=outboundQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OUTBOUND_QUEUE_TTL_MS","exports","queue","enqueueOutboundSend","item","idx","findIndex","q","optimisticId","push","flushOutboundSends","client","now","length","pending","enqueuedAt","send","err","console","warn","clearOutboundSends","outboundQueueLength"],"sourceRoot":"../../../src","sources":["networking/outboundQueue.ts"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA;AACO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,MAAM;AAE3C,IAAIE,KAAmB,GAAG,EAAE;;AAE5B;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAACC,IAAgB,EAAQ;EAC1D,MAAMC,GAAG,GAAGH,KAAK,CAACI,SAAS,CAAEC,CAAC,IAAKA,CAAC,CAACC,YAAY,KAAKJ,IAAI,CAACI,YAAY,CAAC;EACxE,IAAIH,GAAG,IAAI,CAAC,EAAE;IACZ;IACA;IACAH,KAAK,CAACG,GAAG,CAAC,GAAGD,IAAI;IACjB;EACF;EACAF,KAAK,CAACO,IAAI,CAACL,IAAI,CAAC;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASM,kBAAkBA,CAChCC,MAA2B,EAC3BC,GAAW,EACL;EACN,IAAIV,KAAK,CAACW,MAAM,KAAK,CAAC,EAAE;IAAC;EAAO;EAChC,MAAMC,OAAO,GAAGZ,KAAK;EACrBA,KAAK,GAAG,EAAE;EACV,KAAK,MAAME,IAAI,IAAIU,OAAO,EAAE;IAC1B,IAAIF,GAAG,GAAGR,IAAI,CAACW,UAAU,GAAGf,qBAAqB,EAAE;MACjD;MACA;IACF;IACA,IAAI;MACFI,IAAI,CAACY,IAAI,CAACL,MAAM,CAAC;IACnB,CAAC,CAAC,OAAOM,GAAG,EAAE;MACZ;MACAC,OAAO,CAACC,IAAI,CAAC,mCAAmC,EAAEf,IAAI,CAACI,YAAY,EAAES,GAAG,CAAC;IAC3E;EACF;AACF;;AAEA;AACO,SAASG,kBAAkBA,CAAA,EAAS;EACzClB,KAAK,GAAG,EAAE;AACZ;;AAEA;AACO,SAASmB,mBAAmBA,CAAA,EAAW;EAC5C,OAAOnB,KAAK,CAACW,MAAM;AACrB","ignoreList":[]}
|
|
@@ -5,15 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createTimeoutPromise = createTimeoutPromise;
|
|
7
7
|
function createTimeoutPromise(ms, unsubscribe) {
|
|
8
|
-
|
|
8
|
+
const promise = new Promise((_, reject) => {
|
|
9
9
|
setTimeout(() => {
|
|
10
10
|
try {
|
|
11
11
|
if (unsubscribe) {
|
|
12
12
|
unsubscribe();
|
|
13
13
|
}
|
|
14
14
|
} catch (e) {}
|
|
15
|
+
// result and stay silent.
|
|
15
16
|
reject();
|
|
16
17
|
}, ms);
|
|
17
18
|
});
|
|
19
|
+
promise.catch(() => {});
|
|
20
|
+
return promise;
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=createTimeoutPromise.xmpp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createTimeoutPromise","ms","unsubscribe","Promise","_","reject","setTimeout","e"],"sourceRoot":"../../../../src","sources":["networking/xmpp/createTimeoutPromise.xmpp.ts"],"mappings":";;;;;;AAAO,SAASA,oBAAoBA,CAClCC,EAAsB,EACtBC,WAAwB,EACxB;EACA,OAAO,IAAIC,OAAO,CAAC,CAACC,CAAC,EAAEC,MAAM,KAAK;
|
|
1
|
+
{"version":3,"names":["createTimeoutPromise","ms","unsubscribe","promise","Promise","_","reject","setTimeout","e","catch"],"sourceRoot":"../../../../src","sources":["networking/xmpp/createTimeoutPromise.xmpp.ts"],"mappings":";;;;;;AAAO,SAASA,oBAAoBA,CAClCC,EAAsB,EACtBC,WAAwB,EACxB;EACA,MAAMC,OAAO,GAAG,IAAIC,OAAO,CAAC,CAACC,CAAC,EAAEC,MAAM,KAAK;IACzCC,UAAU,CAAC,MAAM;MACf,IAAI;QACF,IAAIL,WAAW,EAAE;UACfA,WAAW,CAAC,CAAC;QACf;MACF,CAAC,CAAC,OAAOM,CAAC,EAAE,CAAC;MACb;MACAF,MAAM,CAAC,CAAC;IACV,CAAC,EAAEL,EAAE,CAAC;EACR,CAAC,CAAC;EAEFE,OAAO,CAACM,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EACvB,OAAON,OAAO;AAChB","ignoreList":[]}
|
|
@@ -21,7 +21,7 @@ async function flushLastViewedToPrivateStore(client, rooms, opts = {}) {
|
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
const {
|
|
24
|
-
|
|
24
|
+
visibleRoomJID,
|
|
25
25
|
onlyIfNoUnread
|
|
26
26
|
} = opts;
|
|
27
27
|
const roomList = Object.values(rooms || {});
|
|
@@ -43,22 +43,21 @@ async function flushLastViewedToPrivateStore(client, rooms, opts = {}) {
|
|
|
43
43
|
if (!room?.jid) {
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const isVisible = !!visibleRoomJID && room.jid === visibleRoomJID;
|
|
47
47
|
const hasUnread = Number(room.unreadMessages || 0) > 0;
|
|
48
48
|
|
|
49
|
-
// For the
|
|
50
|
-
//
|
|
51
|
-
// history unread on next login.
|
|
49
|
+
// For the visible room, persist "now" — read state is driven by
|
|
50
|
+
// room visibility, not by a sentinel timestamp.
|
|
52
51
|
let ts;
|
|
53
|
-
if (
|
|
52
|
+
if (isVisible) {
|
|
54
53
|
ts = nowMs;
|
|
55
|
-
} else if (room.lastViewedTimestamp) {
|
|
54
|
+
} else if (room.lastViewedTimestamp && room.lastViewedTimestamp > 0) {
|
|
56
55
|
ts = room.lastViewedTimestamp;
|
|
57
56
|
}
|
|
58
57
|
if (!ts) {
|
|
59
58
|
continue;
|
|
60
59
|
}
|
|
61
|
-
if (onlyIfNoUnread && hasUnread && !
|
|
60
|
+
if (onlyIfNoUnread && hasUnread && !isVisible) {
|
|
62
61
|
continue;
|
|
63
62
|
}
|
|
64
63
|
const prev = storeObj[room.jid];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_getChatsPrivateStoreRequest","require","_setChatsPrivateStoreRequest","flushLastViewedToPrivateStore","client","rooms","opts","
|
|
1
|
+
{"version":3,"names":["_getChatsPrivateStoreRequest","require","_setChatsPrivateStoreRequest","flushLastViewedToPrivateStore","client","rooms","opts","visibleRoomJID","onlyIfNoUnread","roomList","Object","values","length","storeObj","getChatsPrivateStoreRequest","nowMs","Date","now","dirty","room","jid","isVisible","hasUnread","Number","unreadMessages","ts","lastViewedTimestamp","prev","prevNum","isFinite","String","setChatsPrivateStoreRequest","JSON","stringify"],"sourceRoot":"../../../../src","sources":["networking/xmpp/flushLastViewedToPrivateStore.ts"],"mappings":";;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAD,OAAA;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,6BAA6BA,CACjDC,MAAW,EACXC,KAAkD,EAClDC,IAAe,GAAG,CAAC,CAAC,EACF;EAClB,IAAI,CAACF,MAAM,EAAEA,MAAM,EAAE;IAAC,OAAO,KAAK;EAAC;EACnC,MAAM;IAAEG,cAAc;IAAEC;EAAe,CAAC,GAAGF,IAAI;EAC/C,MAAMG,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAACN,KAAK,IAAI,CAAC,CAAC,CAAC;EAC3C,IAAII,QAAQ,CAACG,MAAM,KAAK,CAAC,EAAE;IAAC,OAAO,KAAK;EAAC;EAEzC,IAAIC,QAAa,GAAG,IAAI;EACxB,IAAI;IACFA,QAAQ,GAAG,MAAM,IAAAC,wDAA2B,EAACV,MAAM,CAACA,MAAM,CAAC;EAC7D,CAAC,CAAC,MAAM;IACNS,QAAQ,GAAG,IAAI;EACjB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,MAAM,IAAAa,wDAA2B,EAAC3B,MAAM,CAACA,MAAM,EAAE4B,IAAI,CAACC,SAAS,CAACpB,QAAQ,CAAC,CAAC;IAC1E,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -11,7 +11,13 @@ const getRoomsPaged = async (client, maxResults = 3, before = null) => {
|
|
|
11
11
|
const unsubscribe = () => {
|
|
12
12
|
client.off('stanza', stanzaHdlrPointer);
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
// Avoid `new Promise(async (resolve, reject) => {...})` — an async
|
|
16
|
+
// executor swallows the promise it returns, so any rejection inside
|
|
17
|
+
// it that happens BEFORE the catch handler attaches becomes
|
|
18
|
+
// "Uncaught (in promise)" red-screen. Use an explicit deferred + a
|
|
19
|
+
// regular async body that handles its own errors.
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
15
21
|
stanzaHdlrPointer = stanza => {
|
|
16
22
|
if (stanza.is('iq') && stanza.attrs.id === 'getUserRooms') {
|
|
17
23
|
unsubscribe();
|
|
@@ -34,14 +40,31 @@ const getRoomsPaged = async (client, maxResults = 3, before = null) => {
|
|
|
34
40
|
from: client.jid?.toString(),
|
|
35
41
|
id: 'getUserRoomsPaged'
|
|
36
42
|
}, query);
|
|
43
|
+
|
|
44
|
+
// Capture potential rejections from client.send() — it returns a
|
|
45
|
+
// Promise on most @xmpp/client builds; the previous bare call left
|
|
46
|
+
// the rejection unhandled when the socket was closing.
|
|
47
|
+
let sendPromise;
|
|
37
48
|
try {
|
|
38
|
-
client.send(message);
|
|
49
|
+
sendPromise = client.send(message);
|
|
39
50
|
} catch (err) {
|
|
40
51
|
console.error('Error sending getRooms request:', err);
|
|
41
52
|
unsubscribe();
|
|
42
53
|
reject(err);
|
|
54
|
+
return;
|
|
43
55
|
}
|
|
44
|
-
|
|
56
|
+
Promise.resolve(sendPromise).catch(err => {
|
|
57
|
+
console.error('client.send rejected in getRoomsPaged', err);
|
|
58
|
+
unsubscribe();
|
|
59
|
+
reject(err);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// The timeout catch was racy — if createTimeoutPromise rejected
|
|
63
|
+
// before `.catch(reject)` attached, the rejection escaped. Use a
|
|
64
|
+
// .then/.catch pair attached synchronously to be safe.
|
|
65
|
+
(0, _createTimeoutPromise.createTimeoutPromise)(2000, unsubscribe).then(() => {
|
|
66
|
+
/* timeout completed cleanly */
|
|
67
|
+
}, err => reject(err));
|
|
45
68
|
});
|
|
46
69
|
};
|
|
47
70
|
exports.getRoomsPaged = getRoomsPaged;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_client","require","_createTimeoutPromise","getRoomsPaged","client","maxResults","before","stanzaHdlrPointer","unsubscribe","off","Promise","resolve","reject","stanza","is","attrs","id","on","query","xml","xmlns","set","toString","append","message","type","from","jid","send","err","console","error","createTimeoutPromise","
|
|
1
|
+
{"version":3,"names":["_client","require","_createTimeoutPromise","getRoomsPaged","client","maxResults","before","stanzaHdlrPointer","unsubscribe","off","Promise","resolve","reject","stanza","is","attrs","id","on","query","xml","xmlns","set","toString","append","message","type","from","jid","sendPromise","send","err","console","error","catch","createTimeoutPromise","then","exports"],"sourceRoot":"../../../../src","sources":["networking/xmpp/getRoomsPaged.xmpp.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAG,MAAAA,CAC3BC,MAAc,EACdC,UAAU,GAAG,CAAC,EACdC,MAAM,GAAG,IAAI,KACV;EACH,IAAIC,iBAIH;EAED,MAAMC,WAAW,GAAGA,CAAA,KAAM;IACxBJ,MAAM,CAACK,GAAG,CAAC,QAAQ,EAAEF,iBAAiB,CAAC;EACzC,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,OAAO,IAAIG,OAAO,CAAM,CAACC,OAAO,EAAEC,MAAM,KAAK;IAC3CL,iBA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C,CACzBK,KAAK,CAAEH,GAAG,IAAK;MACdC,OAAO,CAACC,KAAK,CAAC,uCAAuC,EAAEF,GAAG,CAAC;MAC3DtB,WAAW,CAAC,CAAC;MACbI,MAAM,CAACkB,GAAG,CAAC;IACb,CAAC,CAAC;;IAEJ;IACA;IACA;IACA,IAAAI,0CAAoB,EAAC,IAAI,EAAE1B,WAAW,CAAC,CAAC2B,IAAI,CAC1C,MAAM;MACJ;IAAA,CACD,EACAL,GAAG,IAAKlB,MAAM,CAACkB,GAAG,CACrB,CAAC;EACH,CAAC,CAAC;AACJ,CAAC;AAACM,OAAA,CAAAjC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -12,7 +12,13 @@ const presenceInRoom = async (client, roomJID, delay = 2000) => {
|
|
|
12
12
|
let stanzaHandler;
|
|
13
13
|
const unsubscribe = () => client.off('stanza', stanzaHandler);
|
|
14
14
|
const stanzaId = nextPresenceId();
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
// Avoid `new Promise(async (resolve, reject) => …)` — the async
|
|
17
|
+
// executor's own thrown errors / unhandled rejections inside it can
|
|
18
|
+
// escape the constructed promise depending on the order of catch
|
|
19
|
+
// attachment vs rejection. Use a regular Promise + a separate async
|
|
20
|
+
// wrapper that funnels every failure path through reject().
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
16
22
|
let settled = false;
|
|
17
23
|
const finish = (cb, value) => {
|
|
18
24
|
if (settled) {
|
|
@@ -37,13 +43,25 @@ const presenceInRoom = async (client, roomJID, delay = 2000) => {
|
|
|
37
43
|
}, (0, _client.xml)('x', {
|
|
38
44
|
xmlns: 'http://jabber.org/protocol/muc'
|
|
39
45
|
}));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
// Side-effects sequence: send the presence (handles its own
|
|
48
|
+
// failure → reject), then wait the timeout (also handles its own
|
|
49
|
+
// failure → reject). Each chain attaches its rejection handler
|
|
50
|
+
// synchronously, so no race with the outer Promise's catch.
|
|
51
|
+
(async () => {
|
|
52
|
+
try {
|
|
53
|
+
await client.send(presence);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
unsubscribe();
|
|
56
|
+
reject(err);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
await (0, _createTimeoutPromise.createTimeoutPromise)(2000, unsubscribe);
|
|
61
|
+
} catch (err) {
|
|
62
|
+
reject(err);
|
|
63
|
+
}
|
|
64
|
+
})();
|
|
47
65
|
});
|
|
48
66
|
};
|
|
49
67
|
exports.presenceInRoom = presenceInRoom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_client","require","_createTimeoutPromise","presenceIdCounter","nextPresenceId","Date","now","toString","presenceInRoom","client","roomJID","delay","stanzaHandler","unsubscribe","off","stanzaId","Promise","resolve","reject","settled","finish","cb","value","setTimeout","stanza","is","attrs","id","from","startsWith","on","presence","xml","jid","to","getLocal","xmlns","send","err","createTimeoutPromise","
|
|
1
|
+
{"version":3,"names":["_client","require","_createTimeoutPromise","presenceIdCounter","nextPresenceId","Date","now","toString","presenceInRoom","client","roomJID","delay","stanzaHandler","unsubscribe","off","stanzaId","Promise","resolve","reject","settled","finish","cb","value","setTimeout","stanza","is","attrs","id","from","startsWith","on","presence","xml","jid","to","getLocal","xmlns","send","err","createTimeoutPromise","exports"],"sourceRoot":"../../../../src","sources":["networking/xmpp/presenceInRoom.xmpp.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAGA,IAAIE,iBAAiB,GAAG,CAAC;AACzB,MAAMC,cAAc,GAAGA,CAAA,KACrB,kBAAkBC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAEJ,iBAAiB,EAAEI,QAAQ,CAAC,EAAE,CAAC,EAAE;AAE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;MAAEI,KAAK,EAAE;IAAiC,CAAC,CACtD,CAAC;;IAED;IACA;IACA;IACA;IACA,CAAC,YAAY;MACX,IAAI;QACF,MAAM3B,MAAM,CAAC4B,IAAI,CAACN,QAAQ,CAAC;MAC7B,CAAC,CAAC,OAAOO,GAAG,EAAE;QACZzB,WAAW,CAAC,CAAC;QACbK,MAAM,CAACoB,GAAG,CAAC;QACX;MACF;MACA,IAAI;QACF,MAAM,IAAAC,0CAAoB,EAAC,IAAI,EAAE1B,WAAW,CAAC;MAC/C,CAAC,CAAC,OAAOyB,GAAG,EAAE;QACZpB,MAAM,CAACoB,GAAG,CAAC;MACb;IACF,CAAC,EAAE,CAAC;EACN,CAAC,CAAC;AACJ,CAAC;AAACE,OAAA,CAAAhC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -44,12 +44,13 @@ const sendTextMessage = (client, roomJID, firstName, lastName, photo, walletAddr
|
|
|
44
44
|
if (!_sendTextSeq) {/* noop guarded init */}
|
|
45
45
|
const id = customId ? customId : isReply ? `send-reply-message-${Date.now()}-${_sendTextSeq = _sendTextSeq + 1 >>> 0}` : `send-text-message-${Date.now()}-${_sendTextSeq = _sendTextSeq + 1 >>> 0}`;
|
|
46
46
|
try {
|
|
47
|
+
const dataXmlns = toServiceXmlns(devServer, client);
|
|
47
48
|
const message = (0, _client.xml)('message', {
|
|
48
49
|
to: roomJID,
|
|
49
50
|
type: 'groupchat',
|
|
50
51
|
id: id
|
|
51
52
|
}, (0, _client.xml)('data', {
|
|
52
|
-
xmlns:
|
|
53
|
+
xmlns: dataXmlns,
|
|
53
54
|
senderFirstName: firstName,
|
|
54
55
|
senderLastName: lastName,
|
|
55
56
|
fullName: `${firstName} ${lastName}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_client","require","_sendTextSeq","toServiceXmlns","devServer","client","clientService","options","service","test","ds","trim","includes","replace","sendTextMessage","roomJID","firstName","lastName","photo","walletAddress","userMessage","notDisplayedValue","isReply","showInChannel","mainMessage","customId","id","Date","now","message","xml","to","type","xmlns","senderFirstName","senderLastName","fullName","photoURL","senderJID","jid","toString","senderWalletAddress","roomJid","isSystemMessage","tokenAmount","quickReplies","push","sendResult","send","then","console","log","catch","err","error","name","stack","exports"],"sourceRoot":"../../../../src","sources":["networking/xmpp/sendTextMessage.xmpp.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA,IAAIC,YAAY,GAAG,CAAC;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAACC,SAA6B,EAAEC,MAAc,KAAa;EAChF;EACA;EACA,MAAMC,aAAa,GAAID,MAAM,EAAUE,OAAO,EAAEC,OAA6B;EAC7E,IAAIF,aAAa,IAAI,YAAY,CAACG,IAAI,CAACH,aAAa,CAAC,EAAE;IAAC,OAAOA,aAAa;EAAC;EAC7E,MAAMI,EAAE,GAAG,CAACN,SAAS,IAAI,EAAE,EAAEO,IAAI,CAAC,CAAC;EACnC,IAAI,CAACD,EAAE,EAAE;IAAC,OAAO,6BAA6B;EAAC;EAC/C,IAAI,YAAY,CAACD,IAAI,CAACC,EAAE,CAAC,EAAE;IAAC,OAAOA,EAAE;EAAC;EACtC,IAAIA,EAAE,CAACE,QAAQ,CAAC,KAAK,CAAC,EAAE;IAAC,OAAOF,EAAE;EAAC;EACnC;EACA,OAAO,SAASA,EAAE,CAACG,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK;AACnD,CAAC;AAEM,MAAMC,eAAe,GAAGA,CAC7BT,MAAc,EACdU,OAAe,EACfC,SAAiB,EACjBC,QAAgB,EAChBC,KAAa,EACbC,aAAqB,EACrBC,WAAmB,EACnBC,iBAA0B,EAC1BC,OAAiB,EACjBC,aAAuB,EACvBC,WAAoB,EACpBpB,SAAkB,EAClBqB,QAAiB,KACd;EACH;EACA;EACA;EACA,IAAI,CAACvB,YAAY,EAAE,CAAC;EACpB,MAAMwB,EAAE,GAAGD,QAAQ,GACfA,QAAQ,GACRH,OAAO,GACL,sBAAsBK,IAAI,CAACC,GAAG,CAAC,CAAC,IAAK1B,YAAY,GAAIA,YAAY,GAAG,CAAC,KAAM,CAAC,EAAG,GAC/E,qBAAqByB,IAAI,CAACC,GAAG,CAAC,CAAC,IAAK1B,YAAY,GAAIA,YAAY,GAAG,CAAC,KAAM,CAAC,EAAG;EAEpF,IAAI;IACF,MAAM2B,OAAO,GAAG,IAAAC,WAAG,EACjB,SAAS,EACT;MACEC,EAAE,
|
|
1
|
+
{"version":3,"names":["_client","require","_sendTextSeq","toServiceXmlns","devServer","client","clientService","options","service","test","ds","trim","includes","replace","sendTextMessage","roomJID","firstName","lastName","photo","walletAddress","userMessage","notDisplayedValue","isReply","showInChannel","mainMessage","customId","id","Date","now","dataXmlns","message","xml","to","type","xmlns","senderFirstName","senderLastName","fullName","photoURL","senderJID","jid","toString","senderWalletAddress","roomJid","isSystemMessage","tokenAmount","quickReplies","push","sendResult","send","then","console","log","catch","err","error","name","stack","exports"],"sourceRoot":"../../../../src","sources":["networking/xmpp/sendTextMessage.xmpp.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA,IAAIC,YAAY,GAAG,CAAC;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAACC,SAA6B,EAAEC,MAAc,KAAa;EAChF;EACA;EACA,MAAMC,aAAa,GAAID,MAAM,EAAUE,OAAO,EAAEC,OAA6B;EAC7E,IAAIF,aAAa,IAAI,YAAY,CAACG,IAAI,CAACH,aAAa,CAAC,EAAE;IAAC,OAAOA,aAAa;EAAC;EAC7E,MAAMI,EAAE,GAAG,CAACN,SAAS,IAAI,EAAE,EAAEO,IAAI,CAAC,CAAC;EACnC,IAAI,CAACD,EAAE,EAAE;IAAC,OAAO,6BAA6B;EAAC;EAC/C,IAAI,YAAY,CAACD,IAAI,CAACC,EAAE,CAAC,E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