@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
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
2
|
import { Middleware } from '@reduxjs/toolkit';
|
|
3
3
|
import { IMessage, IRoom, User } from '../types/types';
|
|
4
|
-
import { encryptForPersist, decryptFromPersist } from '../helpers/persistCrypto';
|
|
5
|
-
import type { FailedMessagePayload } from './roomHeapSlice';
|
|
6
4
|
|
|
7
5
|
// -------------------------------------------------------------------
|
|
8
6
|
// Lightweight RN persistence layer. Mirrors what redux-persist gives
|
|
@@ -13,33 +11,17 @@ import type { FailedMessagePayload } from './roomHeapSlice';
|
|
|
13
11
|
// - cap each room's messages to the most recent MESSAGE_LIMIT (100)
|
|
14
12
|
// - debounced writes (200ms) on relevant action types
|
|
15
13
|
//
|
|
16
|
-
//
|
|
17
|
-
// under each key below is encrypted before it reaches AsyncStorage, with
|
|
18
|
-
// the symmetric key held in the platform Keychain/Keystore. `user` here
|
|
19
|
-
// is already secret-free (see `sanitizeUser`) — the encryption is for
|
|
20
|
-
// the message bodies in `rooms`, which aren't.
|
|
14
|
+
// Not encrypted. We rely on AsyncStorage's per-app sandbox.
|
|
21
15
|
// -------------------------------------------------------------------
|
|
22
16
|
|
|
23
17
|
const KEY_CHAT = '@ethora/persist:chatSettingStore';
|
|
24
18
|
const KEY_ROOMS = '@ethora/persist:rooms';
|
|
25
|
-
// bug #39: a failed send needs to survive a relaunch as "failed / tap
|
|
26
|
-
// to retry", not silently render as delivered. `roomHeapStore.failedMessages`
|
|
27
|
-
// is the map the bubble reads (`isFailed = failedMessages[id]`, see
|
|
28
|
-
// Message.tsx / useMessageHeapState): it lives in a separate, previously
|
|
29
|
-
// non-persisted slice from `rooms`, so it gets its own key here.
|
|
30
|
-
const KEY_HEAP = '@ethora/persist:roomHeap';
|
|
31
19
|
|
|
32
20
|
// Per-room message cap on disk. Mirror this value in `roomsSlice`'s
|
|
33
21
|
// in-memory cap (see `enforceMessageCap`) so the runtime and persisted
|
|
34
22
|
// shapes stay aligned.
|
|
35
23
|
export const MESSAGE_LIMIT = 100;
|
|
36
24
|
|
|
37
|
-
// Defensive cap on the number of failed-message payloads written to
|
|
38
|
-
// disk. In practice this map only grows while the user is actively
|
|
39
|
-
// sending offline, but a runaway sender (or a bug that never clears an
|
|
40
|
-
// entry) must not turn this key into an unbounded write.
|
|
41
|
-
export const MAX_PERSISTED_FAILED_MESSAGES = 200;
|
|
42
|
-
|
|
43
25
|
interface PersistedChatState {
|
|
44
26
|
user: User;
|
|
45
27
|
}
|
|
@@ -49,14 +31,6 @@ interface PersistedRoomsState {
|
|
|
49
31
|
// intentionally NOT persisted: activeRoomJID, editAction, isLoading
|
|
50
32
|
}
|
|
51
33
|
|
|
52
|
-
interface PersistedHeapState {
|
|
53
|
-
failedMessages: Record<string, FailedMessagePayload>;
|
|
54
|
-
// intentionally NOT persisted: messageHeap, a process-lifetime
|
|
55
|
-
// "in flight" buffer (see roomHeapSlice.ts); anything still in it when
|
|
56
|
-
// the app dies is handled by the boot-time pending->failed scan below,
|
|
57
|
-
// not by replaying the heap itself.
|
|
58
|
-
}
|
|
59
|
-
|
|
60
34
|
const sanitizeUser = (user?: User): User | null => {
|
|
61
35
|
if (!user) {return null;}
|
|
62
36
|
// Drop secrets we don't want at rest — destructure to omit, then
|
|
@@ -101,14 +75,23 @@ const PERSISTED_MESSAGE_FIELDS: (keyof IMessage)[] = [
|
|
|
101
75
|
'originalName',
|
|
102
76
|
'size',
|
|
103
77
|
'langSource',
|
|
78
|
+
// `translations` MUST be here. A previous version of this list dropped
|
|
79
|
+
// it, on the theory that it mirrored the web SDK's persist contract —
|
|
80
|
+
// it doesn't: web's redux-persist config (web/src/roomStore/index.ts)
|
|
81
|
+
// has no per-field message whitelist at all, it persists whatever is in
|
|
82
|
+
// `room.messages` (capped to the last 50) and that includes
|
|
83
|
+
// `translations` verbatim. Field-picking is an RN-only mechanism, so
|
|
84
|
+
// "same as web" was never true for this key.
|
|
85
|
+
//
|
|
86
|
+
// Dropping it meant every cold start painted the cached transcript in
|
|
87
|
+
// the ORIGINAL language and only flipped to the translation once MAM
|
|
88
|
+
// re-sent the history a few seconds later (onMessageHistory re-parses
|
|
89
|
+
// <translations> off the wire) — visible on every launch, for every
|
|
90
|
+
// translated message, since the cache never had a translation to show
|
|
91
|
+
// in the first place. Persisting it here is what lets the very first
|
|
92
|
+
// paint already be translated, the way the live path already is.
|
|
93
|
+
'translations',
|
|
104
94
|
'callLog',
|
|
105
|
-
// bug #39: without this, a message that was still in flight (no
|
|
106
|
-
// server echo yet) at kill time comes back from disk indistinguishable
|
|
107
|
-
// from a normal delivered message, so the bubble renders it as sent.
|
|
108
|
-
// Persisting `pending` lets the boot-time scan (see
|
|
109
|
-
// computeBootTimeFailures below) find exactly the messages that never
|
|
110
|
-
// got confirmed and flip them to failed instead.
|
|
111
|
-
'pending',
|
|
112
95
|
];
|
|
113
96
|
|
|
114
97
|
// The sender identity that rides along on every message over the wire
|
|
@@ -208,154 +191,6 @@ const sanitizeRooms = (
|
|
|
208
191
|
return out;
|
|
209
192
|
};
|
|
210
193
|
|
|
211
|
-
// Only the fields retryMessage actually needs to replay the send (see
|
|
212
|
-
// FailedMessagePayload / useSendMessage.retryMessage). In particular, the
|
|
213
|
-
// media `data` blob is trimmed to `uri/type/name/size` (the picker never
|
|
214
|
-
// hands us auth material, but this stays defensive against a future
|
|
215
|
-
// picker change smuggling extra fields, or a huge inline payload, into
|
|
216
|
-
// `data`).
|
|
217
|
-
const sanitizeMediaData = (
|
|
218
|
-
data: any
|
|
219
|
-
): { uri?: string; type?: string; name?: string; size?: number } => {
|
|
220
|
-
if (!data || typeof data !== 'object') {return {};}
|
|
221
|
-
const out: { uri?: string; type?: string; name?: string; size?: number } = {};
|
|
222
|
-
if (typeof data.uri === 'string') {out.uri = data.uri;}
|
|
223
|
-
if (typeof data.type === 'string') {out.type = data.type;}
|
|
224
|
-
if (typeof data.name === 'string') {out.name = data.name;}
|
|
225
|
-
if (typeof data.size === 'number') {out.size = data.size;}
|
|
226
|
-
return out;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const sanitizeFailedMessagePayload = (
|
|
230
|
-
payload: FailedMessagePayload
|
|
231
|
-
): FailedMessagePayload | null => {
|
|
232
|
-
if (!payload || typeof payload !== 'object') {return null;}
|
|
233
|
-
if (!payload.id || typeof payload.id !== 'string') {return null;}
|
|
234
|
-
if (!payload.roomJID || typeof payload.roomJID !== 'string') {return null;}
|
|
235
|
-
if (payload.kind === 'media') {
|
|
236
|
-
return {
|
|
237
|
-
kind: 'media',
|
|
238
|
-
id: payload.id,
|
|
239
|
-
roomJID: payload.roomJID,
|
|
240
|
-
data: sanitizeMediaData(payload.data),
|
|
241
|
-
type: typeof payload.type === 'string' ? payload.type : '',
|
|
242
|
-
isReply: payload.isReply,
|
|
243
|
-
isChecked: payload.isChecked,
|
|
244
|
-
mainMessage: payload.mainMessage,
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
if (payload.kind === 'text') {
|
|
248
|
-
return {
|
|
249
|
-
kind: 'text',
|
|
250
|
-
id: payload.id,
|
|
251
|
-
roomJID: payload.roomJID,
|
|
252
|
-
body: typeof payload.body === 'string' ? payload.body : '',
|
|
253
|
-
isReply: payload.isReply,
|
|
254
|
-
isChecked: payload.isChecked,
|
|
255
|
-
mainMessage: payload.mainMessage,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
return null;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
const sanitizeFailedMessages = (
|
|
262
|
-
failedMessages: Record<string, FailedMessagePayload> | undefined
|
|
263
|
-
): Record<string, FailedMessagePayload> => {
|
|
264
|
-
if (!failedMessages || typeof failedMessages !== 'object') {return {};}
|
|
265
|
-
const out: Record<string, FailedMessagePayload> = {};
|
|
266
|
-
let count = 0;
|
|
267
|
-
for (const [id, payload] of Object.entries(failedMessages)) {
|
|
268
|
-
if (count >= MAX_PERSISTED_FAILED_MESSAGES) {break;}
|
|
269
|
-
const clean = sanitizeFailedMessagePayload(payload);
|
|
270
|
-
if (clean) {
|
|
271
|
-
out[id] = clean;
|
|
272
|
-
count++;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return out;
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// -------------------------------------------------------------------
|
|
279
|
-
// Boot-time pending -> failed conversion (bug #39).
|
|
280
|
-
//
|
|
281
|
-
// `messageHeap` (the "still sending" buffer) is intentionally NOT
|
|
282
|
-
// persisted: it's a process-lifetime thing. That means on a cold start
|
|
283
|
-
// there is no such thing as "still sending": a persisted message that
|
|
284
|
-
// carries `pending: true` never got a server echo NOR got the chance to
|
|
285
|
-
// trip the in-session watchdog (see PENDING_WATCHDOG_MS in
|
|
286
|
-
// useSendMessage.tsx) before the process died. It must render as failed
|
|
287
|
-
// with a working retry, not as delivered and not as stuck "sending...".
|
|
288
|
-
//
|
|
289
|
-
// Reconstructs the same FailedMessagePayload shape the live send path
|
|
290
|
-
// builds in useSendMessage (markMessageFailed calls), from the fields we
|
|
291
|
-
// persist per message.
|
|
292
|
-
// -------------------------------------------------------------------
|
|
293
|
-
|
|
294
|
-
export function reconstructFailedMessagePayload(
|
|
295
|
-
message: IMessage,
|
|
296
|
-
roomJID: string
|
|
297
|
-
): FailedMessagePayload | null {
|
|
298
|
-
if (!message?.id || !roomJID) {return null;}
|
|
299
|
-
const isReply = !!message.isReply;
|
|
300
|
-
const isChecked = message.showInChannel === 'true';
|
|
301
|
-
const mainMessage = message.mainMessage;
|
|
302
|
-
if (message.isMediafile === 'true') {
|
|
303
|
-
return {
|
|
304
|
-
kind: 'media',
|
|
305
|
-
id: message.id,
|
|
306
|
-
roomJID,
|
|
307
|
-
data: sanitizeMediaData({
|
|
308
|
-
uri: message.location,
|
|
309
|
-
name: message.fileName,
|
|
310
|
-
type: message.mimetype,
|
|
311
|
-
size:
|
|
312
|
-
message.size !== undefined && message.size !== null
|
|
313
|
-
? Number(message.size)
|
|
314
|
-
: undefined,
|
|
315
|
-
}),
|
|
316
|
-
type: message.mimetype || '',
|
|
317
|
-
isReply,
|
|
318
|
-
isChecked,
|
|
319
|
-
mainMessage,
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
return {
|
|
323
|
-
kind: 'text',
|
|
324
|
-
id: message.id,
|
|
325
|
-
roomJID,
|
|
326
|
-
body: message.body || '',
|
|
327
|
-
isReply,
|
|
328
|
-
isChecked,
|
|
329
|
-
mainMessage,
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Scan every persisted room for messages still `pending: true` that
|
|
335
|
-
* DON'T already have a restored failure entry (those are handled by the
|
|
336
|
-
* caller separately, from the persisted `failedMessages` map), and
|
|
337
|
-
* synthesize a retry-able FailedMessagePayload for each. Pure function:
|
|
338
|
-
* the caller (roomStore/index.ts) is responsible for dispatching
|
|
339
|
-
* `markMessageFailed` for the results.
|
|
340
|
-
*/
|
|
341
|
-
export function computeBootTimeFailures(
|
|
342
|
-
rooms: Record<string, IRoom> | null | undefined,
|
|
343
|
-
alreadyFailed: Record<string, FailedMessagePayload> | null | undefined
|
|
344
|
-
): FailedMessagePayload[] {
|
|
345
|
-
if (!rooms || typeof rooms !== 'object') {return [];}
|
|
346
|
-
const out: FailedMessagePayload[] = [];
|
|
347
|
-
for (const [jid, room] of Object.entries(rooms)) {
|
|
348
|
-
const messages = Array.isArray(room?.messages) ? room.messages : [];
|
|
349
|
-
for (const message of messages) {
|
|
350
|
-
if (!message || !message.pending) {continue;}
|
|
351
|
-
if (alreadyFailed && alreadyFailed[message.id]) {continue;}
|
|
352
|
-
const payload = reconstructFailedMessagePayload(message, jid);
|
|
353
|
-
if (payload) {out.push(payload);}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return out;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
194
|
let writeTimer: ReturnType<typeof setTimeout> | null = null;
|
|
360
195
|
|
|
361
196
|
/**
|
|
@@ -370,7 +205,6 @@ export const persistenceMiddleware: Middleware = (storeAPI) => (next) => (
|
|
|
370
205
|
const type: string = action?.type || '';
|
|
371
206
|
if (
|
|
372
207
|
!type.startsWith('roomMessages/') &&
|
|
373
|
-
!type.startsWith('roomHeapStore/') &&
|
|
374
208
|
!type.startsWith('chat/setUser') &&
|
|
375
209
|
!type.startsWith('chat/updateUser') &&
|
|
376
210
|
!type.startsWith('chat/refreshTokens') &&
|
|
@@ -381,34 +215,21 @@ export const persistenceMiddleware: Middleware = (storeAPI) => (next) => (
|
|
|
381
215
|
|
|
382
216
|
if (writeTimer) {clearTimeout(writeTimer);}
|
|
383
217
|
writeTimer = setTimeout(() => {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
encryptForPersist(JSON.stringify(chatPayload)),
|
|
400
|
-
encryptForPersist(JSON.stringify(roomsPayload)),
|
|
401
|
-
encryptForPersist(JSON.stringify(heapPayload)),
|
|
402
|
-
]);
|
|
403
|
-
await AsyncStorage.multiSet([
|
|
404
|
-
[KEY_CHAT, chatCipher],
|
|
405
|
-
[KEY_ROOMS, roomsCipher],
|
|
406
|
-
[KEY_HEAP, heapCipher],
|
|
407
|
-
]);
|
|
408
|
-
} catch (e) {
|
|
409
|
-
console.warn('persist write failed', e);
|
|
410
|
-
}
|
|
411
|
-
})();
|
|
218
|
+
try {
|
|
219
|
+
const state = storeAPI.getState();
|
|
220
|
+
const chatPayload: PersistedChatState = {
|
|
221
|
+
user: sanitizeUser(state.chatSettingStore?.user) as User,
|
|
222
|
+
};
|
|
223
|
+
const roomsPayload: PersistedRoomsState = {
|
|
224
|
+
rooms: sanitizeRooms(state.rooms?.rooms || {}),
|
|
225
|
+
};
|
|
226
|
+
AsyncStorage.multiSet([
|
|
227
|
+
[KEY_CHAT, JSON.stringify(chatPayload)],
|
|
228
|
+
[KEY_ROOMS, JSON.stringify(roomsPayload)],
|
|
229
|
+
]).catch((e) => console.warn('persist write failed', e));
|
|
230
|
+
} catch (e) {
|
|
231
|
+
console.warn('persist serialize failed', e);
|
|
232
|
+
}
|
|
412
233
|
}, 200);
|
|
413
234
|
|
|
414
235
|
return result;
|
|
@@ -422,44 +243,29 @@ export const persistenceMiddleware: Middleware = (storeAPI) => (next) => (
|
|
|
422
243
|
export async function readPersistedState(): Promise<{
|
|
423
244
|
chat: PersistedChatState | null;
|
|
424
245
|
rooms: PersistedRoomsState | null;
|
|
425
|
-
heap: PersistedHeapState | null;
|
|
426
246
|
}> {
|
|
427
247
|
try {
|
|
428
|
-
const [chatRaw, roomsRaw
|
|
248
|
+
const [chatRaw, roomsRaw] = await AsyncStorage.multiGet([
|
|
429
249
|
KEY_CHAT,
|
|
430
250
|
KEY_ROOMS,
|
|
431
|
-
KEY_HEAP,
|
|
432
251
|
]);
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
heapRaw[1] ? decryptFromPersist(heapRaw[1]) : Promise.resolve(null),
|
|
437
|
-
]);
|
|
438
|
-
// `decryptFromPersist` returns null both for "nothing stored" and
|
|
439
|
-
// for "stored value isn't a valid envelope for the current key" —
|
|
440
|
-
// notably a plaintext blob left over from a pre-encryption install.
|
|
441
|
-
// Either way there is nothing safe to parse, so the caller treats it
|
|
442
|
-
// as a cold start and re-hydrates from the server.
|
|
443
|
-
const chat = chatPlain ? (JSON.parse(chatPlain) as PersistedChatState) : null;
|
|
444
|
-
const rooms = roomsPlain
|
|
445
|
-
? (JSON.parse(roomsPlain) as PersistedRoomsState)
|
|
446
|
-
: null;
|
|
447
|
-
const heap = heapPlain
|
|
448
|
-
? (JSON.parse(heapPlain) as PersistedHeapState)
|
|
252
|
+
const chat = chatRaw[1] ? (JSON.parse(chatRaw[1]) as PersistedChatState) : null;
|
|
253
|
+
const rooms = roomsRaw[1]
|
|
254
|
+
? (JSON.parse(roomsRaw[1]) as PersistedRoomsState)
|
|
449
255
|
: null;
|
|
450
|
-
return { chat, rooms
|
|
256
|
+
return { chat, rooms };
|
|
451
257
|
} catch (e) {
|
|
452
258
|
console.warn('persist read failed', e);
|
|
453
|
-
return { chat: null, rooms: null
|
|
259
|
+
return { chat: null, rooms: null };
|
|
454
260
|
}
|
|
455
261
|
}
|
|
456
262
|
|
|
457
263
|
export async function clearPersistedState(): Promise<void> {
|
|
458
264
|
try {
|
|
459
|
-
await AsyncStorage.multiRemove([KEY_CHAT, KEY_ROOMS
|
|
265
|
+
await AsyncStorage.multiRemove([KEY_CHAT, KEY_ROOMS]);
|
|
460
266
|
} catch (e) {
|
|
461
267
|
console.warn('persist clear failed', e);
|
|
462
268
|
}
|
|
463
269
|
}
|
|
464
270
|
|
|
465
|
-
export const PERSIST_KEYS = { KEY_CHAT, KEY_ROOMS
|
|
271
|
+
export const PERSIST_KEYS = { KEY_CHAT, KEY_ROOMS };
|
|
@@ -2,7 +2,6 @@ import { createAsyncThunk, createSlice, PayloadAction, type Slice } from '@redux
|
|
|
2
2
|
import type { WritableDraft } from 'immer';
|
|
3
3
|
import { EditAction, HistoryPreloadState, IMessage, IRoom } from '../types/types';
|
|
4
4
|
import { insertMessageWithDelimiter } from '../helpers/insertMessageWithDelimiter';
|
|
5
|
-
import { msgSortableMs } from '../helpers/msgSortableMs';
|
|
6
5
|
import type XmppClient from '../networking/xmppClient';
|
|
7
6
|
|
|
8
7
|
// Per-room runtime message cap. Mirrors the persistence layer's
|
|
@@ -14,7 +13,7 @@ import type XmppClient from '../networking/xmppClient';
|
|
|
14
13
|
// older history added via unshift/splice is exempt, so the user can
|
|
15
14
|
// page backward arbitrarily far without instantly losing what they
|
|
16
15
|
// just fetched. After cap eviction we drop from the head (oldest).
|
|
17
|
-
|
|
16
|
+
const RUNTIME_MESSAGE_LIMIT = 100;
|
|
18
17
|
|
|
19
18
|
// Body strings the server uses for call signaling broadcasts (call-token,
|
|
20
19
|
// call-state ringing/ended, etc). These should never reach the chat
|
|
@@ -143,6 +142,7 @@ function mergeHistoryIntoCache(
|
|
|
143
142
|
const ex = stripCallSignals(existing);
|
|
144
143
|
const fe = stripCallSignals(fetched);
|
|
145
144
|
|
|
145
|
+
const pending = ex.filter((m) => m?.pending);
|
|
146
146
|
const realExisting = ex.filter(
|
|
147
147
|
(m) => m && !m.pending && m.id !== 'delimiter-new'
|
|
148
148
|
);
|
|
@@ -151,29 +151,6 @@ function mergeHistoryIntoCache(
|
|
|
151
151
|
// Nothing usable came back → keep the cache exactly as it was.
|
|
152
152
|
if (realFetched.length === 0) {return ex;}
|
|
153
153
|
|
|
154
|
-
// Optimistic sends are preserved across a history merge - EXCEPT the
|
|
155
|
-
// ones the fetched page proves the server already has. That happens
|
|
156
|
-
// whenever a send reached the server but its echo did not reach us
|
|
157
|
-
// before the process died: the optimistic bubble is restored from disk
|
|
158
|
-
// still `pending: true` (and, since bug #39, flagged failed at boot),
|
|
159
|
-
// while MAM hands back the very same message under its ARCHIVE id.
|
|
160
|
-
// Keying only on `id` never matched those two, so the room ended up
|
|
161
|
-
// showing the message twice - once for real and once as a bubble stuck
|
|
162
|
-
// on "sending…"/"Failed" that nothing could ever clear. The archived
|
|
163
|
-
// copy carries our original stanza id as `xmppId` (getDataFromXml), so
|
|
164
|
-
// match on that too and drop the local ghost.
|
|
165
|
-
const fetchedKeys = new Set<string>();
|
|
166
|
-
for (const m of realFetched) {
|
|
167
|
-
if (m?.id != null) {fetchedKeys.add(String(m.id));}
|
|
168
|
-
if ((m as any)?.xmppId) {fetchedKeys.add(String((m as any).xmppId));}
|
|
169
|
-
}
|
|
170
|
-
const pending = ex.filter(
|
|
171
|
-
(m) =>
|
|
172
|
-
m?.pending &&
|
|
173
|
-
!fetchedKeys.has(String(m.id)) &&
|
|
174
|
-
!(m.xmppId && fetchedKeys.has(String(m.xmppId)))
|
|
175
|
-
);
|
|
176
|
-
|
|
177
154
|
const byMs = (a: IMessage, b: IMessage) =>
|
|
178
155
|
msgSortableMs(a) - msgSortableMs(b);
|
|
179
156
|
const capTail = (arr: IMessage[]) =>
|
|
@@ -237,33 +214,6 @@ export interface RoomMessagesState {
|
|
|
237
214
|
// — see `applyPrivateStoreMarkers`. Re-fetched every init/reconnect,
|
|
238
215
|
// so it is intentionally NOT persisted.
|
|
239
216
|
privateStoreMarkers: Record<string, number>;
|
|
240
|
-
// The single source of truth for "read up to here, but the user
|
|
241
|
-
// hasn't reached the bottom yet" (`{ roomJID: boundaryMs }`).
|
|
242
|
-
// Set by MessageList (via ChatRoom's `onReadBoundaryChange`) the
|
|
243
|
-
// moment the user first scrolls away from the bottom, to the
|
|
244
|
-
// msgSortableMs of the newest message they'd actually seen. Every
|
|
245
|
-
// path that stamps a read marker for a room the user is leaving
|
|
246
|
-
// (ChatRoom unmount, xmppProvider's AppState background handler and
|
|
247
|
-
// `isVisible=false` handler, the live `advance()` effect, and
|
|
248
|
-
// `useChatRoomFocus`'s `leaveRoom`) must consult this instead of
|
|
249
|
-
// unconditionally stamping "the newest acked message" - otherwise
|
|
250
|
-
// leaving a room while scrolled up marks messages the user never
|
|
251
|
-
// reached as read (customer #42, a regression of #33 reintroduced by
|
|
252
|
-
// #38's server-timestamp marker). See `getReadMarkerTimestamp` in
|
|
253
|
-
// helpers/getServerReadTimestamp.ts.
|
|
254
|
-
//
|
|
255
|
-
// Cleared when the boundary no longer applies: the user scrolls back
|
|
256
|
-
// to the bottom, the visible room changes, or the room is truly left
|
|
257
|
-
// (ChatRoom unmounts, or a tab-navigator focus hook releases the
|
|
258
|
-
// room). NOT cleared merely because the app backgrounds or a host's
|
|
259
|
-
// `isVisible` flips false - MessageList typically stays mounted
|
|
260
|
-
// through those, so its own scroll-tracking ref (the only thing that
|
|
261
|
-
// could re-derive this value) is still intact and the boundary must
|
|
262
|
-
// stay in sync with it. Deliberately NOT persisted (this key isn't
|
|
263
|
-
// read by `persistence.ts`, which only ever picks `rooms` back out of
|
|
264
|
-
// this slice) - it's meaningless across a process restart, where
|
|
265
|
-
// MessageList always mounts fresh at the bottom.
|
|
266
|
-
readBoundaries: Record<string, number>;
|
|
267
217
|
}
|
|
268
218
|
|
|
269
219
|
const initialState: RoomMessagesState = {
|
|
@@ -280,7 +230,6 @@ const initialState: RoomMessagesState = {
|
|
|
280
230
|
},
|
|
281
231
|
pendingNotificationJid: null,
|
|
282
232
|
privateStoreMarkers: {},
|
|
283
|
-
readBoundaries: {},
|
|
284
233
|
};
|
|
285
234
|
|
|
286
235
|
const isValidRoomJid = (jid: unknown): jid is string => {
|
|
@@ -368,8 +317,6 @@ const reducers = {
|
|
|
368
317
|
: [];
|
|
369
318
|
state.rooms[roomData.jid] = {
|
|
370
319
|
...roomData,
|
|
371
|
-
icon: roomData.icon !== undefined ? roomData.icon : existing?.icon,
|
|
372
|
-
roomBg: roomData.roomBg !== undefined ? roomData.roomBg : existing?.roomBg,
|
|
373
320
|
messages:
|
|
374
321
|
existingMessages.length > 0 ? existingMessages : incomingMessages,
|
|
375
322
|
lastViewedTimestamp: lastViewed,
|
|
@@ -547,7 +494,7 @@ const reducers = {
|
|
|
547
494
|
state.visibleRoomJID === roomJID
|
|
548
495
|
? null
|
|
549
496
|
: lastViewedValue
|
|
550
|
-
? lastViewedValue
|
|
497
|
+
? new Date(lastViewedValue)
|
|
551
498
|
: null;
|
|
552
499
|
|
|
553
500
|
insertMessageWithDelimiter(roomMessages, message, lastViewedTimestamp);
|
|
@@ -565,7 +512,6 @@ const reducers = {
|
|
|
565
512
|
state.rooms = {};
|
|
566
513
|
state.visibleRoomJID = null;
|
|
567
514
|
state.privateStoreMarkers = {};
|
|
568
|
-
state.readBoundaries = {};
|
|
569
515
|
state.isUnreadSyncing = false;
|
|
570
516
|
},
|
|
571
517
|
setComposing(
|
|
@@ -632,19 +578,7 @@ const reducers = {
|
|
|
632
578
|
*
|
|
633
579
|
* Monotonic: a marker only ever moves a baseline FORWARD, so a stale
|
|
634
580
|
* server value can't resurrect already-read messages and a more-recent
|
|
635
|
-
* local read (tab blur stamping
|
|
636
|
-
*
|
|
637
|
-
* Bug #38 self-heal: forward-only is correct for a SANE existing
|
|
638
|
-
* value, but a device whose clock was ahead may have already stamped
|
|
639
|
-
* a marker in the future (either persisted locally from a previous
|
|
640
|
-
* session, or fetched from the server before this fix existed). To
|
|
641
|
-
* "only ever move forward" from a corrupt future value is to never
|
|
642
|
-
* move at all - the room would stay stuck at `unreadMessages: 0`
|
|
643
|
-
* forever. When the room is loaded, detect a marker that sits well
|
|
644
|
-
* past the newest message we actually know it has and waive the
|
|
645
|
-
* forward-only check for that one comparison, so the incoming
|
|
646
|
-
* (already-clamped, see xmppClient.getChatsPrivateStoreRequestStanza)
|
|
647
|
-
* value can correct it even though it's numerically smaller.
|
|
581
|
+
* local read (tab blur stamping Date.now()) always wins.
|
|
648
582
|
*/
|
|
649
583
|
applyPrivateStoreMarkers: (
|
|
650
584
|
state: WritableDraft<RoomMessagesState>,
|
|
@@ -656,72 +590,20 @@ const reducers = {
|
|
|
656
590
|
for (const jid of Object.keys(markers)) {
|
|
657
591
|
const ts = Number(markers[jid]);
|
|
658
592
|
if (!jid || !Number.isFinite(ts) || ts <= 0) {continue;}
|
|
659
|
-
|
|
660
|
-
const room = state.rooms[jid];
|
|
661
|
-
const newestKnownMs = room ? newestAckedMessageMs(room.messages) : 0;
|
|
662
|
-
// Mirrors isCorruptFutureReadMarker in helpers/getServerReadTimestamp.ts
|
|
663
|
-
// (duplicated to avoid a roomStore <-> helpers import cycle):
|
|
664
|
-
// BOTH signals are required. "Further ahead than the newest
|
|
665
|
-
// message this room has locally" happens all the time on a room
|
|
666
|
-
// whose history hasn't synced yet, and healing on that alone
|
|
667
|
-
// would drop a legitimate marker another device wrote after
|
|
668
|
-
// reading newer messages. A real read marker can never be ahead
|
|
669
|
-
// of real time, so that second signal is what distinguishes a
|
|
670
|
-
// stale cache from a wrong clock.
|
|
671
|
-
const nowMs = Date.now();
|
|
672
|
-
const looksCorrupt = (existing: number) =>
|
|
673
|
-
newestKnownMs > 0 &&
|
|
674
|
-
existing > newestKnownMs + FUTURE_MARKER_TOLERANCE_MS &&
|
|
675
|
-
existing > nowMs + FUTURE_MARKER_TOLERANCE_MS;
|
|
676
|
-
|
|
677
593
|
// Remember the marker so rooms that load LATER (via addRoom)
|
|
678
594
|
// inherit it even though they don't exist in the store yet.
|
|
679
|
-
|
|
680
|
-
if (ts > cachedMarker || looksCorrupt(cachedMarker)) {
|
|
595
|
+
if (ts > (state.privateStoreMarkers[jid] || 0)) {
|
|
681
596
|
state.privateStoreMarkers[jid] = ts;
|
|
682
597
|
}
|
|
683
598
|
// Upgrade an already-loaded room's baseline + recompute its badge.
|
|
684
|
-
//
|
|
685
|
-
|
|
686
|
-
if (room &&
|
|
599
|
+
// Only ever forward, so a later local read isn't clobbered.
|
|
600
|
+
const room = state.rooms[jid];
|
|
601
|
+
if (room && ts > (room.lastViewedTimestamp || 0)) {
|
|
687
602
|
room.lastViewedTimestamp = ts;
|
|
688
603
|
room.unreadMessages = countNewerMessages(room.messages, ts);
|
|
689
604
|
}
|
|
690
605
|
}
|
|
691
606
|
},
|
|
692
|
-
/**
|
|
693
|
-
* Set (or clear) the "read up to here, but not further" boundary for
|
|
694
|
-
* a room - see `readBoundaries` on `RoomMessagesState` for the full
|
|
695
|
-
* contract. `ts` is the msgSortableMs of the newest message the user
|
|
696
|
-
* actually reached before scrolling away from the bottom; `null`/`0`
|
|
697
|
-
* clears it (the user is at the bottom, or nothing was reached yet).
|
|
698
|
-
*/
|
|
699
|
-
setReadBoundary: (
|
|
700
|
-
state: WritableDraft<RoomMessagesState>,
|
|
701
|
-
action: PayloadAction<{ jid: string; ts: number | null }>
|
|
702
|
-
) => {
|
|
703
|
-
const { jid, ts } = action.payload;
|
|
704
|
-
if (!jid) {return;}
|
|
705
|
-
if (!state.readBoundaries) {state.readBoundaries = {};}
|
|
706
|
-
if (typeof ts === 'number' && Number.isFinite(ts) && ts > 0) {
|
|
707
|
-
state.readBoundaries[jid] = ts;
|
|
708
|
-
} else {
|
|
709
|
-
delete state.readBoundaries[jid];
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
/**
|
|
713
|
-
* Release a room's read boundary once it has been consumed by a
|
|
714
|
-
* genuine "leave" (ChatRoom unmount, or a tab-navigator focus hook
|
|
715
|
-
* switching to a different room) - see `readBoundaries` for why the
|
|
716
|
-
* background/`isVisible=false` paths deliberately do NOT call this.
|
|
717
|
-
*/
|
|
718
|
-
clearReadBoundary: (
|
|
719
|
-
state: WritableDraft<RoomMessagesState>,
|
|
720
|
-
action: PayloadAction<{ jid: string }>
|
|
721
|
-
) => {
|
|
722
|
-
const { jid } = action.payload;
|
|
723
|
-
if (jid && state.readBoundaries) {delete state.readBoundaries[jid];}
|
|
724
|
-
},
|
|
725
607
|
setRoomRole: (
|
|
726
608
|
state: WritableDraft<RoomMessagesState>,
|
|
727
609
|
action: PayloadAction<{ chatJID: string; role: string }>
|
|
@@ -815,7 +697,6 @@ const reducers = {
|
|
|
815
697
|
state.isLoading = false;
|
|
816
698
|
state.isUnreadSyncing = false;
|
|
817
699
|
state.privateStoreMarkers = {};
|
|
818
|
-
state.readBoundaries = {};
|
|
819
700
|
},
|
|
820
701
|
setActiveMessage: (
|
|
821
702
|
state: WritableDraft<RoomMessagesState>,
|
|
@@ -937,13 +818,27 @@ export const roomsStore: Slice<RoomMessagesState, typeof reducers, 'roomMessages
|
|
|
937
818
|
reducers,
|
|
938
819
|
});
|
|
939
820
|
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
// helpers/
|
|
943
|
-
//
|
|
944
|
-
//
|
|
945
|
-
//
|
|
946
|
-
|
|
821
|
+
// Count messages strictly newer than the given millisecond timestamp.
|
|
822
|
+
// Uses `msg.id` (server-authoritative microsecond timestamp prefixed by
|
|
823
|
+
// 13-digit millis — see helpers/dateComparison `getHighResolutionTimestamp`)
|
|
824
|
+
// because `msg.date` can be derived client-side (createMessageFromXml
|
|
825
|
+
// falls back to `Date.now()` for realtime stanzas without a `date`
|
|
826
|
+
// attr), which makes the comparison drift vs what the server assigned.
|
|
827
|
+
// Excludes the "delimiter-new" sentinel, pending sends, and the current
|
|
828
|
+
// user's own messages (parity with unreadMiddleware's isOwnMessage
|
|
829
|
+
// filter — without this, the reducer and the middleware disagree about
|
|
830
|
+
// the count and we get a flicker as the badge gets written twice with
|
|
831
|
+
// different values on every message).
|
|
832
|
+
export const msgSortableMs = (msg: any): number => {
|
|
833
|
+
const id = String(msg?.id || '');
|
|
834
|
+
const m = /^(\d{13})/.exec(id);
|
|
835
|
+
if (m) {return Number(m[1]);}
|
|
836
|
+
if (msg?.date) {
|
|
837
|
+
const t = new Date(msg.date as any).getTime();
|
|
838
|
+
if (Number.isFinite(t)) {return t;}
|
|
839
|
+
}
|
|
840
|
+
return 0;
|
|
841
|
+
};
|
|
947
842
|
|
|
948
843
|
const norm = (s: any): string => {
|
|
949
844
|
if (s == null) {return '';}
|
|
@@ -975,31 +870,6 @@ const isOwn = (
|
|
|
975
870
|
return false;
|
|
976
871
|
};
|
|
977
872
|
|
|
978
|
-
// Bug #38 tolerance: a stored read marker more than this far past the
|
|
979
|
-
// newest message a room actually has is not "the user is a little
|
|
980
|
-
// ahead" - it's a leftover from a device whose clock was wrong when it
|
|
981
|
-
// stamped the marker. Kept in sync with (but duplicated from, to avoid
|
|
982
|
-
// a roomStore ↔ helpers import cycle) FUTURE_READ_MARKER_TOLERANCE_MS
|
|
983
|
-
// in helpers/getServerReadTimestamp.ts.
|
|
984
|
-
const FUTURE_MARKER_TOLERANCE_MS = 5 * 60 * 1000;
|
|
985
|
-
|
|
986
|
-
// Newest message in `messages` this room actually has proof the server
|
|
987
|
-
// accepted - used only to sanity-check an already-stored read marker
|
|
988
|
-
// against reality (see applyPrivateStoreMarkers's self-heal). Excludes
|
|
989
|
-
// pending/optimistic sends via the `pending` flag alone: unlike
|
|
990
|
-
// getServerReadTimestamp, this runs inside a reducer and can't reach
|
|
991
|
-
// across to the roomHeapSlice slice, but `pending` already identifies
|
|
992
|
-
// every optimistic send that matters for this comparison.
|
|
993
|
-
const newestAckedMessageMs = (messages: IMessage[] | undefined): number => {
|
|
994
|
-
let newest = 0;
|
|
995
|
-
for (const m of messages || []) {
|
|
996
|
-
if (!m || m.id === 'delimiter-new' || m.pending) {continue;}
|
|
997
|
-
const ms = msgSortableMs(m);
|
|
998
|
-
if (ms > newest) {newest = ms;}
|
|
999
|
-
}
|
|
1000
|
-
return newest;
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
873
|
const countNewerMessages = (
|
|
1004
874
|
messages: IMessage[],
|
|
1005
875
|
timestamp: number,
|
|
@@ -1030,8 +900,6 @@ export const {
|
|
|
1030
900
|
setUnreadSyncing,
|
|
1031
901
|
setLastViewedTimestamp,
|
|
1032
902
|
applyPrivateStoreMarkers,
|
|
1033
|
-
setReadBoundary,
|
|
1034
|
-
clearReadBoundary,
|
|
1035
903
|
setRoomNoMessages,
|
|
1036
904
|
setCurrentRoom,
|
|
1037
905
|
setVisibleRoom,
|