@ethora/chat-component-rn 26.7.10 → 26.8.1
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 +0 -96
- package/README.md +10 -43
- package/lib/commonjs/assets/icons.js +2 -7
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +7 -26
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +3 -9
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +14 -150
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +38 -34
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +1 -2
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +9 -29
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +1 -5
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +5 -13
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +24 -3
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +35 -208
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -317
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageTranslate.js +16 -7
- package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +112 -320
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +215 -556
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +27 -69
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +1 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +109 -205
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +39 -23
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -22
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -17
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +3 -6
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +1 -2
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +10 -3
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +9 -37
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/NewMessageLabel.js +3 -1
- package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +17 -86
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +3 -9
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +4 -14
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +61 -119
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +59 -177
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +1 -19
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/commonjs/helpers/getDataFromXml.js +24 -1
- package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
- package/lib/commonjs/helpers/historyPreloadScheduler.js +2 -65
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +8 -14
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +22 -51
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isUnresolvedSenderId.js +6 -1
- package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -1
- package/lib/commonjs/helpers/keyboardLayout.js +2 -12
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mimeToExtension.js +14 -6
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +17 -130
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/resolveLangSource.js +38 -0
- package/lib/commonjs/helpers/resolveLangSource.js.map +1 -0
- package/lib/commonjs/helpers/xmppUsername.js +39 -0
- package/lib/commonjs/helpers/xmppUsername.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +12 -45
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +14 -32
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +0 -27
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +7 -23
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +11 -8
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +14 -50
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -6
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +133 -121
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/i18n/useT.js +1 -1
- package/lib/commonjs/main.js +0 -44
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +60 -134
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +9 -68
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +112 -62
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +51 -93
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +1 -8
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +8 -124
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -26
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +2 -35
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +39 -226
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +38 -151
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +13 -15
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/version.js +3 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/assets/icons.js +1 -6
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +7 -26
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +3 -9
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +16 -152
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +40 -36
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +1 -2
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +10 -30
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +1 -5
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +5 -13
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +26 -5
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +35 -207
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -319
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageTranslate.js +16 -7
- package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +115 -311
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +219 -559
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +28 -70
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +1 -2
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +1 -9
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +111 -208
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +2 -9
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +40 -24
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -22
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -17
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +3 -6
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +1 -2
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +10 -3
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +9 -37
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/NewMessageLabel.js +3 -1
- package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +18 -87
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +3 -9
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +4 -14
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +62 -120
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +60 -177
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +1 -19
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/module/helpers/getDataFromXml.js +23 -1
- package/lib/module/helpers/getDataFromXml.js.map +1 -1
- package/lib/module/helpers/historyPreloadScheduler.js +3 -66
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +8 -14
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +22 -52
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isUnresolvedSenderId.js +6 -1
- package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -1
- package/lib/module/helpers/keyboardLayout.js +2 -12
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mimeToExtension.js +13 -6
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/resolveInitBeforeLoadUser.js +16 -130
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/resolveLangSource.js +32 -0
- package/lib/module/helpers/resolveLangSource.js.map +1 -0
- package/lib/module/helpers/xmppUsername.js +35 -0
- package/lib/module/helpers/xmppUsername.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +13 -46
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +14 -32
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +1 -28
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useLogout.js +7 -23
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +11 -8
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +16 -52
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +1 -6
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +133 -121
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/i18n/useT.js +1 -1
- package/lib/module/main.js +2 -14
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +59 -131
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +7 -64
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +113 -61
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +52 -94
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +1 -8
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +8 -124
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +7 -26
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +4 -37
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +38 -223
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +34 -139
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +13 -15
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/version.js +3 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +0 -16
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.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/LoginWrapper.d.ts.map +1 -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/MessageList.d.ts +1 -10
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +0 -7
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -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/NewChatModal/ModalContent.d.ts +2 -4
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +0 -14
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- 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/StyledComponents.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.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +0 -8
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts +1 -5
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mimeToExtension.d.ts +15 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/resolveLangSource.d.ts +30 -0
- package/lib/typescript/helpers/resolveLangSource.d.ts.map +1 -0
- package/lib/typescript/helpers/xmppUsername.d.ts +13 -0
- package/lib/typescript/helpers/xmppUsername.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +1 -4
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +0 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/i18n/useT.d.ts +1 -1
- package/lib/typescript/main.d.ts +2 -9
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +1 -3
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts +6 -12
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +2 -10
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +0 -14
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +0 -16
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +1 -18
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +3 -43
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +5 -50
- 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 +29 -41
- package/src/assets/icons.tsx +9 -48
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +6 -24
- package/src/components/MainComponents/ChatHeader.tsx +3 -9
- package/src/components/MainComponents/ChatRoom.tsx +15 -161
- package/src/components/MainComponents/ChatWrapper.tsx +53 -36
- package/src/components/MainComponents/LoginWrapper.tsx +0 -1
- package/src/components/MainComponents/MediaMessage.tsx +8 -26
- package/src/components/MainComponents/MessageContainer.tsx +1 -5
- package/src/components/MainComponents/MessageList.tsx +4 -23
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
- package/src/components/MainComponents/ReduxWrapper.tsx +18 -1
- package/src/components/MainComponents/RoomList.tsx +39 -236
- package/src/components/Menu/HeaderRoomListMenu.tsx +75 -328
- package/src/components/MessageBubble/MessageTranslate.tsx +17 -12
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +99 -331
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +293 -611
- package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +9 -7
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +38 -79
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +1 -2
- package/src/components/Modals/Modal/Modal.tsx +0 -7
- package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +126 -223
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
- package/src/components/Modals/styledModalComponents.tsx +2 -9
- package/src/components/RoomComponents/ChatRoomItem.tsx +50 -21
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +4 -28
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +3 -18
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +3 -18
- package/src/components/VideoCalls/VideoCallSession.tsx +3 -8
- package/src/components/styled/AudioMessage.tsx +1 -2
- package/src/components/styled/DateLabel.tsx +10 -3
- package/src/components/styled/MessageImage.tsx +7 -53
- package/src/components/styled/NewMessageLabel.tsx +3 -1
- package/src/components/styled/SendInput.tsx +18 -91
- package/src/components/styled/StyledComponents.ts +3 -9
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
- package/src/components/styled/UnsupportedType.tsx +4 -14
- package/src/components/styled/VideoMessage.tsx +54 -131
- package/src/context/xmppProvider.tsx +57 -209
- package/src/helpers/createMessageFromXml.ts +1 -20
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getDataFromXml.ts +25 -1
- package/src/helpers/historyPreloadScheduler.ts +3 -80
- package/src/helpers/initXmppRooms.tsx +10 -14
- package/src/helpers/insertMessageWithDelimiter.ts +32 -55
- package/src/helpers/isUnresolvedSenderId.ts +9 -1
- package/src/helpers/keyboardLayout.ts +2 -23
- package/src/helpers/mimeToExtension.ts +22 -6
- package/src/helpers/resolveInitBeforeLoadUser.ts +18 -125
- package/src/helpers/resolveLangSource.ts +40 -0
- package/src/helpers/xmppUsername.ts +38 -0
- package/src/hooks/useChatRoomFocus.ts +9 -49
- package/src/hooks/useChatWrapperInit.ts +16 -32
- package/src/hooks/useComposing.tsx +1 -37
- package/src/hooks/useLogout.tsx +9 -29
- package/src/hooks/usePendingNotification.ts +11 -5
- package/src/hooks/useSendMessage.tsx +15 -60
- package/src/hooks/useUnreadMessagesCounter.ts +0 -11
- package/src/i18n/strings.ts +133 -121
- package/src/i18n/useT.ts +1 -1
- package/src/main.ts +2 -26
- package/src/networking/api-requests/auth.api.ts +48 -156
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +7 -79
- package/src/networking/apiClient.ts +123 -68
- package/src/networking/stanzaHandlers.ts +51 -92
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +10 -71
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +1 -6
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +1 -12
- package/src/networking/xmppClient.ts +9 -141
- package/src/roomStore/chatSettingsSlice.ts +10 -34
- package/src/roomStore/index.ts +4 -40
- package/src/roomStore/persistence.ts +40 -234
- package/src/roomStore/roomsSlice.ts +29 -161
- package/src/services/pushSubscriptionService.ts +13 -18
- package/src/types/types.ts +5 -72
- package/src/version.ts +3 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/commonjs/helpers/getChatBackground.js +0 -23
- package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
- package/lib/commonjs/helpers/getDisplayFileName.js +0 -79
- package/lib/commonjs/helpers/getDisplayFileName.js.map +0 -1
- package/lib/commonjs/helpers/getServerReadTimestamp.js +0 -188
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +0 -1
- package/lib/commonjs/helpers/isOwnMessage.js +0 -75
- package/lib/commonjs/helpers/isOwnMessage.js.map +0 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/commonjs/helpers/msgSortableMs.js +0 -37
- package/lib/commonjs/helpers/msgSortableMs.js.map +0 -1
- package/lib/commonjs/helpers/persistCrypto.js +0 -122
- package/lib/commonjs/helpers/persistCrypto.js.map +0 -1
- package/lib/commonjs/helpers/pickImageAsset.js +0 -68
- package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
- package/lib/commonjs/helpers/pushPayload.js +0 -71
- package/lib/commonjs/helpers/pushPayload.js.map +0 -1
- package/lib/commonjs/helpers/secureFileUrl.js +0 -101
- package/lib/commonjs/helpers/secureFileUrl.js.map +0 -1
- package/lib/commonjs/helpers/secureKeyValue.js +0 -83
- package/lib/commonjs/helpers/secureKeyValue.js.map +0 -1
- package/lib/commonjs/helpers/secureStoreRuntime.js +0 -59
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +0 -1
- package/lib/commonjs/helpers/secureUserStorage.js +0 -75
- package/lib/commonjs/helpers/secureUserStorage.js.map +0 -1
- package/lib/commonjs/helpers/shallowEqual.js +0 -36
- package/lib/commonjs/helpers/shallowEqual.js.map +0 -1
- package/lib/commonjs/helpers/sheetGestures.js +0 -32
- package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
- package/lib/commonjs/hooks/useFileToken.js +0 -10
- package/lib/commonjs/hooks/useFileToken.js.map +0 -1
- package/lib/commonjs/networking/authRefresh.js +0 -332
- package/lib/commonjs/networking/authRefresh.js.map +0 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/module/helpers/getChatBackground.js +0 -18
- package/lib/module/helpers/getChatBackground.js.map +0 -1
- package/lib/module/helpers/getDisplayFileName.js +0 -73
- package/lib/module/helpers/getDisplayFileName.js.map +0 -1
- package/lib/module/helpers/getServerReadTimestamp.js +0 -181
- package/lib/module/helpers/getServerReadTimestamp.js.map +0 -1
- package/lib/module/helpers/isOwnMessage.js +0 -70
- package/lib/module/helpers/isOwnMessage.js.map +0 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
- package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/module/helpers/msgSortableMs.js +0 -32
- package/lib/module/helpers/msgSortableMs.js.map +0 -1
- package/lib/module/helpers/persistCrypto.js +0 -115
- package/lib/module/helpers/persistCrypto.js.map +0 -1
- package/lib/module/helpers/pickImageAsset.js +0 -63
- package/lib/module/helpers/pickImageAsset.js.map +0 -1
- package/lib/module/helpers/pushPayload.js +0 -63
- package/lib/module/helpers/pushPayload.js.map +0 -1
- package/lib/module/helpers/secureFileUrl.js +0 -91
- package/lib/module/helpers/secureFileUrl.js.map +0 -1
- package/lib/module/helpers/secureKeyValue.js +0 -75
- package/lib/module/helpers/secureKeyValue.js.map +0 -1
- package/lib/module/helpers/secureStoreRuntime.js +0 -52
- package/lib/module/helpers/secureStoreRuntime.js.map +0 -1
- package/lib/module/helpers/secureUserStorage.js +0 -72
- package/lib/module/helpers/secureUserStorage.js.map +0 -1
- package/lib/module/helpers/shallowEqual.js +0 -31
- package/lib/module/helpers/shallowEqual.js.map +0 -1
- package/lib/module/helpers/sheetGestures.js +0 -26
- package/lib/module/helpers/sheetGestures.js.map +0 -1
- package/lib/module/hooks/useFileToken.js +0 -5
- package/lib/module/hooks/useFileToken.js.map +0 -1
- package/lib/module/networking/authRefresh.js +0 -321
- package/lib/module/networking/authRefresh.js.map +0 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
- package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
- package/lib/typescript/helpers/getDisplayFileName.d.ts +0 -49
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +0 -1
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +0 -108
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +0 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +0 -36
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +0 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +0 -2
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +0 -1
- package/lib/typescript/helpers/persistCrypto.d.ts +0 -13
- package/lib/typescript/helpers/persistCrypto.d.ts.map +0 -1
- package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
- package/lib/typescript/helpers/pushPayload.d.ts +0 -7
- package/lib/typescript/helpers/pushPayload.d.ts.map +0 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +0 -7
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +0 -1
- package/lib/typescript/helpers/secureKeyValue.d.ts +0 -13
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +0 -1
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +0 -29
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/secureUserStorage.d.ts +0 -23
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +0 -1
- package/lib/typescript/helpers/shallowEqual.d.ts +0 -11
- package/lib/typescript/helpers/shallowEqual.d.ts.map +0 -1
- package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
- package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
- package/lib/typescript/hooks/useFileToken.d.ts +0 -2
- package/lib/typescript/hooks/useFileToken.d.ts.map +0 -1
- package/lib/typescript/networking/authRefresh.d.ts +0 -95
- package/lib/typescript/networking/authRefresh.d.ts.map +0 -1
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
- package/src/helpers/getChatBackground.ts +0 -18
- package/src/helpers/getDisplayFileName.ts +0 -87
- package/src/helpers/getServerReadTimestamp.ts +0 -197
- package/src/helpers/isOwnMessage.ts +0 -90
- package/src/helpers/mediaLibraryRuntime.ts +0 -25
- package/src/helpers/msgSortableMs.ts +0 -25
- package/src/helpers/persistCrypto.ts +0 -127
- package/src/helpers/pickImageAsset.ts +0 -68
- package/src/helpers/pushPayload.ts +0 -62
- package/src/helpers/secureFileUrl.ts +0 -103
- package/src/helpers/secureKeyValue.ts +0 -80
- package/src/helpers/secureStoreRuntime.ts +0 -62
- package/src/helpers/secureUserStorage.ts +0 -80
- package/src/helpers/shallowEqual.ts +0 -33
- package/src/helpers/sheetGestures.ts +0 -25
- package/src/hooks/useFileToken.ts +0 -7
- package/src/networking/authRefresh.ts +0 -451
|
@@ -8,7 +8,6 @@ var _react = require("react");
|
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
9
|
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
10
10
|
var _roomStore = require("../roomStore");
|
|
11
|
-
var _getServerReadTimestamp = require("../helpers/getServerReadTimestamp");
|
|
12
11
|
/**
|
|
13
12
|
* Public hook for consumers embedding `<ChatRoom>` inside a tab-based
|
|
14
13
|
* navigator. Mirrors the mount/unmount unread-tracking that ChatRoom
|
|
@@ -19,10 +18,7 @@ var _getServerReadTimestamp = require("../helpers/getServerReadTimestamp");
|
|
|
19
18
|
* Without this hook, `useUnread()` will always return 0 for the chat
|
|
20
19
|
* room because the SDK assumes "mounted == active". With this hook,
|
|
21
20
|
* focus marks the room visible (clearing the badge) and blur stamps
|
|
22
|
-
* `lastViewedTimestamp`
|
|
23
|
-
* future messages count as unread. Deliberately not `Date.now()`: a
|
|
24
|
-
* device clock running ahead would write a future marker that the
|
|
25
|
-
* forward-only private-store merge could never correct again (bug #38).
|
|
21
|
+
* `lastViewedTimestamp = Date.now()` so future messages count as unread.
|
|
26
22
|
*
|
|
27
23
|
* Usage with React Navigation:
|
|
28
24
|
*
|
|
@@ -47,51 +43,22 @@ const useChatRoomFocus = ({
|
|
|
47
43
|
roomJID: null,
|
|
48
44
|
isFocused: false
|
|
49
45
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// mounted in a hidden tab), so its own scroll-tracking ref is still
|
|
57
|
-
// intact and the redux boundary must stay in sync with it - clearing
|
|
58
|
-
// it here would desync the two.
|
|
59
|
-
const leaveRoom = (jid, clearBoundary) => {
|
|
60
|
-
const state = _roomStore.store.getState();
|
|
61
|
-
const rooms = state.rooms?.rooms;
|
|
62
|
-
const boundaryTs = state.rooms?.readBoundaries?.[jid] ?? null;
|
|
63
|
-
// getReadMarkerTimestamp: honour the boundary (the newest message the
|
|
64
|
-
// user actually reached) when the user left this room scrolled up,
|
|
65
|
-
// otherwise fall back to the newest server-acked message. Only stamp
|
|
66
|
-
// when we actually have something to anchor to - skip rather than
|
|
67
|
-
// fall back to the device clock (bug #38). Ignoring the boundary here
|
|
68
|
-
// would stamp "everything read" regardless of scroll position (bug
|
|
69
|
-
// #42, a regression of #33 reintroduced by #38).
|
|
70
|
-
const timestamp = (0, _getServerReadTimestamp.getReadMarkerTimestamp)(rooms?.[jid], state.roomHeapSlice, boundaryTs);
|
|
71
|
-
if (timestamp > 0) {
|
|
72
|
-
dispatch((0, _roomsSlice.setLastViewedTimestamp)({
|
|
73
|
-
chatJID: jid,
|
|
74
|
-
timestamp
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
46
|
+
const leaveRoom = jid => {
|
|
47
|
+
const timestamp = Date.now();
|
|
48
|
+
dispatch((0, _roomsSlice.setLastViewedTimestamp)({
|
|
49
|
+
chatJID: jid,
|
|
50
|
+
timestamp
|
|
51
|
+
}));
|
|
77
52
|
dispatch((0, _roomsSlice.clearVisibleRoom)());
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// flush defaults to "everything" for the visible room. Clamped
|
|
82
|
-
// through the same helper as the local stamp above.
|
|
83
|
-
visibleRoomTs: (0, _getServerReadTimestamp.getFlushBoundaryTs)(rooms?.[jid], state.roomHeapSlice, boundaryTs)
|
|
53
|
+
const rooms = _roomStore.store.getState().rooms?.rooms;
|
|
54
|
+
_roomStore.store.getState().chatSettingStore?.client?.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
55
|
+
visibleRoomJID: jid
|
|
84
56
|
}).catch(() => {});
|
|
85
|
-
if (clearBoundary) {
|
|
86
|
-
dispatch((0, _roomsSlice.clearReadBoundary)({
|
|
87
|
-
jid
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
57
|
};
|
|
91
58
|
(0, _react.useEffect)(() => {
|
|
92
59
|
const prev = prevRef.current;
|
|
93
60
|
if (prev.isFocused && prev.roomJID && (prev.roomJID !== roomJID || !isFocused)) {
|
|
94
|
-
leaveRoom(prev.roomJID
|
|
61
|
+
leaveRoom(prev.roomJID);
|
|
95
62
|
}
|
|
96
63
|
if (roomJID && isFocused) {
|
|
97
64
|
dispatch((0, _roomsSlice.setCurrentRoom)({
|
|
@@ -110,7 +77,7 @@ const useChatRoomFocus = ({
|
|
|
110
77
|
return () => {
|
|
111
78
|
const prev = prevRef.current;
|
|
112
79
|
if (prev.isFocused && prev.roomJID) {
|
|
113
|
-
leaveRoom(prev.roomJID
|
|
80
|
+
leaveRoom(prev.roomJID);
|
|
114
81
|
}
|
|
115
82
|
};
|
|
116
83
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_roomsSlice","_roomStore","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_roomsSlice","_roomStore","useChatRoomFocus","roomJID","isFocused","dispatch","useDispatch","prevRef","useRef","leaveRoom","jid","timestamp","Date","now","setLastViewedTimestamp","chatJID","clearVisibleRoom","rooms","store","getState","chatSettingStore","client","flushLastViewedToPrivateStoreStanza","visibleRoomJID","catch","useEffect","prev","current","setCurrentRoom","setVisibleRoom","exports","_default","default"],"sourceRoot":"../../../src","sources":["hooks/useChatRoomFocus.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,UAAA,GAAAH,OAAA;AAgBA;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;AACO,MAAMI,gBAAgB,GAAGA,CAAC;EAC/BC,OAAO;EACPC;AACuB,CAAC,KAAK;EAC7B,MAAM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AC3D,CAAC,EAAE,CAACD,OAAO,EAAEC,SAAS,EAAEC,QAAQ,CAAC,CAAC;EAElC,IAAAoB,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX,MAAMC,IAAI,GAAGnB,OAAO,CAACoB,OAAO;MAC5B,IAAID,IAAI,CAACtB,SAAS,IAAIsB,IAAI,CAACvB,OAAO,EAAE;QAClCM,SAAS,CAACiB,IAAI,CAACvB,OAAO,CAAC;MACzB;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAC2B,OAAA,CAAA5B,gBAAA,GAAAA,gBAAA;AAAA,IAAA6B,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEa9B,gBAAgB","ignoreList":[]}
|
|
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
|
+
var _resolveLangSource = require("../helpers/resolveLangSource");
|
|
9
10
|
var _xmppProvider = require("../context/xmppProvider");
|
|
10
11
|
var _chatAutoEnterer = require("../helpers/chatAutoEnterer");
|
|
11
12
|
var _initRoomsPresence = require("../helpers/initRoomsPresence");
|
|
13
|
+
var _updatedChatLastTimestamps = require("../helpers/updatedChatLastTimestamps");
|
|
12
14
|
var _updateMessagesTillLast = require("../helpers/updateMessagesTillLast");
|
|
13
|
-
var
|
|
15
|
+
var _apiClient = require("../networking/apiClient");
|
|
14
16
|
var _chatSettingsSlice = require("../roomStore/chatSettingsSlice");
|
|
15
17
|
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
16
18
|
var _useRoomState = require("./useRoomState");
|
|
@@ -18,7 +20,6 @@ var _useChatSettingState = require("./useChatSettingState");
|
|
|
18
20
|
var _isChatIdPresentInArray = require("../helpers/isChatIdPresentInArray");
|
|
19
21
|
var _useGetNewArchRoom = _interopRequireDefault(require("./useGetNewArchRoom"));
|
|
20
22
|
var _getRoomsWithRetry = require("../helpers/getRoomsWithRetry");
|
|
21
|
-
var _shallowEqual = require("../helpers/shallowEqual");
|
|
22
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
24
|
/** @format */
|
|
24
25
|
|
|
@@ -57,20 +58,6 @@ const useChatWrapperInit = ({
|
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
}, [user.xmppPassword]);
|
|
60
|
-
|
|
61
|
-
// Presentational config flags (e.g. `disableHeader`) can change while the
|
|
62
|
-
// chat stays mounted — sync them to redux whenever `config` actually
|
|
63
|
-
// changes, not just at init. Shallow-equal guard: an inline object
|
|
64
|
-
// literal from the host is a fresh reference every render even when
|
|
65
|
-
// nothing in it changed, and dispatching unconditionally would re-render
|
|
66
|
-
// every config consumer on every host render.
|
|
67
|
-
const lastSyncedConfigRef = (0, _react.useRef)(undefined);
|
|
68
|
-
(0, _react.useEffect)(() => {
|
|
69
|
-
if (!(0, _shallowEqual.shallowEqual)(lastSyncedConfigRef.current, config)) {
|
|
70
|
-
lastSyncedConfigRef.current = config;
|
|
71
|
-
dispatch((0, _chatSettingsSlice.setConfig)(config));
|
|
72
|
-
}
|
|
73
|
-
}, [config, dispatch]);
|
|
74
61
|
const getRoomsWithRertyRequest = async () => {
|
|
75
62
|
setIsRetrying(true);
|
|
76
63
|
const retryRooms = await (0, _getRoomsWithRetry.getRoomsWithRetry)(client, config, syncRooms, roomJID);
|
|
@@ -95,8 +82,9 @@ const useChatWrapperInit = ({
|
|
|
95
82
|
(0, _react.useEffect)(() => {
|
|
96
83
|
let retryTimeout;
|
|
97
84
|
const initXmmpClient = async () => {
|
|
98
|
-
|
|
99
|
-
|
|
85
|
+
const legacyLangSource = (0, _resolveLangSource.resolveLegacyTranslatesLangSource)(config?.translates);
|
|
86
|
+
if (legacyLangSource) {
|
|
87
|
+
dispatch((0, _chatSettingsSlice.setLangSource)(legacyLangSource));
|
|
100
88
|
}
|
|
101
89
|
dispatch((0, _chatSettingsSlice.setConfig)(config));
|
|
102
90
|
try {
|
|
@@ -140,17 +128,11 @@ const useChatWrapperInit = ({
|
|
|
140
128
|
}
|
|
141
129
|
}
|
|
142
130
|
try {
|
|
143
|
-
// getChatsPrivateStoreRequestStanza hydrates redux itself
|
|
144
|
-
// (dispatch(applyPrivateStoreMarkers(...)) internally,
|
|
145
|
-
// clamped + forward-only) - do not also apply the raw
|
|
146
|
-
// return value here. That used to double-dispatch via
|
|
147
|
-
// updatedChatLastTimestamps' unconditional
|
|
148
|
-
// setLastViewedTimestamp, which has neither the
|
|
149
|
-
// forward-only guard nor the future-marker clamp, so on
|
|
150
|
-
// every reconnect it could silently re-clobber a value
|
|
151
|
-
// the clamp had just corrected (bug #38).
|
|
152
131
|
const roomTimestampObject = await newClient.getChatsPrivateStoreRequestStanza();
|
|
153
132
|
console.log('Got chats private store', roomTimestampObject?.length || 0);
|
|
133
|
+
if (roomTimestampObject) {
|
|
134
|
+
(0, _updatedChatLastTimestamps.updatedChatLastTimestamps)(roomTimestampObject, dispatch);
|
|
135
|
+
}
|
|
154
136
|
if (!hasSyncedHistoryRef.current) {
|
|
155
137
|
console.log('Updating messages till last');
|
|
156
138
|
await (0, _updateMessagesTillLast.updateMessagesTillLast)(rooms, newClient);
|
|
@@ -165,7 +147,7 @@ const useChatWrapperInit = ({
|
|
|
165
147
|
setConnectionLost(false);
|
|
166
148
|
}
|
|
167
149
|
{
|
|
168
|
-
config?.refreshTokens?.enabled && (0,
|
|
150
|
+
config?.refreshTokens?.enabled && (0, _apiClient.refresh)();
|
|
169
151
|
}
|
|
170
152
|
} catch (error) {
|
|
171
153
|
console.error(' Error during initialization', error);
|
|
@@ -185,11 +167,11 @@ const useChatWrapperInit = ({
|
|
|
185
167
|
setInited(true);
|
|
186
168
|
console.log(' Getting chats private store for existing client');
|
|
187
169
|
try {
|
|
188
|
-
// See the "new client" branch above: getChatsPrivateStoreRequestStanza
|
|
189
|
-
// already hydrates redux (clamped + forward-only); do not
|
|
190
|
-
// also apply the raw return value here.
|
|
191
170
|
const roomTimestampObject = await client.getChatsPrivateStoreRequestStanza();
|
|
192
171
|
console.log('Got chats private store for existing client', roomTimestampObject?.length || 0);
|
|
172
|
+
if (roomTimestampObject) {
|
|
173
|
+
(0, _updatedChatLastTimestamps.updatedChatLastTimestamps)(roomTimestampObject, dispatch);
|
|
174
|
+
}
|
|
193
175
|
if (!hasSyncedHistoryRef.current) {
|
|
194
176
|
console.log('Updating messages till last for existing client');
|
|
195
177
|
await (0, _updateMessagesTillLast.updateMessagesTillLast)(rooms, client);
|
|
@@ -204,7 +186,7 @@ const useChatWrapperInit = ({
|
|
|
204
186
|
setConnectionLost(false);
|
|
205
187
|
}
|
|
206
188
|
{
|
|
207
|
-
config?.refreshTokens?.enabled && (0,
|
|
189
|
+
config?.refreshTokens?.enabled && (0, _apiClient.refresh)();
|
|
208
190
|
}
|
|
209
191
|
}
|
|
210
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_xmppProvider","_chatAutoEnterer","_initRoomsPresence","_updateMessagesTillLast","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_resolveLangSource","_xmppProvider","_chatAutoEnterer","_initRoomsPresence","_updatedChatLastTimestamps","_updateMessagesTillLast","_apiClient","_chatSettingsSlice","_roomsSlice","_useRoomState","_useChatSettingState","_isChatIdPresentInArray","_useGetNewArchRoom","_interopRequireDefault","_getRoomsWithRetry","e","__esModule","default","useChatWrapperInit","roomJID","wasAutoSelected","config","dispatch","useDispatch","inited","setInited","useState","showModal","setShowModal","isConnectionLost","setConnectionLost","isRetrying","setIsRetrying","hasSyncedHistoryRef","useRef","client","initializeClient","setClient","useXmppClient","syncRooms","useGetNewArchRoom","rooms","useSelector","state","roomsList","useRoomState","user","useChatSettingState","useEffect","xmppPassword","console","log","close","getRoomsWithRertyRequest","retryRooms","getRoomsWithRetry","loadRooms","disableLoad","setIsLoading","loading","loadingText","undefined","retryTimeout","initXmmpClient","legacyLangSource","resolveLegacyTranslatesLangSource","translates","setLangSource","setConfig","xmppUsername","error","chatAutoEnterer","newClient","defaultWallet","walletAddress","xmppSettings","status","Object","keys","length","initRoomsPresence","newArch","loadedRooms","enableRoomsRetry","enabled","isSelectedRoomPresent","isChatIdPresentInArray","getRoomsStanza","roomTimestampObject","getChatsPrivateStoreRequestStanza","updatedChatLastTimestamps","current","updateMessagesTillLast","err","warn","refreshTokens","refresh","setTimeout","clearTimeout","_default","exports"],"sourceRoot":"../../../src","sources":["hooks/useChatWrapperInit.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,0BAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,oBAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAb,OAAA;AACA,IAAAc,kBAAA,GAAAC,sBAAA,CAAAf,OAAA;AACA,IAAAgB,kBAAA,GAAAhB,OAAA;AAAiE,SAAAe,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApBjE;;AAuCA,MAAMG,kBAAkB,GAAGA,CAAC;EAC1BC,OAAO;EACPC,eAAe;EACfC;AACuB,CAAC,KAA+B;EACvD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAc,CAAC;EAC3C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAU,KAAK,CAAC;EACpD,M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cAAc,EAAEA,KAAK,CAAC;QACpC1C,YAAY,CAAC,KAAK,CAAC;QACnBE,iBAAiB,CAAC,IAAI,CAAC;QACvBL,SAAS,CAAC,KAAK,CAAC;QAChBH,QAAQ,CAAC,IAAAoC,wBAAY,EAAC;UAAEC,OAAO,EAAE;QAAM,CAAC,CAAC,CAAC;QAC1CG,YAAY,GAAGmC,UAAU,CAAClC,cAAc,EAAE,IAAI,CAAC;MACjD;IACF,CAAC;IAEDA,cAAc,CAAC,CAAC;IAEhB,OAAO,MAAM;MACXmC,YAAY,CAACpC,YAAY,CAAC;IAC5B,CAAC;EACH,CAAC,EAAE,CAAChB,IAAI,CAACG,YAAY,EAAEH,IAAI,CAACuB,YAAY,CAAC,CAAC;EAE1C,OAAO;IACLlC,MAAM;IACNX,MAAM;IACNO,UAAU;IACVJ,SAAS;IACTE,gBAAgB;IAChBQ,SAAS,EAAEA,SAAgB;IAC3BZ,SAAS;IACTG;EACF,CAAC;AACH,CAAC;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAEaC,kBAAkB","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
8
|
var _xmppProvider = require("../context/xmppProvider");
|
|
10
9
|
var _reactRedux = require("react-redux");
|
|
11
10
|
var _useChatSettingState = require("./useChatSettingState");
|
|
@@ -19,15 +18,7 @@ const useComposing = config => {
|
|
|
19
18
|
const {
|
|
20
19
|
user
|
|
21
20
|
} = (0, _useChatSettingState.useChatSettingState)();
|
|
22
|
-
// RN keeps a focused TextInput focused when the app is backgrounded or
|
|
23
|
-
// the device is locked — nothing fires `onBlur`, so without this the
|
|
24
|
-
// other participant sees "typing…" for as long as the user is away.
|
|
25
|
-
// Tracks whether the input is *currently* focused, independent of the
|
|
26
|
-
// foreground/background transition, so we know whether to resume
|
|
27
|
-
// composing on return.
|
|
28
|
-
const isFocusedRef = (0, _react.useRef)(false);
|
|
29
21
|
const sendStartComposing = (0, _react.useCallback)(() => {
|
|
30
|
-
isFocusedRef.current = true;
|
|
31
22
|
if (config?.disableTypingIndicator) {
|
|
32
23
|
return;
|
|
33
24
|
}
|
|
@@ -36,7 +27,6 @@ const useComposing = config => {
|
|
|
36
27
|
}
|
|
37
28
|
}, [activeRoomJID, client, config?.disableTypingIndicator, user.firstName, user.lastName]);
|
|
38
29
|
const sendEndComposing = (0, _react.useCallback)(() => {
|
|
39
|
-
isFocusedRef.current = false;
|
|
40
30
|
if (config?.disableTypingIndicator) {
|
|
41
31
|
return;
|
|
42
32
|
}
|
|
@@ -50,23 +40,6 @@ const useComposing = config => {
|
|
|
50
40
|
}, 100);
|
|
51
41
|
return () => clearTimeout(timerId);
|
|
52
42
|
}, [sendEndComposing]);
|
|
53
|
-
|
|
54
|
-
// Foreground/background transition only — a pause in typing must NOT
|
|
55
|
-
// clear the indicator (that would flicker for a slowly-composing user),
|
|
56
|
-
// so this deliberately does not hook keystroke/idle timing at all.
|
|
57
|
-
(0, _react.useEffect)(() => {
|
|
58
|
-
const handleAppStateChange = nextState => {
|
|
59
|
-
if (nextState !== 'active') {
|
|
60
|
-
if (isFocusedRef.current && !config?.disableTypingIndicator && client) {
|
|
61
|
-
client.sendTypingRequestStanza(activeRoomJID || '', `${user.firstName} ${user.lastName}`, false);
|
|
62
|
-
}
|
|
63
|
-
} else if (isFocusedRef.current && !config?.disableTypingIndicator && client) {
|
|
64
|
-
client.sendTypingRequestStanza(activeRoomJID || '', `${user.firstName} ${user.lastName}`, true);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const subscription = _reactNative.AppState.addEventListener('change', handleAppStateChange);
|
|
68
|
-
return () => subscription.remove();
|
|
69
|
-
}, [activeRoomJID, client, config?.disableTypingIndicator, user.firstName, user.lastName]);
|
|
70
43
|
return {
|
|
71
44
|
sendStartComposing,
|
|
72
45
|
sendEndComposing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_xmppProvider","_reactRedux","_useChatSettingState","useComposing","config","client","useXmppClient","activeRoomJID","useSelector","state","rooms","user","useChatSettingState","sendStartComposing","useCallback","disableTypingIndicator","sendTypingRequestStanza","firstName","lastName","sendEndComposing","useEffect","timerId","setTimeout","clearTimeout","_default","exports","default"],"sourceRoot":"../../../src","sources":["hooks/useComposing.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,oBAAA,GAAAH,OAAA;AAGA,MAAMI,YAAY,GAAIC,MAAgB,IAAK;EACzC,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,2BAAa,EAAC,CAAC;EAClC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACC,KAAK,CAAC;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EAEtC,MAAMC,kBAAkB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC3C,IAAIV,MAAM,EAAEW,sBAAsB,EAAE;MAClC;IACF;IACA,IAAIV,MAAM,EAAE;MACVA,MAAM,CAACW,uBAAuB,CAC5BT,aAAa,IAAI,EAAE,EACnB,GAAGI,IAAI,CAACM,SAAS,IAAIN,IAAI,CAACO,QAAQ,EAAE,EACpC,IACF,CAAC;IACH;EACF,CAAC,EAAE,CAACX,aAAa,EAAEF,MAAM,EAAED,MAAM,EAAEW,sBAAsB,EAAEJ,IAAI,CAACM,SAAS,EAAEN,IAAI,CAACO,QAAQ,CAAC,CAAC;EAE1F,MAAMC,gBAAgB,GAAG,IAAAL,kBAAW,EAAC,MAAM;IACzC,IAAIV,MAAM,EAAEW,sBAAsB,EAAE;MAClC;IACF;IACA,IAAIV,MAAM,EAAE;MACVA,MAAM,CAACW,uBAAuB,CAC5BT,aAAa,IAAI,EAAE,EACnB,GAAGI,IAAI,CAACM,SAAS,IAAIN,IAAI,CAACO,QAAQ,EAAE,EACpC,KACF,CAAC;IACH;EACF,CAAC,EAAE,CAACX,aAAa,EAAEF,MAAM,EAAED,MAAM,EAAEW,sBAAsB,EAAEJ,IAAI,CAACM,SAAS,EAAEN,IAAI,CAACO,QAAQ,CAAC,CAAC;EAE1F,IAAAE,gBAAS,EAAC,MAAM;IACd,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAM;MAC/BH,gBAAgB,CAAC,CAAC;IACpB,CAAC,EAAE,GAAG,CAAC;IAEP,OAAO,MAAMI,YAAY,CAACF,OAAO,CAAC;EACpC,CAAC,EAAE,CAACF,gBAAgB,CAAC,CAAC;EAEtB,OAAO;IAAEN,kBAAkB;IAAEM;EAAiB,CAAC;AACjD,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavB,YAAY","ignoreList":[]}
|
|
@@ -15,8 +15,7 @@ var _roomHeapSlice = require("../roomStore/roomHeapSlice");
|
|
|
15
15
|
var _pushSubscriptionService = require("../services/pushSubscriptionService");
|
|
16
16
|
var _rooms = require("../networking/api-requests/rooms.api");
|
|
17
17
|
var _persistence = require("../roomStore/persistence");
|
|
18
|
-
var
|
|
19
|
-
var _getServerReadTimestamp = require("../helpers/getServerReadTimestamp");
|
|
18
|
+
var _LOCAL_STORAGE = require("../helpers/constants/LOCAL_STORAGE");
|
|
20
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
20
|
// AsyncStorage keys the library writes but that aren't cleared by any
|
|
22
21
|
// slice reducer. Listed here so a single logout call wipes the full
|
|
@@ -64,16 +63,9 @@ const logoutService = exports.logoutService = {
|
|
|
64
63
|
const client = state.chatSettingStore?.client;
|
|
65
64
|
const rooms = state.rooms?.rooms;
|
|
66
65
|
const visibleRoomJID = state.rooms?.visibleRoomJID || null;
|
|
67
|
-
// The visible room is exempt from `onlyIfNoUnread`'s skip (it's
|
|
68
|
-
// meant to write "read up to now" for whatever's open), so if the
|
|
69
|
-
// user is logging out while scrolled up with unread messages
|
|
70
|
-
// above, the boundary must still be carried through here - same
|
|
71
|
-
// reasoning as every other "leaving a room" path (bug #42).
|
|
72
|
-
const boundaryTs = visibleRoomJID ? (0, _getServerReadTimestamp.getFlushBoundaryTs)(rooms?.[visibleRoomJID], state.roomHeapSlice, state.rooms?.readBoundaries?.[visibleRoomJID] ?? null) : undefined;
|
|
73
66
|
if (client?.flushLastViewedToPrivateStoreStanza) {
|
|
74
67
|
await Promise.race([client.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
75
68
|
visibleRoomJID,
|
|
76
|
-
visibleRoomTs: boundaryTs,
|
|
77
69
|
onlyIfNoUnread: true
|
|
78
70
|
}), new Promise(res => setTimeout(res, 2000))]);
|
|
79
71
|
}
|
|
@@ -129,23 +121,15 @@ const logoutService = exports.logoutService = {
|
|
|
129
121
|
|
|
130
122
|
// 6. Stray keys the slices don't touch.
|
|
131
123
|
try {
|
|
132
|
-
await _asyncStorage.default.multiRemove(LIBRARY_STRAY_KEYS
|
|
124
|
+
await _asyncStorage.default.multiRemove([...LIBRARY_STRAY_KEYS,
|
|
125
|
+
// Belt-and-suspenders: the chat slice's `logout` reducer
|
|
126
|
+
// schedules an async remove of ETHORA_USER fire-and-forget;
|
|
127
|
+
// re-issue it here so the disk is provably clean before this
|
|
128
|
+
// Promise resolves.
|
|
129
|
+
_LOCAL_STORAGE.localStorageConstants.ETHORA_USER]);
|
|
133
130
|
} catch (e) {
|
|
134
131
|
console.warn('logoutService: stray-key clear failed', e);
|
|
135
132
|
}
|
|
136
|
-
|
|
137
|
-
// 7. Belt-and-suspenders: the chat slice's `logout` reducer already
|
|
138
|
-
// fires an async ETHORA_USER removal, but re-issue it here (via
|
|
139
|
-
// the same secureUserStorage split the reducer uses) so BOTH the
|
|
140
|
-
// plain-AsyncStorage profile half AND the Keychain/Keystore
|
|
141
|
-
// secrets are provably gone before this Promise resolves — a bare
|
|
142
|
-
// `AsyncStorage.removeItem(ETHORA_USER)` here would only clear the
|
|
143
|
-
// profile half and leave the tokens behind.
|
|
144
|
-
try {
|
|
145
|
-
await (0, _secureUserStorage.secureUserStorage)().remove();
|
|
146
|
-
} catch (e) {
|
|
147
|
-
console.warn('logoutService: secure user storage clear failed', e);
|
|
148
|
-
}
|
|
149
133
|
}
|
|
150
134
|
};
|
|
151
135
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactRedux","require","_reactNative","_asyncStorage","_interopRequireDefault","_roomStore","_chatSettingsSlice","_roomsSlice","_react","_roomHeapSlice","_pushSubscriptionService","_rooms","_persistence","
|
|
1
|
+
{"version":3,"names":["_reactRedux","require","_reactNative","_asyncStorage","_interopRequireDefault","_roomStore","_chatSettingsSlice","_roomsSlice","_react","_roomHeapSlice","_pushSubscriptionService","_rooms","_persistence","_LOCAL_STORAGE","e","__esModule","default","LIBRARY_STRAY_KEYS","logoutService","exports","performLogout","state","store","getState","client","chatSettingStore","rooms","visibleRoomJID","flushLastViewedToPrivateStoreStanza","Promise","race","onlyIfNoUnread","res","setTimeout","console","warn","DeviceEventEmitter","emit","pushSubscriptionService","reset","clearRoomsRestCache","dispatch","setLogoutState","clearHeap","logout","clearPersistedState","AsyncStorage","multiRemove","localStorageConstants","ETHORA_USER","useLogout","useDispatch","useCallback","err"],"sourceRoot":"../../../src","sources":["hooks/useLogout.tsx"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,cA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GA,CAAA,KAA6B;EACpD;EACA;EACA;EACA,IAAAC,uBAAW,EAAC,CAAC;EAEb,OAAO,IAAAC,kBAAW,EAAC,YAAY;IAC7B,IAAI;MACF,MAAMlC,aAAa,CAACE,aAAa,CAAC,CAAC;IACrC,CAAC,CAAC,OAAOiC,GAAG,EAAE;MACZnB,OAAO,CAACC,IAAI,CAAC,iCAAiC,EAAEkB,GAAG,CAAC;IACtD;EACF,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAClC,OAAA,CAAA+B,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -8,9 +8,8 @@ exports.usePendingNotification = usePendingNotification;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactRedux = require("react-redux");
|
|
10
10
|
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
11
|
-
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
12
|
-
var _pushPayload = require("../helpers/pushPayload");
|
|
13
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const PENDING_NOTIFICATION_JID_KEY = 'ethora_pending_notification_jid';
|
|
14
13
|
function usePendingNotification() {
|
|
15
14
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
16
15
|
const rooms = (0, _reactRedux.useSelector)(state => state.rooms.rooms);
|
|
@@ -23,16 +22,20 @@ function usePendingNotification() {
|
|
|
23
22
|
}
|
|
24
23
|
let jidToOpen = pendingNotificationJid;
|
|
25
24
|
if (!jidToOpen) {
|
|
26
|
-
|
|
25
|
+
try {
|
|
26
|
+
const storedJid = await _asyncStorage.default.getItem(PENDING_NOTIFICATION_JID_KEY);
|
|
27
|
+
if (storedJid) {
|
|
28
|
+
jidToOpen = storedJid;
|
|
29
|
+
await _asyncStorage.default.removeItem(PENDING_NOTIFICATION_JID_KEY);
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Error reading from AsyncStorage:', error);
|
|
33
|
+
}
|
|
27
34
|
}
|
|
28
35
|
if (jidToOpen) {
|
|
29
36
|
const room = rooms[jidToOpen];
|
|
30
37
|
if (room) {
|
|
31
|
-
|
|
32
|
-
_asyncStorage.default.removeItem(_pushPayload.PENDING_NOTIFICATION_JID_KEY).catch(() => undefined);
|
|
33
|
-
dispatch((0, _roomsSlice.setCurrentRoom)({
|
|
34
|
-
roomJID: jidToOpen
|
|
35
|
-
}));
|
|
38
|
+
return;
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_asyncStorage","_interopRequireDefault","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_asyncStorage","_interopRequireDefault","e","__esModule","default","PENDING_NOTIFICATION_JID_KEY","usePendingNotification","dispatch","useDispatch","rooms","useSelector","state","pendingNotificationJid","isLoading","useEffect","checkPendingNotification","jidToOpen","storedJid","AsyncStorage","getItem","removeItem","error","console","room","_default","exports"],"sourceRoot":"../../../src","sources":["hooks/usePendingNotification.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAqE,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIrE,MAAMG,4BAA4B,GAAG,iCAAiC;AAE/D,SAASC,sBAAsBA,CAAA,EAAG;EACvC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMC,KAAK,GAAG,IAAAC,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACA,KAAK,CAAC;EAClE,MAAMG,sBAAsB,GAAG,IAAAF,uBAAW,EACvCC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACG,sBACpC,CAAC;EACD,MAAMC,SAAS,GAAG,IAAAH,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACI,SAAS,CAAC;EAE1E,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,wBAAwB,GAAG,MAAAA,CAAA,KAAY;MAC3C,IAAIF,SAAS,EAAE;QAAC;MAAO;MAEvB,IAAIG,SAAS,GAAGJ,sBAAsB;MAEtC,IAAI,CAACI,SAAS,EAAE;QACd,IAAI;UACF,MAAMC,SAAS,GAAG,MAAMC,qBAAY,CAACC,OAAO,CAACd,4BAA4B,CAAC;UAC1E,IAAIY,SAAS,EAAE;YACbD,SAAS,GAAGC,SAAS;YACrB,MAAMC,qBAAY,CAACE,UAAU,CAACf,4BAA4B,CAAC;UAC7D;QACF,CAAC,CAAC,OAAOgB,KAAK,EAAE;UACdC,OAAO,CAACD,KAAK,CAAC,kCAAkC,EAAEA,KAAK,CAAC;QAC1D;MACF;MAEA,IAAIL,SAAS,EAAE;QACb,MAAMO,IAAI,GAAGd,KAAK,CAACO,SAAS,CAAC;QAC7B,IAAIO,IAAI,EAAE;UACR;QACF;MACF;IACF,CAAC;IAEDR,wBAAwB,CAAC,CAAC;EAC5B,CAAC,EAAE,CAACN,KAAK,EAAEG,sBAAsB,EAAEC,SAAS,EAAEN,QAAQ,CAAC,CAAC;EAExD,OAAO;IAAEK;EAAuB,CAAC;AACnC;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEcE,sBAAsB","ignoreList":[]}
|
|
@@ -157,38 +157,13 @@ const useSendMessage = _configOverride => {
|
|
|
157
157
|
// PENDING_WATCHDOG_MS, flip the bubble to "failed → tap to
|
|
158
158
|
// retry". We check at fire-time whether the message is still
|
|
159
159
|
// pending and not already marked failed by the catch path.
|
|
160
|
-
|
|
161
|
-
// timer so the rescheduled run can't extend again.
|
|
162
|
-
let watchdogExtended = false;
|
|
163
|
-
const runWatchdog = () => {
|
|
160
|
+
const watchdogTimer = setTimeout(() => {
|
|
164
161
|
const state = reduxStore.getState();
|
|
165
162
|
const roomMsgs = state.rooms?.rooms?.[activeRoomJID]?.messages || [];
|
|
166
163
|
const stillPending = roomMsgs.find(m => m.id === optimisticId && m.pending);
|
|
167
164
|
const alreadyFailed = state.roomHeapSlice?.failedMessages?.[optimisticId];
|
|
168
|
-
|
|
169
|
-
// Don't call it a failure while the stream is still coming back.
|
|
170
|
-
// A reconnect tears the old client down and builds a new one, and
|
|
171
|
-
// any echo in flight during that window is simply lost — the
|
|
172
|
-
// message may well have been delivered (it has been observed
|
|
173
|
-
// arriving twice on the receiving side). Failing it here shows a
|
|
174
|
-
// red "tap to retry" under a message that actually went through.
|
|
175
|
-
// Give the reconnect one more window to produce an echo, once.
|
|
176
|
-
const streamOnline = (0, _clientRegistry.getGlobalXmppClient)()?.status === 'online';
|
|
177
|
-
if (stillPending && !alreadyFailed && !streamOnline && !watchdogExtended) {
|
|
178
|
-
watchdogExtended = true;
|
|
179
|
-
console.warn(`Send watchdog — ${optimisticId} still pending but the stream is not online; extending one window`);
|
|
180
|
-
watchdogTimer = setTimeout(runWatchdog, PENDING_WATCHDOG_MS);
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
165
|
if (stillPending && !alreadyFailed) {
|
|
184
166
|
console.warn(`Send watchdog fired — message ${optimisticId} stuck pending > ${PENDING_WATCHDOG_MS}ms; marking failed`);
|
|
185
|
-
// Drop the buffered replay now that the bubble is showing
|
|
186
|
-
// "failed / tap to retry" — a later onOnline flush must not
|
|
187
|
-
// silently resend it behind the user's back. If the original
|
|
188
|
-
// send actually lands after this point, the server echo still
|
|
189
|
-
// flips the bubble back to delivered (newMessageMidlleware);
|
|
190
|
-
// only an explicit tap-to-retry should trigger another send.
|
|
191
|
-
(0, _outboundQueue.removeOutboundSend)(optimisticId);
|
|
192
167
|
dispatch((0, _roomHeapSlice.markMessageFailed)({
|
|
193
168
|
kind: 'text',
|
|
194
169
|
id: optimisticId,
|
|
@@ -205,8 +180,7 @@ const useSendMessage = _configOverride => {
|
|
|
205
180
|
messageType: 'text'
|
|
206
181
|
});
|
|
207
182
|
}
|
|
208
|
-
};
|
|
209
|
-
let watchdogTimer = setTimeout(runWatchdog, PENDING_WATCHDOG_MS);
|
|
183
|
+
}, PENDING_WATCHDOG_MS);
|
|
210
184
|
try {
|
|
211
185
|
// The single send closure, used both for the immediate send and for
|
|
212
186
|
// the buffered replay. Passing the optimistic id as the stanza id
|
|
@@ -256,9 +230,6 @@ const useSendMessage = _configOverride => {
|
|
|
256
230
|
});
|
|
257
231
|
} catch (error) {
|
|
258
232
|
clearTimeout(watchdogTimer);
|
|
259
|
-
// Same reasoning as the watchdog: once the bubble shows failed,
|
|
260
|
-
// only an explicit tap-to-retry should resend it.
|
|
261
|
-
(0, _outboundQueue.removeOutboundSend)(optimisticId);
|
|
262
233
|
dispatch((0, _roomHeapSlice.markMessageFailed)({
|
|
263
234
|
kind: 'text',
|
|
264
235
|
id: optimisticId,
|
|
@@ -373,10 +344,6 @@ const useSendMessage = _configOverride => {
|
|
|
373
344
|
const alreadyFailed = state.roomHeapSlice?.failedMessages?.[id];
|
|
374
345
|
if (stillPending && !alreadyFailed) {
|
|
375
346
|
console.warn(`Media-send watchdog fired — ${id} stuck pending > ${PENDING_WATCHDOG_MS}ms; marking failed`);
|
|
376
|
-
// See the text-send watchdog above: drop the buffered replay so
|
|
377
|
-
// a later onOnline flush can't silently resend behind the
|
|
378
|
-
// "failed / tap to retry" bubble.
|
|
379
|
-
(0, _outboundQueue.removeOutboundSend)(id);
|
|
380
347
|
dispatch((0, _roomHeapSlice.markMessageFailed)({
|
|
381
348
|
kind: 'media',
|
|
382
349
|
id,
|
|
@@ -406,11 +373,20 @@ const useSendMessage = _configOverride => {
|
|
|
406
373
|
type: data?.type || data?.mimeType || type || 'application/octet-stream',
|
|
407
374
|
name: data?.name || data?.fileName || `media_${Date.now()}`
|
|
408
375
|
};
|
|
376
|
+
|
|
377
|
+
// Mirror the web client: a single multipart POST to /files/ with
|
|
378
|
+
// the file under the plural "files" field. We send it via fetch
|
|
379
|
+
// (not axios) because RN's fetch sets the multipart boundary on the
|
|
380
|
+
// Content-Type header correctly. The previous axios fallback omitted
|
|
381
|
+
// a valid boundary, so the server mis-parsed one file as many and
|
|
382
|
+
// rejected the request with HTTP 413 "TOO_MANY_FILES". The only
|
|
383
|
+
// retry is the documented singular-"file" fallback for deployments
|
|
384
|
+
// that 500 on the plural field (bug #10).
|
|
409
385
|
const tryUpload = async () => {
|
|
410
386
|
const fd = new FormData();
|
|
411
387
|
fd.append('files', fileBlob);
|
|
412
388
|
try {
|
|
413
|
-
return await (0, _auth.
|
|
389
|
+
return await (0, _auth.uploadFileViaFetch)(fd);
|
|
414
390
|
} catch (err) {
|
|
415
391
|
if (err?.response?.status === 500) {
|
|
416
392
|
console.warn('upload "files" field returned 500 — retrying with "file" (singular)', {
|
|
@@ -419,7 +395,7 @@ const useSendMessage = _configOverride => {
|
|
|
419
395
|
});
|
|
420
396
|
const fd2 = new FormData();
|
|
421
397
|
fd2.append('file', fileBlob);
|
|
422
|
-
return await (0, _auth.
|
|
398
|
+
return await (0, _auth.uploadFileViaFetch)(fd2);
|
|
423
399
|
}
|
|
424
400
|
throw err;
|
|
425
401
|
}
|
|
@@ -558,18 +534,6 @@ const useSendMessage = _configOverride => {
|
|
|
558
534
|
if (!payload) {
|
|
559
535
|
return;
|
|
560
536
|
}
|
|
561
|
-
|
|
562
|
-
// The server may have accepted the original send even though its
|
|
563
|
-
// echo arrived too late to beat the watchdog — the bubble shows
|
|
564
|
-
// failed, but a confirmed (non-pending) copy is already sitting in
|
|
565
|
-
// the room. Resending here would deliver a genuine duplicate; just
|
|
566
|
-
// clear the failure and let the existing copy stand.
|
|
567
|
-
const roomMsgs = rooms?.[payload.roomJID]?.messages || [];
|
|
568
|
-
const alreadyDelivered = roomMsgs.some(m => !m.pending && (m.id === failedId || m.xmppId === failedId));
|
|
569
|
-
if (alreadyDelivered) {
|
|
570
|
-
dispatch((0, _roomHeapSlice.clearMessageFailure)(failedId));
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
537
|
dispatch((0, _roomHeapSlice.clearMessageFailure)(failedId));
|
|
574
538
|
handleMessageRetry({
|
|
575
539
|
messageId: failedId,
|
|
@@ -584,7 +548,7 @@ const useSendMessage = _configOverride => {
|
|
|
584
548
|
} else {
|
|
585
549
|
await sendMedia(payload.data, payload.type, payload.roomJID, payload.isReply, payload.isChecked, payload.mainMessage, failedId);
|
|
586
550
|
}
|
|
587
|
-
}, [failedMessages,
|
|
551
|
+
}, [failedMessages, dispatch, handleMessageRetry, sendMessage, sendMedia]);
|
|
588
552
|
|
|
589
553
|
// ChatRoom/ThreadWrapper consume this as the "edit branch" of send.
|
|
590
554
|
// It mirrors the edit path inside `sendMessage` so callers can wire it
|