@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,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Outbound-send queue — buffers message stanzas that can't reach the wire
|
|
5
|
+
* because there is no live XMPP stream at send time, and replays them once
|
|
6
|
+
* a stream comes (back) online.
|
|
7
|
+
*
|
|
8
|
+
* Lives at MODULE scope on purpose, NOT on the XmppClient instance: the
|
|
9
|
+
* exact windows we need to cover are the ones where the instance itself is
|
|
10
|
+
* gone or being swapped —
|
|
11
|
+
* 1. start race — a send fires before the provider's bootstrap has run
|
|
12
|
+
* `setClient(created)`, so `useSendMessage` sees `client === null` and
|
|
13
|
+
* used to throw "No XMPP client".
|
|
14
|
+
* 2. full-reinit race — after 3 failed reconnects the provider does
|
|
15
|
+
* `setClient(null)` then re-`initializeClient`s; sends in that gap
|
|
16
|
+
* also saw `client === null`.
|
|
17
|
+
* 3. reconnect window — the instance survives but its underlying stream
|
|
18
|
+
* is `connecting`/`offline`; a fire-and-forget stanza is silently lost
|
|
19
|
+
* and only the 30s watchdog notices.
|
|
20
|
+
*
|
|
21
|
+
* Each queued item carries a `send(client)` closure that captures the
|
|
22
|
+
* original args (text or media), so flush is type-agnostic.
|
|
23
|
+
*
|
|
24
|
+
* TTL is deliberately aligned with the 30s pending-send watchdog in
|
|
25
|
+
* useSendMessage (PENDING_WATCHDOG_MS): a queued item older than that has
|
|
26
|
+
* already been — or is about to be — flipped to "Failed → tap to retry" by
|
|
27
|
+
* the watchdog, so replaying it on a late reconnect would duplicate the
|
|
28
|
+
* bubble. We drop those on flush and let the watchdog own the failure.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
// Kept in lockstep with PENDING_WATCHDOG_MS in useSendMessage.
|
|
32
|
+
export const OUTBOUND_QUEUE_TTL_MS = 30_000;
|
|
33
|
+
let queue = [];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Append (or, if the id is already queued, replace in place) a pending
|
|
37
|
+
* send. Order is preserved for FIFO flush.
|
|
38
|
+
*/
|
|
39
|
+
export function enqueueOutboundSend(item) {
|
|
40
|
+
const idx = queue.findIndex(q => q.optimisticId === item.optimisticId);
|
|
41
|
+
if (idx >= 0) {
|
|
42
|
+
// Re-enqueue of the same id (e.g. a media retry): refresh in place so
|
|
43
|
+
// we don't grow a duplicate, and keep its original position.
|
|
44
|
+
queue[idx] = item;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
queue.push(item);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Replay every queued send (in order) against a now-online client. Items
|
|
52
|
+
* older than the TTL are dropped — the send watchdog has already failed
|
|
53
|
+
* them, so re-sending would duplicate. The queue is emptied either way.
|
|
54
|
+
*/
|
|
55
|
+
export function flushOutboundSends(client, now) {
|
|
56
|
+
if (queue.length === 0) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const pending = queue;
|
|
60
|
+
queue = [];
|
|
61
|
+
for (const item of pending) {
|
|
62
|
+
if (now - item.enqueuedAt > OUTBOUND_QUEUE_TTL_MS) {
|
|
63
|
+
// Stale — the 30s watchdog owns the failure; don't duplicate.
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
item.send(client);
|
|
68
|
+
} catch (err) {
|
|
69
|
+
// A single bad replay must not strand the rest of the queue.
|
|
70
|
+
console.warn('flushOutboundSends: replay failed', item.optimisticId, err);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Drop everything — called on permanent teardown (logout / close). */
|
|
76
|
+
export function clearOutboundSends() {
|
|
77
|
+
queue = [];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Current depth — for tests and diagnostics. */
|
|
81
|
+
export function outboundQueueLength() {
|
|
82
|
+
return queue.length;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=outboundQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OUTBOUND_QUEUE_TTL_MS","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;AAC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|
export function createTimeoutPromise(ms, unsubscribe) {
|
|
4
|
-
|
|
4
|
+
const promise = new Promise((_, reject) => {
|
|
5
5
|
setTimeout(() => {
|
|
6
6
|
try {
|
|
7
7
|
if (unsubscribe) {
|
|
8
8
|
unsubscribe();
|
|
9
9
|
}
|
|
10
10
|
} catch (e) {}
|
|
11
|
+
// result and stay silent.
|
|
11
12
|
reject();
|
|
12
13
|
}, ms);
|
|
13
14
|
});
|
|
15
|
+
promise.catch(() => {});
|
|
16
|
+
return promise;
|
|
14
17
|
}
|
|
15
18
|
//# 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":";;AAAA,OAAO,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":";;AAAA,OAAO,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":[]}
|
|
@@ -17,7 +17,7 @@ export async function flushLastViewedToPrivateStore(client, rooms, opts = {}) {
|
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
19
|
const {
|
|
20
|
-
|
|
20
|
+
visibleRoomJID,
|
|
21
21
|
onlyIfNoUnread
|
|
22
22
|
} = opts;
|
|
23
23
|
const roomList = Object.values(rooms || {});
|
|
@@ -39,22 +39,21 @@ export async function flushLastViewedToPrivateStore(client, rooms, opts = {}) {
|
|
|
39
39
|
if (!room?.jid) {
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const isVisible = !!visibleRoomJID && room.jid === visibleRoomJID;
|
|
43
43
|
const hasUnread = Number(room.unreadMessages || 0) > 0;
|
|
44
44
|
|
|
45
|
-
// For the
|
|
46
|
-
//
|
|
47
|
-
// history unread on next login.
|
|
45
|
+
// For the visible room, persist "now" — read state is driven by
|
|
46
|
+
// room visibility, not by a sentinel timestamp.
|
|
48
47
|
let ts;
|
|
49
|
-
if (
|
|
48
|
+
if (isVisible) {
|
|
50
49
|
ts = nowMs;
|
|
51
|
-
} else if (room.lastViewedTimestamp) {
|
|
50
|
+
} else if (room.lastViewedTimestamp && room.lastViewedTimestamp > 0) {
|
|
52
51
|
ts = room.lastViewedTimestamp;
|
|
53
52
|
}
|
|
54
53
|
if (!ts) {
|
|
55
54
|
continue;
|
|
56
55
|
}
|
|
57
|
-
if (onlyIfNoUnread && hasUnread && !
|
|
56
|
+
if (onlyIfNoUnread && hasUnread && !isVisible) {
|
|
58
57
|
continue;
|
|
59
58
|
}
|
|
60
59
|
const prev = storeObj[room.jid];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getChatsPrivateStoreRequest","setChatsPrivateStoreRequest","flushLastViewedToPrivateStore","client","rooms","opts","
|
|
1
|
+
{"version":3,"names":["getChatsPrivateStoreRequest","setChatsPrivateStoreRequest","flushLastViewedToPrivateStore","client","rooms","opts","visibleRoomJID","onlyIfNoUnread","roomList","Object","values","length","storeObj","nowMs","Date","now","dirty","room","jid","isVisible","hasUnread","Number","unreadMessages","ts","lastViewedTimestamp","prev","prevNum","isFinite","String","JSON","stringify"],"sourceRoot":"../../../../src","sources":["networking/xmpp/flushLastViewedToPrivateStore.ts"],"mappings":";;AAAA,SAASA,2BAA2B,QAAQ,oCAAoC;AAChF,SAASC,2BAA2B,QAAQ,oCAAoC;AAmBhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,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,MAAMZ,2BAA2B,CAACG,MAAM,CAACA,MAAM,CAAC;EAC7D,CAAC,CAAC,MAAM;IACNS,QAAQ,GAAG,IAAI;EACjB;EACA,IAAI,CAACA,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAE;IAACA,QAAQ,GAAG,CAAC,CAAC;EAAC;EAE9D,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACxB,IAAIC,KAAK,GAAG,KAAK;EAEjB,KAAK,MAAMC,IAAI,IAAIT,QAAQ,EAAE;IAC3B,IAAI,CAACS,IAAI,EAAEC,GAAG,EAAE;MAAC;IAAS;IAC1B,MAAMC,SAAS,GAAG,CAAC,CAACb,cAAc,IAAIW,IAAI,CAACC,GAAG,KAAKZ,cAAc;IACjE,MAAMc,SAAS,GAAGC,MAAM,CAACJ,IAAI,CAACK,cAAc,IAAI,CAAC,CAAC,GAAG,CAAC;;IAEtD;IACA;IACA,IAAIC,EAAsB;IAC1B,IAAIJ,SAAS,EAAE;MACbI,EAAE,GAAGV,KAAK;IACZ,CAAC,MAAM,IAAII,IAAI,CAACO,mBAAmB,IAAIP,IAAI,CAACO,mBAAmB,GAAG,CAAC,EAAE;MACnED,EAAE,GAAGN,IAAI,CAACO,mBAAmB;IAC/B;IAEA,IAAI,CAACD,EAAE,EAAE;MAAC;IAAS;IACnB,IAAIhB,cAAc,IAAIa,SAAS,IAAI,CAACD,SAAS,EAAE;MAAC;IAAS;IAEzD,MAAMM,IAAI,GAAGb,QAAQ,CAACK,IAAI,CAACC,GAAG,CAAC;IAC/B,MAAMQ,OAAO,GAAGD,IAAI,IAAI,IAAI,GAAGJ,MAAM,CAACI,IAAI,CAAC,GAAG,CAAC;IAC/C,IAAIJ,MAAM,CAACM,QAAQ,CAACD,OAAO,CAAC,IAAIA,OAAO,IAAIH,EAAE,EAAE;MAAC;IAAS;IACzDX,QAAQ,CAACK,IAAI,CAACC,GAAG,CAAC,GAAGU,MAAM,CAACL,EAAE,CAAC;IAC/BP,KAAK,GAAG,IAAI;EACd;EAEA,IAAI,CAACA,KAAK,EAAE;IAAC,OAAO,KAAK;EAAC;EAE1B,IAAI;IACF,MAAMf,2BAA2B,CAACE,MAAM,CAACA,MAAM,EAAE0B,IAAI,CAACC,SAAS,CAAClB,QAAQ,CAAC,CAAC;IAC1E,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -7,7 +7,13 @@ export const getRoomsPaged = async (client, maxResults = 3, before = null) => {
|
|
|
7
7
|
const unsubscribe = () => {
|
|
8
8
|
client.off('stanza', stanzaHdlrPointer);
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
// Avoid `new Promise(async (resolve, reject) => {...})` — an async
|
|
12
|
+
// executor swallows the promise it returns, so any rejection inside
|
|
13
|
+
// it that happens BEFORE the catch handler attaches becomes
|
|
14
|
+
// "Uncaught (in promise)" red-screen. Use an explicit deferred + a
|
|
15
|
+
// regular async body that handles its own errors.
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
11
17
|
stanzaHdlrPointer = stanza => {
|
|
12
18
|
if (stanza.is('iq') && stanza.attrs.id === 'getUserRooms') {
|
|
13
19
|
unsubscribe();
|
|
@@ -30,14 +36,31 @@ export const getRoomsPaged = async (client, maxResults = 3, before = null) => {
|
|
|
30
36
|
from: client.jid?.toString(),
|
|
31
37
|
id: 'getUserRoomsPaged'
|
|
32
38
|
}, query);
|
|
39
|
+
|
|
40
|
+
// Capture potential rejections from client.send() — it returns a
|
|
41
|
+
// Promise on most @xmpp/client builds; the previous bare call left
|
|
42
|
+
// the rejection unhandled when the socket was closing.
|
|
43
|
+
let sendPromise;
|
|
33
44
|
try {
|
|
34
|
-
client.send(message);
|
|
45
|
+
sendPromise = client.send(message);
|
|
35
46
|
} catch (err) {
|
|
36
47
|
console.error('Error sending getRooms request:', err);
|
|
37
48
|
unsubscribe();
|
|
38
49
|
reject(err);
|
|
50
|
+
return;
|
|
39
51
|
}
|
|
40
|
-
|
|
52
|
+
Promise.resolve(sendPromise).catch(err => {
|
|
53
|
+
console.error('client.send rejected in getRoomsPaged', err);
|
|
54
|
+
unsubscribe();
|
|
55
|
+
reject(err);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// The timeout catch was racy — if createTimeoutPromise rejected
|
|
59
|
+
// before `.catch(reject)` attached, the rejection escaped. Use a
|
|
60
|
+
// .then/.catch pair attached synchronously to be safe.
|
|
61
|
+
createTimeoutPromise(2000, unsubscribe).then(() => {
|
|
62
|
+
/* timeout completed cleanly */
|
|
63
|
+
}, err => reject(err));
|
|
41
64
|
});
|
|
42
65
|
};
|
|
43
66
|
//# sourceMappingURL=getRoomsPaged.xmpp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["xml","createTimeoutPromise","getRoomsPaged","client","maxResults","before","stanzaHdlrPointer","unsubscribe","off","Promise","resolve","reject","stanza","is","attrs","id","on","query","xmlns","set","toString","append","message","type","from","jid","send","err","console","error","catch"],"sourceRoot":"../../../../src","sources":["networking/xmpp/getRoomsPaged.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;AAC1C,SAASC,oBAAoB,QAAQ,6BAA6B;AAGlE,OAAO,MAAMC,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;
|
|
1
|
+
{"version":3,"names":["xml","createTimeoutPromise","getRoomsPaged","client","maxResults","before","stanzaHdlrPointer","unsubscribe","off","Promise","resolve","reject","stanza","is","attrs","id","on","query","xmlns","set","toString","append","message","type","from","jid","sendPromise","send","err","console","error","catch","then"],"sourceRoot":"../../../../src","sources":["networking/xmpp/getRoomsPaged.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;AAC1C,SAASC,oBAAoB,QAAQ,6BAA6B;AAGlE,OAAO,MAAMC,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,iBAAiB,GAAIM,MAAM,IAAK;MAC9B,IAAIA,MAAM,CAACC,EAAE,CAAC,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CAAC;MAC3DrB,WAAW,CAAC,CAAC;MACbI,MAAM,CAACiB,GAAG,CAAC;IACb,CAAC,CAAC;;IAEJ;IACA;IACA;IACA3B,oBAAoB,CAAC,IAAI,EAAEM,WAAW,CAAC,CAACyB,IAAI,CAC1C,MAAM;MACJ;IAAA,CACD,EACAJ,GAAG,IAAKjB,MAAM,CAACiB,GAAG,CACrB,CAAC;EACH,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,13 @@ export const presenceInRoom = async (client, roomJID, delay = 2000) => {
|
|
|
8
8
|
let stanzaHandler;
|
|
9
9
|
const unsubscribe = () => client.off('stanza', stanzaHandler);
|
|
10
10
|
const stanzaId = nextPresenceId();
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// Avoid `new Promise(async (resolve, reject) => …)` — the async
|
|
13
|
+
// executor's own thrown errors / unhandled rejections inside it can
|
|
14
|
+
// escape the constructed promise depending on the order of catch
|
|
15
|
+
// attachment vs rejection. Use a regular Promise + a separate async
|
|
16
|
+
// wrapper that funnels every failure path through reject().
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
12
18
|
let settled = false;
|
|
13
19
|
const finish = (cb, value) => {
|
|
14
20
|
if (settled) {
|
|
@@ -33,13 +39,25 @@ export const presenceInRoom = async (client, roomJID, delay = 2000) => {
|
|
|
33
39
|
}, xml('x', {
|
|
34
40
|
xmlns: 'http://jabber.org/protocol/muc'
|
|
35
41
|
}));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
// Side-effects sequence: send the presence (handles its own
|
|
44
|
+
// failure → reject), then wait the timeout (also handles its own
|
|
45
|
+
// failure → reject). Each chain attaches its rejection handler
|
|
46
|
+
// synchronously, so no race with the outer Promise's catch.
|
|
47
|
+
(async () => {
|
|
48
|
+
try {
|
|
49
|
+
await client.send(presence);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
unsubscribe();
|
|
52
|
+
reject(err);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
await createTimeoutPromise(2000, unsubscribe);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
reject(err);
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
43
61
|
});
|
|
44
62
|
};
|
|
45
63
|
//# sourceMappingURL=presenceInRoom.xmpp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["xml","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","jid","to","getLocal","xmlns","send","err"
|
|
1
|
+
{"version":3,"names":["xml","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","jid","to","getLocal","xmlns","send","err"],"sourceRoot":"../../../../src","sources":["networking/xmpp/presenceInRoom.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;AAC1C,SAASC,oBAAoB,QAAQ,6BAA6B;AAGlE,IAAIC,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;AAEnF,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAC5BC,MAAc,EACdC,OAAe,EACfC,KAAK,GAAG,IAAI,KACS;EACrB,IAAIC,aAAwC;EAC5C,MAAMC,WAAW,GAAGA,CAAA,KAAMJ,MAAM,CAACK,GAAG,CAAC,QAAQ,E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,WAAW,CAAC,CAAC;QACbK,MAAM,CAACmB,GAAG,CAAC;QACX;MACF;MACA,IAAI;QACF,MAAMnC,oBAAoB,CAAC,IAAI,EAAEW,WAAW,CAAC;MAC/C,CAAC,CAAC,OAAOwB,GAAG,EAAE;QACZnB,MAAM,CAACmB,GAAG,CAAC;MACb;IACF,CAAC,EAAE,CAAC;EACN,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -41,12 +41,13 @@ export const sendTextMessage = (client, roomJID, firstName, lastName, photo, wal
|
|
|
41
41
|
if (!_sendTextSeq) {/* noop guarded init */}
|
|
42
42
|
const id = customId ? customId : isReply ? `send-reply-message-${Date.now()}-${_sendTextSeq = _sendTextSeq + 1 >>> 0}` : `send-text-message-${Date.now()}-${_sendTextSeq = _sendTextSeq + 1 >>> 0}`;
|
|
43
43
|
try {
|
|
44
|
+
const dataXmlns = toServiceXmlns(devServer, client);
|
|
44
45
|
const message = xml('message', {
|
|
45
46
|
to: roomJID,
|
|
46
47
|
type: 'groupchat',
|
|
47
48
|
id: id
|
|
48
49
|
}, xml('data', {
|
|
49
|
-
xmlns:
|
|
50
|
+
xmlns: dataXmlns,
|
|
50
51
|
senderFirstName: firstName,
|
|
51
52
|
senderLastName: lastName,
|
|
52
53
|
fullName: `${firstName} ${lastName}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["xml","_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","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"],"sourceRoot":"../../../../src","sources":["networking/xmpp/sendTextMessage.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;;AAE1C;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I;IACF,MAAM2B,OAAO,
|
|
1
|
+
{"version":3,"names":["xml","_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","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"],"sourceRoot":"../../../../src","sources":["networking/xmpp/sendTextMessage.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;;AAE1C;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;AAED,OAAO,MAAMC,eAAe,GAAGA,CAC7BT,MAAc,EACdU,OAAe,EACfC,SAAiB,EACjBC,QAAgB,EAChBC,KAAa,EACbC,aAAqB,EACrBC,W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