@ethora/chat-component-rn 26.7.9 → 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 -93
- package/README.md +10 -33
- 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 +13 -101
- 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 +54 -128
- 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 +13 -0
- 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/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 +8 -17
- 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 -15
- 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 +8 -87
- 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 +14 -102
- 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 +55 -128
- 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 +13 -0
- 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/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 +8 -17
- 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 -15
- 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 +7 -86
- 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.map +1 -1
- package/lib/typescript/helpers/isUnresolvedSenderId.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 +1 -14
- 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 -49
- 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 +16 -111
- 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 +51 -134
- 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 +13 -0
- package/src/helpers/isUnresolvedSenderId.ts +9 -1
- 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 +5 -14
- package/src/hooks/useChatWrapperInit.ts +16 -32
- package/src/hooks/useComposing.tsx +1 -37
- package/src/hooks/useLogout.tsx +9 -15
- 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 +7 -87
- package/src/services/pushSubscriptionService.ts +13 -18
- package/src/types/types.ts +5 -58
- 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 -125
- 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/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 -120
- 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/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 -69
- 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/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 -120
- package/src/helpers/isOwnMessage.ts +0 -90
- package/src/helpers/mediaLibraryRuntime.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 };
|
|
@@ -13,7 +13,7 @@ import type XmppClient from '../networking/xmppClient';
|
|
|
13
13
|
// older history added via unshift/splice is exempt, so the user can
|
|
14
14
|
// page backward arbitrarily far without instantly losing what they
|
|
15
15
|
// just fetched. After cap eviction we drop from the head (oldest).
|
|
16
|
-
|
|
16
|
+
const RUNTIME_MESSAGE_LIMIT = 100;
|
|
17
17
|
|
|
18
18
|
// Body strings the server uses for call signaling broadcasts (call-token,
|
|
19
19
|
// call-state ringing/ended, etc). These should never reach the chat
|
|
@@ -142,6 +142,7 @@ function mergeHistoryIntoCache(
|
|
|
142
142
|
const ex = stripCallSignals(existing);
|
|
143
143
|
const fe = stripCallSignals(fetched);
|
|
144
144
|
|
|
145
|
+
const pending = ex.filter((m) => m?.pending);
|
|
145
146
|
const realExisting = ex.filter(
|
|
146
147
|
(m) => m && !m.pending && m.id !== 'delimiter-new'
|
|
147
148
|
);
|
|
@@ -150,29 +151,6 @@ function mergeHistoryIntoCache(
|
|
|
150
151
|
// Nothing usable came back → keep the cache exactly as it was.
|
|
151
152
|
if (realFetched.length === 0) {return ex;}
|
|
152
153
|
|
|
153
|
-
// Optimistic sends are preserved across a history merge - EXCEPT the
|
|
154
|
-
// ones the fetched page proves the server already has. That happens
|
|
155
|
-
// whenever a send reached the server but its echo did not reach us
|
|
156
|
-
// before the process died: the optimistic bubble is restored from disk
|
|
157
|
-
// still `pending: true` (and, since bug #39, flagged failed at boot),
|
|
158
|
-
// while MAM hands back the very same message under its ARCHIVE id.
|
|
159
|
-
// Keying only on `id` never matched those two, so the room ended up
|
|
160
|
-
// showing the message twice - once for real and once as a bubble stuck
|
|
161
|
-
// on "sending…"/"Failed" that nothing could ever clear. The archived
|
|
162
|
-
// copy carries our original stanza id as `xmppId` (getDataFromXml), so
|
|
163
|
-
// match on that too and drop the local ghost.
|
|
164
|
-
const fetchedKeys = new Set<string>();
|
|
165
|
-
for (const m of realFetched) {
|
|
166
|
-
if (m?.id != null) {fetchedKeys.add(String(m.id));}
|
|
167
|
-
if ((m as any)?.xmppId) {fetchedKeys.add(String((m as any).xmppId));}
|
|
168
|
-
}
|
|
169
|
-
const pending = ex.filter(
|
|
170
|
-
(m) =>
|
|
171
|
-
m?.pending &&
|
|
172
|
-
!fetchedKeys.has(String(m.id)) &&
|
|
173
|
-
!(m.xmppId && fetchedKeys.has(String(m.xmppId)))
|
|
174
|
-
);
|
|
175
|
-
|
|
176
154
|
const byMs = (a: IMessage, b: IMessage) =>
|
|
177
155
|
msgSortableMs(a) - msgSortableMs(b);
|
|
178
156
|
const capTail = (arr: IMessage[]) =>
|
|
@@ -339,8 +317,6 @@ const reducers = {
|
|
|
339
317
|
: [];
|
|
340
318
|
state.rooms[roomData.jid] = {
|
|
341
319
|
...roomData,
|
|
342
|
-
icon: roomData.icon !== undefined ? roomData.icon : existing?.icon,
|
|
343
|
-
roomBg: roomData.roomBg !== undefined ? roomData.roomBg : existing?.roomBg,
|
|
344
320
|
messages:
|
|
345
321
|
existingMessages.length > 0 ? existingMessages : incomingMessages,
|
|
346
322
|
lastViewedTimestamp: lastViewed,
|
|
@@ -602,19 +578,7 @@ const reducers = {
|
|
|
602
578
|
*
|
|
603
579
|
* Monotonic: a marker only ever moves a baseline FORWARD, so a stale
|
|
604
580
|
* server value can't resurrect already-read messages and a more-recent
|
|
605
|
-
* local read (tab blur stamping
|
|
606
|
-
*
|
|
607
|
-
* Bug #38 self-heal: forward-only is correct for a SANE existing
|
|
608
|
-
* value, but a device whose clock was ahead may have already stamped
|
|
609
|
-
* a marker in the future (either persisted locally from a previous
|
|
610
|
-
* session, or fetched from the server before this fix existed). To
|
|
611
|
-
* "only ever move forward" from a corrupt future value is to never
|
|
612
|
-
* move at all - the room would stay stuck at `unreadMessages: 0`
|
|
613
|
-
* forever. When the room is loaded, detect a marker that sits well
|
|
614
|
-
* past the newest message we actually know it has and waive the
|
|
615
|
-
* forward-only check for that one comparison, so the incoming
|
|
616
|
-
* (already-clamped, see xmppClient.getChatsPrivateStoreRequestStanza)
|
|
617
|
-
* value can correct it even though it's numerically smaller.
|
|
581
|
+
* local read (tab blur stamping Date.now()) always wins.
|
|
618
582
|
*/
|
|
619
583
|
applyPrivateStoreMarkers: (
|
|
620
584
|
state: WritableDraft<RoomMessagesState>,
|
|
@@ -626,34 +590,15 @@ const reducers = {
|
|
|
626
590
|
for (const jid of Object.keys(markers)) {
|
|
627
591
|
const ts = Number(markers[jid]);
|
|
628
592
|
if (!jid || !Number.isFinite(ts) || ts <= 0) {continue;}
|
|
629
|
-
|
|
630
|
-
const room = state.rooms[jid];
|
|
631
|
-
const newestKnownMs = room ? newestAckedMessageMs(room.messages) : 0;
|
|
632
|
-
// Mirrors isCorruptFutureReadMarker in helpers/getServerReadTimestamp.ts
|
|
633
|
-
// (duplicated to avoid a roomStore <-> helpers import cycle):
|
|
634
|
-
// BOTH signals are required. "Further ahead than the newest
|
|
635
|
-
// message this room has locally" happens all the time on a room
|
|
636
|
-
// whose history hasn't synced yet, and healing on that alone
|
|
637
|
-
// would drop a legitimate marker another device wrote after
|
|
638
|
-
// reading newer messages. A real read marker can never be ahead
|
|
639
|
-
// of real time, so that second signal is what distinguishes a
|
|
640
|
-
// stale cache from a wrong clock.
|
|
641
|
-
const nowMs = Date.now();
|
|
642
|
-
const looksCorrupt = (existing: number) =>
|
|
643
|
-
newestKnownMs > 0 &&
|
|
644
|
-
existing > newestKnownMs + FUTURE_MARKER_TOLERANCE_MS &&
|
|
645
|
-
existing > nowMs + FUTURE_MARKER_TOLERANCE_MS;
|
|
646
|
-
|
|
647
593
|
// Remember the marker so rooms that load LATER (via addRoom)
|
|
648
594
|
// inherit it even though they don't exist in the store yet.
|
|
649
|
-
|
|
650
|
-
if (ts > cachedMarker || looksCorrupt(cachedMarker)) {
|
|
595
|
+
if (ts > (state.privateStoreMarkers[jid] || 0)) {
|
|
651
596
|
state.privateStoreMarkers[jid] = ts;
|
|
652
597
|
}
|
|
653
598
|
// Upgrade an already-loaded room's baseline + recompute its badge.
|
|
654
|
-
//
|
|
655
|
-
|
|
656
|
-
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)) {
|
|
657
602
|
room.lastViewedTimestamp = ts;
|
|
658
603
|
room.unreadMessages = countNewerMessages(room.messages, ts);
|
|
659
604
|
}
|
|
@@ -925,31 +870,6 @@ const isOwn = (
|
|
|
925
870
|
return false;
|
|
926
871
|
};
|
|
927
872
|
|
|
928
|
-
// Bug #38 tolerance: a stored read marker more than this far past the
|
|
929
|
-
// newest message a room actually has is not "the user is a little
|
|
930
|
-
// ahead" - it's a leftover from a device whose clock was wrong when it
|
|
931
|
-
// stamped the marker. Kept in sync with (but duplicated from, to avoid
|
|
932
|
-
// a roomStore ↔ helpers import cycle) FUTURE_READ_MARKER_TOLERANCE_MS
|
|
933
|
-
// in helpers/getServerReadTimestamp.ts.
|
|
934
|
-
const FUTURE_MARKER_TOLERANCE_MS = 5 * 60 * 1000;
|
|
935
|
-
|
|
936
|
-
// Newest message in `messages` this room actually has proof the server
|
|
937
|
-
// accepted - used only to sanity-check an already-stored read marker
|
|
938
|
-
// against reality (see applyPrivateStoreMarkers's self-heal). Excludes
|
|
939
|
-
// pending/optimistic sends via the `pending` flag alone: unlike
|
|
940
|
-
// getServerReadTimestamp, this runs inside a reducer and can't reach
|
|
941
|
-
// across to the roomHeapSlice slice, but `pending` already identifies
|
|
942
|
-
// every optimistic send that matters for this comparison.
|
|
943
|
-
const newestAckedMessageMs = (messages: IMessage[] | undefined): number => {
|
|
944
|
-
let newest = 0;
|
|
945
|
-
for (const m of messages || []) {
|
|
946
|
-
if (!m || m.id === 'delimiter-new' || m.pending) {continue;}
|
|
947
|
-
const ms = msgSortableMs(m);
|
|
948
|
-
if (ms > newest) {newest = ms;}
|
|
949
|
-
}
|
|
950
|
-
return newest;
|
|
951
|
-
};
|
|
952
|
-
|
|
953
873
|
const countNewerMessages = (
|
|
954
874
|
messages: IMessage[],
|
|
955
875
|
timestamp: number,
|
|
@@ -81,9 +81,7 @@ export class PushSubscriptionService {
|
|
|
81
81
|
this.subscribedRooms.add(roomJID);
|
|
82
82
|
await this.saveSubscribedRoomsToStorage();
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
console.warn('[PushService] MucSub subscribe refused for', roomJID);
|
|
86
|
-
}
|
|
84
|
+
console.log('Successfully Subscribed to room', roomJID);
|
|
87
85
|
return result;
|
|
88
86
|
} catch (error) {
|
|
89
87
|
console.error(`[PushService] Failed to subscribe to room ${roomJID}:`, error);
|
|
@@ -94,33 +92,30 @@ export class PushSubscriptionService {
|
|
|
94
92
|
async subscribeToRooms(
|
|
95
93
|
client: Client,
|
|
96
94
|
roomJIDs: string[],
|
|
97
|
-
userNick?: string
|
|
98
|
-
concurrency = 8
|
|
95
|
+
userNick?: string
|
|
99
96
|
): Promise<void> {
|
|
100
97
|
let successful = 0;
|
|
101
98
|
let failed = 0;
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
const pending = roomJIDs.filter((jid) => !this.subscribedRooms.has(jid));
|
|
105
|
-
if (!pending.length) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
100
|
+
console.log('test roomJIDs', roomJIDs);
|
|
108
101
|
|
|
109
|
-
for (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
for (const r of results) {
|
|
115
|
-
if (r.status === 'fulfilled' && r.value) {
|
|
102
|
+
for (const roomJID of roomJIDs) {
|
|
103
|
+
try {
|
|
104
|
+
const result = await this.subscribeToRoom(client, roomJID, userNick);
|
|
105
|
+
console.log('test roomJID-1', result);
|
|
106
|
+
if (result) {
|
|
116
107
|
successful++;
|
|
117
108
|
} else {
|
|
118
109
|
failed++;
|
|
119
110
|
}
|
|
111
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
112
|
+
} catch (error) {
|
|
113
|
+
failed++;
|
|
114
|
+
console.error(`Failed to subscribe to room ${roomJID}:`, error);
|
|
120
115
|
}
|
|
121
116
|
}
|
|
122
117
|
|
|
123
|
-
console.log(`
|
|
118
|
+
console.log(`Subscribed to ${successful} rooms, ${failed} failed`);
|
|
124
119
|
}
|
|
125
120
|
|
|
126
121
|
async reset(): Promise<void> {
|
package/src/types/types.ts
CHANGED
|
@@ -105,7 +105,6 @@ export interface User {
|
|
|
105
105
|
];
|
|
106
106
|
appId: string;
|
|
107
107
|
xmppPassword: string;
|
|
108
|
-
fileToken?: string;
|
|
109
108
|
|
|
110
109
|
homeScreen?: string;
|
|
111
110
|
registrationChannelType?: string;
|
|
@@ -151,7 +150,6 @@ export interface xmppSettingsInterface {
|
|
|
151
150
|
disableLastRead?: boolean;
|
|
152
151
|
xmppPingOnSendEnabled?: boolean;
|
|
153
152
|
historyQoS?: HistoryQoSConfig;
|
|
154
|
-
keepAliveInBackground?: boolean;
|
|
155
153
|
}
|
|
156
154
|
|
|
157
155
|
export interface InAppNotificationConfig {
|
|
@@ -311,16 +309,13 @@ export interface TypographyConfig {
|
|
|
311
309
|
};
|
|
312
310
|
/** Attach (photo/document picker) bottom sheet. */
|
|
313
311
|
attachSheet?: {
|
|
314
|
-
/** "
|
|
312
|
+
/** "Attach" header label. Default 13 / "600". */
|
|
315
313
|
title?: ChatTextStyle;
|
|
316
|
-
/**
|
|
317
|
-
viewLibrary?: ChatTextStyle;
|
|
318
|
-
/** Row labels ("Upload a File"). Default 16 / "500". */
|
|
314
|
+
/** Row labels (Camera / Gallery / Document). Default 16 / "500". */
|
|
319
315
|
rowLabel?: ChatTextStyle;
|
|
320
|
-
/**
|
|
316
|
+
/** Grey hint under each row. Default 12. */
|
|
321
317
|
rowHint?: ChatTextStyle;
|
|
322
|
-
/**
|
|
323
|
-
* the backdrop, dragging it down, or the hardware back gesture. */
|
|
318
|
+
/** Cancel button. Default 16 / "600". */
|
|
324
319
|
cancelButton?: ChatTextStyle;
|
|
325
320
|
};
|
|
326
321
|
|
|
@@ -398,16 +393,6 @@ export interface IConfig {
|
|
|
398
393
|
* value takes effect.
|
|
399
394
|
*/
|
|
400
395
|
height?: number;
|
|
401
|
-
/**
|
|
402
|
-
* Extend the header cards (room list + chat) under the status bar:
|
|
403
|
-
* each pads its top by the safe-area inset and paints it white, so
|
|
404
|
-
* the card and the status-bar band are one surface. Use this instead
|
|
405
|
-
* of wrapping `<Chat>` in a top-edge SafeAreaView: a host-side white
|
|
406
|
-
* band above the card shows a hairline seam where the card's
|
|
407
|
-
* shadow/elevation starts. Off by default (hosts that already pad the
|
|
408
|
-
* top keep their layout).
|
|
409
|
-
*/
|
|
410
|
-
safeAreaTop?: boolean;
|
|
411
396
|
};
|
|
412
397
|
disableHeader?: boolean;
|
|
413
398
|
disableMedia?: boolean;
|
|
@@ -436,7 +421,7 @@ export interface IConfig {
|
|
|
436
421
|
hideMemberSendMessageAction?: boolean; // hides only "Message"
|
|
437
422
|
hideMemberCopyIdAction?: boolean; // hides only "Copy User Id"
|
|
438
423
|
chatHeaderAdditional?: { enabled: boolean; element: any };
|
|
439
|
-
headerMenu?: (
|
|
424
|
+
headerMenu?: () => void;
|
|
440
425
|
headerChatMenu?: () => void;
|
|
441
426
|
chatHeaderSettings?: {
|
|
442
427
|
hide?: boolean;
|
|
@@ -468,41 +453,11 @@ export interface IConfig {
|
|
|
468
453
|
loginFunction: () => Promise<User | null>;
|
|
469
454
|
};
|
|
470
455
|
defaultLogin?: boolean;
|
|
471
|
-
logout?: {
|
|
472
|
-
enabled: boolean;
|
|
473
|
-
label?: string;
|
|
474
|
-
confirm?:
|
|
475
|
-
| boolean
|
|
476
|
-
| {
|
|
477
|
-
title?: string;
|
|
478
|
-
message?: string;
|
|
479
|
-
confirmText?: string;
|
|
480
|
-
cancelText?: string;
|
|
481
|
-
};
|
|
482
|
-
onBeforeLogout?: () => Promise<boolean | void> | boolean | void;
|
|
483
|
-
onAfterLogout?: () => Promise<void> | void;
|
|
484
|
-
};
|
|
485
456
|
refreshTokens?: {
|
|
486
457
|
enabled: boolean;
|
|
487
|
-
/**
|
|
488
|
-
* Host-owned rotation. When set, the SDK calls this INSTEAD of
|
|
489
|
-
* `/users/login/refresh` — always, including during bootstrap — and
|
|
490
|
-
* never rotates the Ethora refresh token itself. Serialised through
|
|
491
|
-
* the same lock as the built-in path.
|
|
492
|
-
*
|
|
493
|
-
* Return `refreshToken` whenever the host's flow actually rotates an
|
|
494
|
-
* Ethora refresh token: the backend now treats a re-presented one as
|
|
495
|
-
* theft, so omitting it leaves a burned token in storage that ends
|
|
496
|
-
* the session the next time it is used. It stays optional because
|
|
497
|
-
* some hosts re-mint an access token from a different authority
|
|
498
|
-
* (SuperTokens, an owner-session endpoint) and hold no Ethora
|
|
499
|
-
* refresh token at all.
|
|
500
|
-
*/
|
|
501
458
|
refreshFunction?: () => Promise<{
|
|
502
459
|
accessToken: string;
|
|
503
460
|
refreshToken?: string;
|
|
504
|
-
fileToken?: string;
|
|
505
|
-
xmppPassword?: string;
|
|
506
461
|
} | null>;
|
|
507
462
|
};
|
|
508
463
|
|
|
@@ -585,14 +540,6 @@ export interface IConfig {
|
|
|
585
540
|
// `disableKeyboardAvoidingView` is set. Needs on-device tuning of any
|
|
586
541
|
// `keyboardVerticalOffset`.
|
|
587
542
|
keyboardStickyInput?: boolean;
|
|
588
|
-
// The message list's FlatList uses keyboardDismissMode="interactive" by
|
|
589
|
-
// default, so a drag can be used to pull the keyboard closed. Because
|
|
590
|
-
// the list is `inverted`, an ordinary scroll gesture through history can
|
|
591
|
-
// also be read as a dismiss drag, closing the keyboard mid-scroll. Set
|
|
592
|
-
// this to keep the keyboard open regardless of how the list is scrolled
|
|
593
|
-
// — dismissal then only happens when the user deliberately closes it
|
|
594
|
-
// (tapping outside, back button, etc). Customer-reported #36.
|
|
595
|
-
keepKeyboardOpenOnScroll?: boolean;
|
|
596
543
|
|
|
597
544
|
// ----- interactions / messages -----
|
|
598
545
|
disableInteractions?: boolean;
|