@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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MIME_TO_EXT","VALID_EXT_RE","AUDIO_EXTENSIONS","IOS_AUDIO_PLAYBACK_EXTENSIONS","IOS_AUDIO_UNSUPPORTED_EXTENSIONS","AUDIO_EXT_RE","RegExp","map","e","replace","join","IOS_AUDIO_PLAYBACK_EXT_RE","AUDIO_NAME_HINT_RE","isLikelyAudio","mime","fileName","url","opts","m","toLowerCase","startsWith","durationNum","duration","Number","isFinite","waveForm","trim","length","name","originalName","urlLast","filenameFromUrl","test","urlPath","noQuery","split","decodeURIComponent","getExtensionForMime","normalized","last","pop","getLowerExtension","value","match","shouldCacheAudioForIosPlayback","src","urlName","candidates","hasIosPlayableName","some","getIosAudioPlaybackCacheExtension","candidate","ext","isUnsupportedAudioForIosPlayback","includes","ensureFilenameHasExtension","base","Date","now"],"sourceRoot":"../../../src","sources":["helpers/mimeToExtension.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,MAAMA,WAAmC,GAAG;EAC1C;EACA,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO;EACrB,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,MAAM;EACvB,YAAY,EAAE,OAAO;EAErB;EACA,WAAW,EAAE,MAAM;EACnB,iBAAiB,EAAE,MAAM;EACzB,aAAa,EAAE,MAAM;EACrB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,MAAM;EACpB,kBAAkB,EAAE,MAAM;EAC1B,YAAY,EAAE,OAAO;EAErB;EACA,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,aAAa,EAAE,MAAM;EACrB,WAAW,EAAE,MAAM;EACnB,aAAa,EAAE,MAAM;EACrB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO;EAErB;EACA,iBAAiB,EAAE,MAAM;EACzB,oBAAoB,EAAE,MAAM;EAC5B,yEAAyE,EACvE,OAAO;EACT,0BAA0B,EAAE,MAAM;EAClC,mEAAmE,EAAE,OAAO;EAC5E,+BAA+B,EAAE,MAAM;EACvC,2EAA2E,EACzE,OAAO;EACT,YAAY,EAAE,MAAM;EACpB,UAAU,EAAE,MAAM;EAClB,WAAW,EAAE,OAAO;EACpB,kBAAkB,EAAE,OAAO;EAC3B,iBAAiB,EAAE,MAAM;EACzB,UAAU,EAAE,MAAM;EAClB,iBAAiB,EAAE,MAAM;EAEzB;EACA,iBAAiB,EAAE,MAA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CAACC,GAAG,CAAC,CAAC,EAAE;EACxD,IAAIzD,YAAY,CAAC+B,IAAI,CAACwB,IAAI,CAAC,EAAE;IAAC,OAAOA,IAAI;EAAC;EAC1C,OAAO,GAAGA,IAAI,GAAGnB,mBAAmB,CAACvB,IAAI,CAAC,EAAE;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["MIME_TO_EXT","VALID_EXT_RE","AUDIO_EXTENSIONS","IOS_AUDIO_PLAYBACK_EXTENSIONS","IOS_AUDIO_UNSUPPORTED_EXTENSIONS","AUDIO_EXT_RE","RegExp","map","e","replace","join","IOS_AUDIO_PLAYBACK_EXT_RE","AUDIO_NAME_HINT_RE","isLikelyAudio","mime","fileName","url","opts","m","toLowerCase","startsWith","durationNum","duration","Number","isFinite","waveForm","trim","length","name","originalName","urlLast","filenameFromUrl","test","urlPath","noQuery","split","decodeURIComponent","getExtensionForMime","normalized","last","pop","getLowerExtension","value","match","shouldCacheAudioForIosPlayback","src","urlName","candidates","hasIosPlayableName","some","getIosAudioPlaybackCacheExtension","candidate","ext","isUnsupportedAudioForIosPlayback","includes","ensureFilenameHasExtension","base","Date","now","deriveDisplayFilename"],"sourceRoot":"../../../src","sources":["helpers/mimeToExtension.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,MAAMA,WAAmC,GAAG;EAC1C;EACA,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO;EACrB,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,MAAM;EACvB,YAAY,EAAE,OAAO;EAErB;EACA,WAAW,EAAE,MAAM;EACnB,iBAAiB,EAAE,MAAM;EACzB,aAAa,EAAE,MAAM;EACrB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,MAAM;EACpB,kBA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AAS,EAAElC,IAAI,CAACH,IAAI,CAAC;AACzD","ignoreList":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { setBaseURL } from '../networking/apiClient';
|
|
4
|
-
import { refreshAuthTokens, isRefreshFatalError } from '../networking/authRefresh';
|
|
3
|
+
import http, { setBaseURL } from '../networking/apiClient';
|
|
5
4
|
import { loginViaJwt } from '../networking/api-requests/auth.api';
|
|
6
5
|
import { getMyUser } from '../networking/api-requests/user.api';
|
|
7
6
|
import { store } from '../roomStore';
|
|
8
7
|
import { setUser } from '../roomStore/chatSettingsSlice';
|
|
9
8
|
import { walletToUsername } from './walletUsername';
|
|
10
|
-
import {
|
|
9
|
+
import { asyncLocalStorage } from '../hooks/useLocalStorage';
|
|
10
|
+
import { localStorageConstants } from './constants/LOCAL_STORAGE';
|
|
11
11
|
const getStatusCode = error => {
|
|
12
12
|
const status = error?.response?.status;
|
|
13
13
|
return typeof status === 'number' ? status : null;
|
|
@@ -31,112 +31,15 @@ const normalizeUserForXmpp = user => {
|
|
|
31
31
|
xmppUsername: normalizedXmppUsername
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
// Hermes has no atob/Buffer; hand-decode just enough base64url to read a
|
|
36
|
-
// JWT's `iat`. Claims are ASCII so the byte-per-char string is fine.
|
|
37
|
-
const B64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
38
|
-
const readJwtIat = token => {
|
|
39
|
-
if (!token || typeof token !== 'string') {
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
const part = token.split('.')[1];
|
|
43
|
-
if (!part) {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const clean = part.replace(/-/g, '+').replace(/_/g, '/');
|
|
48
|
-
let out = '';
|
|
49
|
-
let buffer = 0;
|
|
50
|
-
let bits = 0;
|
|
51
|
-
for (let i = 0; i < clean.length; i++) {
|
|
52
|
-
const idx = B64_ALPHABET.indexOf(clean[i]);
|
|
53
|
-
if (idx === -1) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
buffer = buffer << 6 | idx;
|
|
57
|
-
bits += 6;
|
|
58
|
-
if (bits >= 8) {
|
|
59
|
-
bits -= 8;
|
|
60
|
-
out += String.fromCharCode(buffer >> bits & 0xff);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const iat = JSON.parse(out)?.iat;
|
|
64
|
-
return typeof iat === 'number' ? iat : 0;
|
|
65
|
-
} catch {
|
|
66
|
-
return 0;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* A `userLogin.user` is typically a snapshot the host captured at ITS
|
|
72
|
-
* login time and re-presents verbatim on every mount, while this SDK
|
|
73
|
-
* keeps rotating the session and persisting the newest pair to
|
|
74
|
-
* `ETHORA_USER`. Taking the snapshot as-is therefore discards the live
|
|
75
|
-
* session in favour of an ever-aging copy: media goes blank the moment
|
|
76
|
-
* the snapshot has no `fileToken` (secure-files URLs 401 without it),
|
|
77
|
-
* and once the snapshot's refresh token ages out entirely the account
|
|
78
|
-
* looks dead even though the SDK held a working session all along.
|
|
79
|
-
*
|
|
80
|
-
* So, for the SAME account only, prefer whichever refresh pair was
|
|
81
|
-
* minted later (JWT `iat` decides — a host that genuinely re-logged-in
|
|
82
|
-
* hands us newer tokens and wins), and fill in a missing `fileToken`
|
|
83
|
-
* from the persisted copy either way.
|
|
84
|
-
*/
|
|
85
|
-
const adoptFresherPersistedSession = async candidate => {
|
|
86
|
-
try {
|
|
87
|
-
const stored = await secureUserStorage().get();
|
|
88
|
-
if (!stored) {
|
|
89
|
-
return candidate;
|
|
90
|
-
}
|
|
91
|
-
const sameUser = candidate._id && stored._id && candidate._id === stored._id || candidate.xmppUsername && stored.xmppUsername && candidate.xmppUsername === stored.xmppUsername;
|
|
92
|
-
if (!sameUser) {
|
|
93
|
-
return candidate;
|
|
94
|
-
}
|
|
95
|
-
const merged = {
|
|
96
|
-
...candidate
|
|
97
|
-
};
|
|
98
|
-
if (stored.refreshToken && readJwtIat(stored.refreshToken) > readJwtIat(candidate.refreshToken)) {
|
|
99
|
-
merged.refreshToken = stored.refreshToken;
|
|
100
|
-
if (stored.token) {
|
|
101
|
-
merged.token = stored.token;
|
|
102
|
-
}
|
|
103
|
-
if (stored.fileToken) {
|
|
104
|
-
merged.fileToken = stored.fileToken;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (!merged.fileToken && stored.fileToken) {
|
|
108
|
-
merged.fileToken = stored.fileToken;
|
|
109
|
-
}
|
|
110
|
-
return merged;
|
|
111
|
-
} catch {
|
|
112
|
-
return candidate;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Bootstrap rotation.
|
|
118
|
-
*
|
|
119
|
-
* Was a second, independent `/users/login/refresh` caller that bypassed
|
|
120
|
-
* every lock in the SDK — and, worse, only wrote the rotated token to
|
|
121
|
-
* the store on the happy path, so several of the early-return branches
|
|
122
|
-
* below used to drop it. Under the backend's reuse detection a dropped
|
|
123
|
-
* rotation means the next launch presents a burned token and the
|
|
124
|
-
* session is killed.
|
|
125
|
-
*
|
|
126
|
-
* `refreshAuthTokens` persists the new pair before it resolves, so by
|
|
127
|
-
* the time this returns the rotation is safe no matter which branch the
|
|
128
|
-
* caller takes afterwards. The explicit token is required here: during
|
|
129
|
-
* bootstrap the candidate session isn't in the store yet.
|
|
130
|
-
*/
|
|
131
34
|
const refreshWithToken = async refreshToken => {
|
|
132
|
-
const
|
|
133
|
-
|
|
35
|
+
const response = await http.post('/users/login/refresh', {}, {
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: refreshToken
|
|
38
|
+
}
|
|
134
39
|
});
|
|
135
40
|
return {
|
|
136
|
-
token:
|
|
137
|
-
refreshToken:
|
|
138
|
-
xmppPassword: result.xmppPassword || '',
|
|
139
|
-
fileToken: result.fileToken || ''
|
|
41
|
+
token: response?.data?.token || '',
|
|
42
|
+
refreshToken: response?.data?.refreshToken || refreshToken
|
|
140
43
|
};
|
|
141
44
|
};
|
|
142
45
|
const mergeUsers = (base, patch) => {
|
|
@@ -161,14 +64,10 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
161
64
|
}
|
|
162
65
|
let workingToken = candidate?.token || '';
|
|
163
66
|
let workingRefresh = candidate?.refreshToken || '';
|
|
164
|
-
let rotatedXmppPassword = '';
|
|
165
|
-
let workingFileToken = candidate?.fileToken || '';
|
|
166
67
|
const candidateWithCurrentTokens = () => ({
|
|
167
68
|
...candidate,
|
|
168
69
|
token: workingToken || candidate.token,
|
|
169
|
-
refreshToken: workingRefresh || candidate.refreshToken
|
|
170
|
-
xmppPassword: rotatedXmppPassword || candidate.xmppPassword,
|
|
171
|
-
fileToken: workingFileToken || candidate.fileToken
|
|
70
|
+
refreshToken: workingRefresh || candidate.refreshToken
|
|
172
71
|
});
|
|
173
72
|
const fallbackWithCreds = () => {
|
|
174
73
|
const normalized = normalizeUserForXmpp(candidateWithCurrentTokens());
|
|
@@ -187,8 +86,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
187
86
|
if (merged) {
|
|
188
87
|
merged.token = workingToken || merged.token;
|
|
189
88
|
merged.refreshToken = workingRefresh || merged.refreshToken;
|
|
190
|
-
merged.xmppPassword = rotatedXmppPassword || merged.xmppPassword;
|
|
191
|
-
merged.fileToken = workingFileToken || merged.fileToken;
|
|
192
89
|
}
|
|
193
90
|
return merged;
|
|
194
91
|
} catch (error) {
|
|
@@ -213,8 +110,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
213
110
|
const refreshed = await refreshWithToken(workingRefresh);
|
|
214
111
|
workingToken = refreshed.token;
|
|
215
112
|
workingRefresh = refreshed.refreshToken;
|
|
216
|
-
rotatedXmppPassword = refreshed.xmppPassword || rotatedXmppPassword;
|
|
217
|
-
workingFileToken = refreshed.fileToken || workingFileToken;
|
|
218
113
|
try {
|
|
219
114
|
const myUser = await getMyUser({
|
|
220
115
|
token: workingToken,
|
|
@@ -224,8 +119,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
224
119
|
if (merged) {
|
|
225
120
|
merged.token = workingToken || merged.token;
|
|
226
121
|
merged.refreshToken = workingRefresh || merged.refreshToken;
|
|
227
|
-
merged.xmppPassword = rotatedXmppPassword || merged.xmppPassword;
|
|
228
|
-
merged.fileToken = workingFileToken || merged.fileToken;
|
|
229
122
|
}
|
|
230
123
|
return merged;
|
|
231
124
|
} catch (myError) {
|
|
@@ -245,13 +138,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
245
138
|
if (signal?.aborted || isAbortError(error)) {
|
|
246
139
|
return null;
|
|
247
140
|
}
|
|
248
|
-
// A fatal refresh verdict (reuse detected / token not found / stale
|
|
249
|
-
// with nothing newer around) carries no HTTP response, so it would
|
|
250
|
-
// otherwise fall through to `throw` — the session is simply dead,
|
|
251
|
-
// which for bootstrap means "nothing to restore".
|
|
252
|
-
if (isRefreshFatalError(error)) {
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
141
|
if (isAuthError(error)) {
|
|
256
142
|
return null;
|
|
257
143
|
}
|
|
@@ -269,14 +155,14 @@ export const resolveInitBeforeLoadUser = async options => {
|
|
|
269
155
|
if (config?.baseUrl) {
|
|
270
156
|
setBaseURL(config.baseUrl, config.customAppToken);
|
|
271
157
|
}
|
|
272
|
-
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/
|
|
158
|
+
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/users/my';
|
|
273
159
|
|
|
274
160
|
// Priority 1: explicit userLogin
|
|
275
161
|
const explicitUser = config?.userLogin?.enabled ? config?.userLogin?.user : null;
|
|
276
162
|
if (explicitUser) {
|
|
277
163
|
const candidate = normalizeUserForXmpp(explicitUser);
|
|
278
164
|
if (candidate && hasXmppCredentials(candidate)) {
|
|
279
|
-
return
|
|
165
|
+
return candidate;
|
|
280
166
|
}
|
|
281
167
|
const hydrated = await tryHydrateViaMy(explicitUser, myEndpoint, signal).catch(() => null);
|
|
282
168
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
@@ -333,13 +219,13 @@ export const resolveInitBeforeLoadUser = async options => {
|
|
|
333
219
|
|
|
334
220
|
// Priority 5: persisted user in AsyncStorage
|
|
335
221
|
try {
|
|
336
|
-
const storedUser = await
|
|
222
|
+
const storedUser = await asyncLocalStorage(localStorageConstants.ETHORA_USER).get();
|
|
337
223
|
if (storedUser && (storedUser.token || storedUser.refreshToken || storedUser.xmppPassword)) {
|
|
338
224
|
const hydrated = await tryHydrateViaMy(storedUser, myEndpoint, signal).catch(() => null);
|
|
339
225
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
340
226
|
return hydrated;
|
|
341
227
|
}
|
|
342
|
-
await
|
|
228
|
+
await asyncLocalStorage(localStorageConstants.ETHORA_USER).remove();
|
|
343
229
|
}
|
|
344
230
|
} catch {
|
|
345
231
|
// ignore storage errors
|
|
@@ -393,7 +279,7 @@ export const refreshUserCredentialsForXmpp = async (config, signal) => {
|
|
|
393
279
|
// fall through to /users/my path
|
|
394
280
|
}
|
|
395
281
|
}
|
|
396
|
-
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/
|
|
282
|
+
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/users/my';
|
|
397
283
|
|
|
398
284
|
// Priority 2: redux store user (covers userLogin + customLogin +
|
|
399
285
|
// anything previously persisted into chatSettingStore.user). The
|
|
@@ -411,7 +297,7 @@ export const refreshUserCredentialsForXmpp = async (config, signal) => {
|
|
|
411
297
|
// should already mirror this, but if the redux state got cleared
|
|
412
298
|
// mid-session (logout race) this gives us one last shot.
|
|
413
299
|
try {
|
|
414
|
-
const storedUser = await
|
|
300
|
+
const storedUser = await asyncLocalStorage(localStorageConstants.ETHORA_USER).get();
|
|
415
301
|
if (storedUser && (storedUser.token || storedUser.refreshToken || storedUser.xmppPassword)) {
|
|
416
302
|
const hydrated = await tryHydrateViaMy(storedUser, myEndpoint, signal).catch(() => null);
|
|
417
303
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setBaseURL","refreshAuthTokens","isRefreshFatalError","loginViaJwt","getMyUser","store","setUser","walletToUsername","secureUserStorage","getStatusCode","error","status","response","isAuthError","code","isAbortError","message","toLowerCase","includes","hasXmppCredentials","user","Boolean","xmppPassword","xmppUsername","defaultWallet","walletAddress","normalizeUserForXmpp","normalizedXmppUsername","B64_ALPHABET","readJwtIat","token","part","split","clean","replace","out","buffer","bits","i","length","idx","indexOf","String","fromCharCode","iat","JSON","parse","adoptFresherPersistedSession","candidate","stored","get","sameUser","_id","merged","refreshToken","fileToken","refreshWithToken","result","mergeUsers","base","patch","tryHydrateViaMy","myEndpoint","signal","aborted","mergedCandidate","workingToken","workingRefresh","rotatedXmppPassword","workingFileToken","candidateWithCurrentTokens","fallbackWithCreds","normalized","myUser","endpoint","fallback","refreshed","myError","resolveInitBeforeLoadUser","options","config","baseUrl","customAppToken","initBeforeLoadAuth","explicitUser","userLogin","enabled","hydrated","catch","customLogin","loginFunction","customUser","jwtLogin","jwtUser","currentUser","getState","chatSettingStore","storedUser","remove","applyResolvedUserToStore","dispatch","refreshUserCredentialsForXmpp","fresh"],"sourceRoot":"../../../src","sources":["helpers/resolveInitBeforeLoadUser.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,yBAAyB;AACpD,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,2BAA2B;AAClF,SAASC,WAAW,QAAQ,qCAAqC;AACjE,SAASC,SAAS,QAAQ,qCAAqC;AAE/D,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,OAAO,QAAQ,gCAAgC;AACxD,SAAS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AAC,EAAE;MAAC,OAAOA,QAAQ;IAAC;EACjE;;EAEA;EACA;EACA;EACA,IAAI;IACF,MAAMU,UAAU,GAAG,MAAMzF,iBAAiB,CAAC,CAAC,CAAC0C,GAAG,CAAC,CAAC;IAClD,IACE+C,UAAU,KACTA,UAAU,CAACnE,KAAK,IAAImE,UAAU,CAAC3C,YAAY,IAAI2C,UAAU,CAAC3E,YAAY,CAAC,EACxE;MACA,MAAMiE,QAAQ,GAAG,MAAM1B,eAAe,CACpCoC,UAAU,EACVnC,UAAU,EACVC,MACF,CAAC,CAACyB,KAAK,CAAC,MAAM,IAAI,CAAC;MACnB,IAAID,QAAQ,IAAIpE,kBAAkB,CAACoE,QAAQ,CAAC,EAAE;QAAC,OAAOA,QAAQ;MAAC;IACjE;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAGF,OAAO,IAAI;AACb,CAAC;AAED,eAAeT,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["http","setBaseURL","loginViaJwt","getMyUser","store","setUser","walletToUsername","asyncLocalStorage","localStorageConstants","getStatusCode","error","status","response","isAuthError","code","isAbortError","message","toLowerCase","includes","hasXmppCredentials","user","Boolean","xmppPassword","xmppUsername","defaultWallet","walletAddress","normalizeUserForXmpp","normalizedXmppUsername","refreshWithToken","refreshToken","post","headers","Authorization","token","data","mergeUsers","base","patch","tryHydrateViaMy","candidate","myEndpoint","signal","aborted","mergedCandidate","workingToken","workingRefresh","candidateWithCurrentTokens","fallbackWithCreds","normalized","myUser","endpoint","merged","fallback","refreshed","myError","resolveInitBeforeLoadUser","options","config","baseUrl","customAppToken","initBeforeLoadAuth","explicitUser","userLogin","enabled","hydrated","catch","customLogin","loginFunction","customUser","jwtLogin","jwtUser","currentUser","getState","chatSettingStore","storedUser","ETHORA_USER","get","remove","applyResolvedUserToStore","dispatch","refreshUserCredentialsForXmpp","fresh"],"sourceRoot":"../../../src","sources":["helpers/resolveInitBeforeLoadUser.ts"],"mappings":";;AAAA,OAAOA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;MAAC;IACjE;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAGF,OAAO,IAAI;AACb,CAAC;AAED,eAAeT,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Legacy single-locale config (`translates.translations`) seeds langSource
|
|
5
|
+
* only when the host ACTUALLY set it.
|
|
6
|
+
*
|
|
7
|
+
* The condition used to be inverted (`!translates.translations`), so merely
|
|
8
|
+
* enabling translation fired `setLangSource(undefined)` on every XMPP init
|
|
9
|
+
* and wiped whatever the reader had picked from the globe — the language
|
|
10
|
+
* reset itself on every reconnect. Web fixed this; RN had not.
|
|
11
|
+
*/
|
|
12
|
+
export const resolveLegacyTranslatesLangSource = translatesConfig => translatesConfig?.enabled && translatesConfig?.translations ? translatesConfig.translations : undefined;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A host drives the reader's language from OUTSIDE the component by setting
|
|
16
|
+
* `config.translates.readerLocale` (their own language switcher, or the
|
|
17
|
+
* testbed's Setup tab). Nothing was syncing it into `langSource`, so pinning
|
|
18
|
+
* it only redirected the incoming-translation lookup: the UI captions and
|
|
19
|
+
* the `<translate source>` on outgoing messages both kept following the
|
|
20
|
+
* unset `langSource`.
|
|
21
|
+
*
|
|
22
|
+
* Unlike web this keeps the FULL locale rather than the base language. RN's
|
|
23
|
+
* LANGUAGE_OPTIONS are region-tagged (`es-US`, `fr-CA`) because the region
|
|
24
|
+
* is forwarded to the translation service, and the in-chat picker stores
|
|
25
|
+
* that full form — so the external path has to store the same thing or the
|
|
26
|
+
* two would disagree. Caption lookups strip to the base themselves.
|
|
27
|
+
*
|
|
28
|
+
* Resolves only when actually set, so a host that leaves it unset never
|
|
29
|
+
* clobbers what the reader chose for themselves.
|
|
30
|
+
*/
|
|
31
|
+
export const resolveExternalReaderLocaleLangSource = readerLocale => readerLocale || undefined;
|
|
32
|
+
//# sourceMappingURL=resolveLangSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveLegacyTranslatesLangSource","translatesConfig","enabled","translations","undefined","resolveExternalReaderLocaleLangSource","readerLocale"],"sourceRoot":"../../../src","sources":["helpers/resolveLangSource.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iCAAiC,GAC5CC,gBAAwC,IAExCA,gBAAgB,EAAEC,OAAO,IAAID,gBAAgB,EAAEE,YAAY,GACvDF,gBAAgB,CAACE,YAAY,GAC7BC,SAAS;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qCAAqC,GAChDC,YAAqB,IAEpBA,YAAY,IAAIF,SAAuC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { store } from '../roomStore';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Collapse a duplicated `<appId>_` prefix down to one.
|
|
7
|
+
*
|
|
8
|
+
* Ported from the web SDK (src/helpers/xmppUsername.ts). Some senders stamp
|
|
9
|
+
* an already-qualified username and it gets qualified a second time, which
|
|
10
|
+
* yields `<appId>_<appId>_<userId>` — a key `usersSet` will never match.
|
|
11
|
+
*
|
|
12
|
+
* RN reads the appId off the logged-in user's own xmppUsername
|
|
13
|
+
* (`<appId>_<userId>`) since the chat store has no standalone `appId` field
|
|
14
|
+
* the way web's does.
|
|
15
|
+
*/
|
|
16
|
+
export const normalizeXmppUsername = value => {
|
|
17
|
+
if (!value) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
let result = String(value).trim();
|
|
21
|
+
if (!result) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
const ownXmpp = String(store.getState().chatSettingStore?.user?.xmppUsername || '');
|
|
25
|
+
const appId = ownXmpp.includes('_') ? ownXmpp.split('_')[0] : '';
|
|
26
|
+
if (!appId) {
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
const prefix = `${appId}_`;
|
|
30
|
+
while (result.startsWith(prefix + prefix)) {
|
|
31
|
+
result = result.slice(prefix.length);
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=xmppUsername.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["store","normalizeXmppUsername","value","result","String","trim","ownXmpp","getState","chatSettingStore","user","xmppUsername","appId","includes","split","prefix","startsWith","slice","length"],"sourceRoot":"../../../src","sources":["helpers/xmppUsername.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,cAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAChCC,KAAgC,IACrB;EACX,IAAI,CAACA,KAAK,EAAE;IACV,OAAO,EAAE;EACX;EACA,IAAIC,MAAM,GAAGC,MAAM,CAACF,KAAK,CAAC,CAACG,IAAI,CAAC,CAAC;EACjC,IAAI,CAACF,MAAM,EAAE;IACX,OAAO,EAAE;EACX;EAEA,MAAMG,OAAO,GAAGF,MAAM,CACpBJ,KAAK,CAACO,QAAQ,CAAC,CAAC,CAACC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,IAAI,EAC3D,CAAC;EACD,MAAMC,KAAK,GAAGL,OAAO,CAACM,QAAQ,CAAC,GAAG,CAAC,GAAGN,OAAO,CAACO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;EAChE,IAAI,CAACF,KAAK,EAAE;IACV,OAAOR,MAAM;EACf;EAEA,MAAMW,MAAM,GAAG,GAAGH,KAAK,GAAG;EAC1B,OAAOR,MAAM,CAACY,UAAU,CAACD,MAAM,GAAGA,MAAM,CAAC,EAAE;IACzCX,MAAM,GAAGA,MAAM,CAACa,KAAK,CAACF,MAAM,CAACG,MAAM,CAAC;EACtC;EACA,OAAOd,MAAM;AACf,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,6 @@ import { useEffect, useRef } from 'react';
|
|
|
4
4
|
import { useDispatch } from 'react-redux';
|
|
5
5
|
import { clearVisibleRoom, setCurrentRoom, setLastViewedTimestamp, setVisibleRoom } from '../roomStore/roomsSlice';
|
|
6
6
|
import { store } from '../roomStore';
|
|
7
|
-
import { getServerReadTimestamp } from '../helpers/getServerReadTimestamp';
|
|
8
7
|
/**
|
|
9
8
|
* Public hook for consumers embedding `<ChatRoom>` inside a tab-based
|
|
10
9
|
* navigator. Mirrors the mount/unmount unread-tracking that ChatRoom
|
|
@@ -15,10 +14,7 @@ import { getServerReadTimestamp } from '../helpers/getServerReadTimestamp';
|
|
|
15
14
|
* Without this hook, `useUnread()` will always return 0 for the chat
|
|
16
15
|
* room because the SDK assumes "mounted == active". With this hook,
|
|
17
16
|
* focus marks the room visible (clearing the badge) and blur stamps
|
|
18
|
-
* `lastViewedTimestamp`
|
|
19
|
-
* future messages count as unread. Deliberately not `Date.now()`: a
|
|
20
|
-
* device clock running ahead would write a future marker that the
|
|
21
|
-
* forward-only private-store merge could never correct again (bug #38).
|
|
17
|
+
* `lastViewedTimestamp = Date.now()` so future messages count as unread.
|
|
22
18
|
*
|
|
23
19
|
* Usage with React Navigation:
|
|
24
20
|
*
|
|
@@ -44,19 +40,14 @@ export const useChatRoomFocus = ({
|
|
|
44
40
|
isFocused: false
|
|
45
41
|
});
|
|
46
42
|
const leaveRoom = jid => {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (timestamp > 0) {
|
|
53
|
-
dispatch(setLastViewedTimestamp({
|
|
54
|
-
chatJID: jid,
|
|
55
|
-
timestamp
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
43
|
+
const timestamp = Date.now();
|
|
44
|
+
dispatch(setLastViewedTimestamp({
|
|
45
|
+
chatJID: jid,
|
|
46
|
+
timestamp
|
|
47
|
+
}));
|
|
58
48
|
dispatch(clearVisibleRoom());
|
|
59
|
-
|
|
49
|
+
const rooms = store.getState().rooms?.rooms;
|
|
50
|
+
store.getState().chatSettingStore?.client?.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
60
51
|
visibleRoomJID: jid
|
|
61
52
|
}).catch(() => {});
|
|
62
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useDispatch","clearVisibleRoom","setCurrentRoom","setLastViewedTimestamp","setVisibleRoom","store","
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useDispatch","clearVisibleRoom","setCurrentRoom","setLastViewedTimestamp","setVisibleRoom","store","useChatRoomFocus","roomJID","isFocused","dispatch","prevRef","leaveRoom","jid","timestamp","Date","now","chatJID","rooms","getState","chatSettingStore","client","flushLastViewedToPrivateStoreStanza","visibleRoomJID","catch","prev","current"],"sourceRoot":"../../../src","sources":["hooks/useChatRoomFocus.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,gBAAgB,EAChBC,cAAc,EACdC,sBAAsB,EACtBC,cAAc,QACT,yBAAyB;AAChC,SAASC,KAAK,QAAQ,cAAc;AAgBpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,OAAO;EACPC;AACuB,CAAC,KAAK;EAC7B,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B,MAAMU,OAAO,GAAGX,MAAM,CAAiD;IACrEQ,OAAO,EAAE,IAAI;IACbC,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,MAAMG,SAAS,GAAIC,GAAW,IAAK;IACjC,MAAMC,SAAS,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,CAACjB,OAAO,CAAC;MACzB;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAED,eAAeD,gBAAgB","ignoreList":[]}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { useDispatch, useSelector } from 'react-redux';
|
|
7
|
+
import { resolveLegacyTranslatesLangSource } from '../helpers/resolveLangSource';
|
|
7
8
|
import { useXmppClient } from '../context/xmppProvider';
|
|
8
9
|
import { chatAutoEnterer } from '../helpers/chatAutoEnterer';
|
|
9
10
|
import { initRoomsPresence } from '../helpers/initRoomsPresence';
|
|
11
|
+
import { updatedChatLastTimestamps } from '../helpers/updatedChatLastTimestamps';
|
|
10
12
|
import { updateMessagesTillLast } from '../helpers/updateMessagesTillLast';
|
|
11
|
-
import {
|
|
13
|
+
import { refresh } from '../networking/apiClient';
|
|
12
14
|
import { setLangSource, setConfig } from '../roomStore/chatSettingsSlice';
|
|
13
15
|
import { setIsLoading } from '../roomStore/roomsSlice';
|
|
14
16
|
import { useRoomState } from './useRoomState';
|
|
@@ -16,7 +18,6 @@ import { useChatSettingState } from './useChatSettingState';
|
|
|
16
18
|
import { isChatIdPresentInArray } from '../helpers/isChatIdPresentInArray';
|
|
17
19
|
import useGetNewArchRoom from './useGetNewArchRoom';
|
|
18
20
|
import { getRoomsWithRetry } from '../helpers/getRoomsWithRetry';
|
|
19
|
-
import { shallowEqual } from '../helpers/shallowEqual';
|
|
20
21
|
const useChatWrapperInit = ({
|
|
21
22
|
roomJID,
|
|
22
23
|
wasAutoSelected,
|
|
@@ -52,20 +53,6 @@ const useChatWrapperInit = ({
|
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
}, [user.xmppPassword]);
|
|
55
|
-
|
|
56
|
-
// Presentational config flags (e.g. `disableHeader`) can change while the
|
|
57
|
-
// chat stays mounted — sync them to redux whenever `config` actually
|
|
58
|
-
// changes, not just at init. Shallow-equal guard: an inline object
|
|
59
|
-
// literal from the host is a fresh reference every render even when
|
|
60
|
-
// nothing in it changed, and dispatching unconditionally would re-render
|
|
61
|
-
// every config consumer on every host render.
|
|
62
|
-
const lastSyncedConfigRef = useRef(undefined);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (!shallowEqual(lastSyncedConfigRef.current, config)) {
|
|
65
|
-
lastSyncedConfigRef.current = config;
|
|
66
|
-
dispatch(setConfig(config));
|
|
67
|
-
}
|
|
68
|
-
}, [config, dispatch]);
|
|
69
56
|
const getRoomsWithRertyRequest = async () => {
|
|
70
57
|
setIsRetrying(true);
|
|
71
58
|
const retryRooms = await getRoomsWithRetry(client, config, syncRooms, roomJID);
|
|
@@ -90,8 +77,9 @@ const useChatWrapperInit = ({
|
|
|
90
77
|
useEffect(() => {
|
|
91
78
|
let retryTimeout;
|
|
92
79
|
const initXmmpClient = async () => {
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
const legacyLangSource = resolveLegacyTranslatesLangSource(config?.translates);
|
|
81
|
+
if (legacyLangSource) {
|
|
82
|
+
dispatch(setLangSource(legacyLangSource));
|
|
95
83
|
}
|
|
96
84
|
dispatch(setConfig(config));
|
|
97
85
|
try {
|
|
@@ -135,17 +123,11 @@ const useChatWrapperInit = ({
|
|
|
135
123
|
}
|
|
136
124
|
}
|
|
137
125
|
try {
|
|
138
|
-
// getChatsPrivateStoreRequestStanza hydrates redux itself
|
|
139
|
-
// (dispatch(applyPrivateStoreMarkers(...)) internally,
|
|
140
|
-
// clamped + forward-only) - do not also apply the raw
|
|
141
|
-
// return value here. That used to double-dispatch via
|
|
142
|
-
// updatedChatLastTimestamps' unconditional
|
|
143
|
-
// setLastViewedTimestamp, which has neither the
|
|
144
|
-
// forward-only guard nor the future-marker clamp, so on
|
|
145
|
-
// every reconnect it could silently re-clobber a value
|
|
146
|
-
// the clamp had just corrected (bug #38).
|
|
147
126
|
const roomTimestampObject = await newClient.getChatsPrivateStoreRequestStanza();
|
|
148
127
|
console.log('Got chats private store', roomTimestampObject?.length || 0);
|
|
128
|
+
if (roomTimestampObject) {
|
|
129
|
+
updatedChatLastTimestamps(roomTimestampObject, dispatch);
|
|
130
|
+
}
|
|
149
131
|
if (!hasSyncedHistoryRef.current) {
|
|
150
132
|
console.log('Updating messages till last');
|
|
151
133
|
await updateMessagesTillLast(rooms, newClient);
|
|
@@ -160,7 +142,7 @@ const useChatWrapperInit = ({
|
|
|
160
142
|
setConnectionLost(false);
|
|
161
143
|
}
|
|
162
144
|
{
|
|
163
|
-
config?.refreshTokens?.enabled &&
|
|
145
|
+
config?.refreshTokens?.enabled && refresh();
|
|
164
146
|
}
|
|
165
147
|
} catch (error) {
|
|
166
148
|
console.error(' Error during initialization', error);
|
|
@@ -180,11 +162,11 @@ const useChatWrapperInit = ({
|
|
|
180
162
|
setInited(true);
|
|
181
163
|
console.log(' Getting chats private store for existing client');
|
|
182
164
|
try {
|
|
183
|
-
// See the "new client" branch above: getChatsPrivateStoreRequestStanza
|
|
184
|
-
// already hydrates redux (clamped + forward-only); do not
|
|
185
|
-
// also apply the raw return value here.
|
|
186
165
|
const roomTimestampObject = await client.getChatsPrivateStoreRequestStanza();
|
|
187
166
|
console.log('Got chats private store for existing client', roomTimestampObject?.length || 0);
|
|
167
|
+
if (roomTimestampObject) {
|
|
168
|
+
updatedChatLastTimestamps(roomTimestampObject, dispatch);
|
|
169
|
+
}
|
|
188
170
|
if (!hasSyncedHistoryRef.current) {
|
|
189
171
|
console.log('Updating messages till last for existing client');
|
|
190
172
|
await updateMessagesTillLast(rooms, client);
|
|
@@ -199,7 +181,7 @@ const useChatWrapperInit = ({
|
|
|
199
181
|
setConnectionLost(false);
|
|
200
182
|
}
|
|
201
183
|
{
|
|
202
|
-
config?.refreshTokens?.enabled &&
|
|
184
|
+
config?.refreshTokens?.enabled && refresh();
|
|
203
185
|
}
|
|
204
186
|
}
|
|
205
187
|
}
|