@ethora/chat-component-rn 26.7.10 → 26.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -96
- package/README.md +10 -43
- package/lib/commonjs/assets/icons.js +2 -7
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +7 -26
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +3 -9
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +14 -150
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +38 -34
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +1 -2
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +9 -29
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +1 -5
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +5 -13
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +24 -3
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +35 -208
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -317
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageTranslate.js +16 -7
- package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +112 -320
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +215 -556
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +27 -69
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +1 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +109 -205
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +39 -23
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -22
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -17
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +3 -6
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +1 -2
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +10 -3
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +9 -37
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/NewMessageLabel.js +3 -1
- package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +17 -86
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +3 -9
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +4 -14
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +61 -119
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +59 -177
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +1 -19
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/commonjs/helpers/getDataFromXml.js +24 -1
- package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
- package/lib/commonjs/helpers/historyPreloadScheduler.js +2 -65
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +8 -14
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +22 -51
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isUnresolvedSenderId.js +6 -1
- package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -1
- package/lib/commonjs/helpers/keyboardLayout.js +2 -12
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mimeToExtension.js +14 -6
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +17 -130
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/resolveLangSource.js +38 -0
- package/lib/commonjs/helpers/resolveLangSource.js.map +1 -0
- package/lib/commonjs/helpers/xmppUsername.js +39 -0
- package/lib/commonjs/helpers/xmppUsername.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +12 -45
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +14 -32
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +0 -27
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +7 -23
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +11 -8
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +14 -50
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -6
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +133 -121
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/i18n/useT.js +1 -1
- package/lib/commonjs/main.js +0 -44
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +60 -134
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +9 -68
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +112 -62
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +51 -93
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +1 -8
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +8 -124
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -26
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +2 -35
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +39 -226
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +38 -151
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +13 -15
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/version.js +3 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/assets/icons.js +1 -6
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +7 -26
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +3 -9
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +16 -152
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +40 -36
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +1 -2
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +10 -30
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +1 -5
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +5 -13
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +26 -5
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +35 -207
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -319
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageTranslate.js +16 -7
- package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +115 -311
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +219 -559
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +28 -70
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +1 -2
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +1 -9
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +111 -208
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +2 -9
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +40 -24
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -22
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -17
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +3 -6
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +1 -2
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +10 -3
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +9 -37
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/NewMessageLabel.js +3 -1
- package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +18 -87
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +3 -9
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +4 -14
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +62 -120
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +60 -177
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +1 -19
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/module/helpers/getDataFromXml.js +23 -1
- package/lib/module/helpers/getDataFromXml.js.map +1 -1
- package/lib/module/helpers/historyPreloadScheduler.js +3 -66
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +8 -14
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +22 -52
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isUnresolvedSenderId.js +6 -1
- package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -1
- package/lib/module/helpers/keyboardLayout.js +2 -12
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mimeToExtension.js +13 -6
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/resolveInitBeforeLoadUser.js +16 -130
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/resolveLangSource.js +32 -0
- package/lib/module/helpers/resolveLangSource.js.map +1 -0
- package/lib/module/helpers/xmppUsername.js +35 -0
- package/lib/module/helpers/xmppUsername.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +13 -46
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +14 -32
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +1 -28
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useLogout.js +7 -23
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +11 -8
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +16 -52
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +1 -6
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +133 -121
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/i18n/useT.js +1 -1
- package/lib/module/main.js +2 -14
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +59 -131
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +7 -64
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +113 -61
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +52 -94
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +1 -8
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +8 -124
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +7 -26
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +4 -37
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +38 -223
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +34 -139
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +13 -15
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/version.js +3 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +0 -16
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LoginWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +1 -10
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +0 -7
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +0 -14
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +0 -8
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts +1 -5
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mimeToExtension.d.ts +15 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/resolveLangSource.d.ts +30 -0
- package/lib/typescript/helpers/resolveLangSource.d.ts.map +1 -0
- package/lib/typescript/helpers/xmppUsername.d.ts +13 -0
- package/lib/typescript/helpers/xmppUsername.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +1 -4
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +0 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/i18n/useT.d.ts +1 -1
- package/lib/typescript/main.d.ts +2 -9
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +1 -3
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts +6 -12
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +2 -10
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +0 -14
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +0 -16
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +1 -18
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +3 -43
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +5 -50
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +29 -41
- package/src/assets/icons.tsx +9 -48
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +6 -24
- package/src/components/MainComponents/ChatHeader.tsx +3 -9
- package/src/components/MainComponents/ChatRoom.tsx +15 -161
- package/src/components/MainComponents/ChatWrapper.tsx +53 -36
- package/src/components/MainComponents/LoginWrapper.tsx +0 -1
- package/src/components/MainComponents/MediaMessage.tsx +8 -26
- package/src/components/MainComponents/MessageContainer.tsx +1 -5
- package/src/components/MainComponents/MessageList.tsx +4 -23
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
- package/src/components/MainComponents/ReduxWrapper.tsx +18 -1
- package/src/components/MainComponents/RoomList.tsx +39 -236
- package/src/components/Menu/HeaderRoomListMenu.tsx +75 -328
- package/src/components/MessageBubble/MessageTranslate.tsx +17 -12
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +99 -331
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +293 -611
- package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +9 -7
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +38 -79
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +1 -2
- package/src/components/Modals/Modal/Modal.tsx +0 -7
- package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +126 -223
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
- package/src/components/Modals/styledModalComponents.tsx +2 -9
- package/src/components/RoomComponents/ChatRoomItem.tsx +50 -21
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +4 -28
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +3 -18
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +3 -18
- package/src/components/VideoCalls/VideoCallSession.tsx +3 -8
- package/src/components/styled/AudioMessage.tsx +1 -2
- package/src/components/styled/DateLabel.tsx +10 -3
- package/src/components/styled/MessageImage.tsx +7 -53
- package/src/components/styled/NewMessageLabel.tsx +3 -1
- package/src/components/styled/SendInput.tsx +18 -91
- package/src/components/styled/StyledComponents.ts +3 -9
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
- package/src/components/styled/UnsupportedType.tsx +4 -14
- package/src/components/styled/VideoMessage.tsx +54 -131
- package/src/context/xmppProvider.tsx +57 -209
- package/src/helpers/createMessageFromXml.ts +1 -20
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getDataFromXml.ts +25 -1
- package/src/helpers/historyPreloadScheduler.ts +3 -80
- package/src/helpers/initXmppRooms.tsx +10 -14
- package/src/helpers/insertMessageWithDelimiter.ts +32 -55
- package/src/helpers/isUnresolvedSenderId.ts +9 -1
- package/src/helpers/keyboardLayout.ts +2 -23
- package/src/helpers/mimeToExtension.ts +22 -6
- package/src/helpers/resolveInitBeforeLoadUser.ts +18 -125
- package/src/helpers/resolveLangSource.ts +40 -0
- package/src/helpers/xmppUsername.ts +38 -0
- package/src/hooks/useChatRoomFocus.ts +9 -49
- package/src/hooks/useChatWrapperInit.ts +16 -32
- package/src/hooks/useComposing.tsx +1 -37
- package/src/hooks/useLogout.tsx +9 -29
- package/src/hooks/usePendingNotification.ts +11 -5
- package/src/hooks/useSendMessage.tsx +15 -60
- package/src/hooks/useUnreadMessagesCounter.ts +0 -11
- package/src/i18n/strings.ts +133 -121
- package/src/i18n/useT.ts +1 -1
- package/src/main.ts +2 -26
- package/src/networking/api-requests/auth.api.ts +48 -156
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +7 -79
- package/src/networking/apiClient.ts +123 -68
- package/src/networking/stanzaHandlers.ts +51 -92
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +10 -71
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +1 -6
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +1 -12
- package/src/networking/xmppClient.ts +9 -141
- package/src/roomStore/chatSettingsSlice.ts +10 -34
- package/src/roomStore/index.ts +4 -40
- package/src/roomStore/persistence.ts +40 -234
- package/src/roomStore/roomsSlice.ts +29 -161
- package/src/services/pushSubscriptionService.ts +13 -18
- package/src/types/types.ts +5 -72
- package/src/version.ts +3 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/commonjs/helpers/getChatBackground.js +0 -23
- package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
- package/lib/commonjs/helpers/getDisplayFileName.js +0 -79
- package/lib/commonjs/helpers/getDisplayFileName.js.map +0 -1
- package/lib/commonjs/helpers/getServerReadTimestamp.js +0 -188
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +0 -1
- package/lib/commonjs/helpers/isOwnMessage.js +0 -75
- package/lib/commonjs/helpers/isOwnMessage.js.map +0 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/commonjs/helpers/msgSortableMs.js +0 -37
- package/lib/commonjs/helpers/msgSortableMs.js.map +0 -1
- package/lib/commonjs/helpers/persistCrypto.js +0 -122
- package/lib/commonjs/helpers/persistCrypto.js.map +0 -1
- package/lib/commonjs/helpers/pickImageAsset.js +0 -68
- package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
- package/lib/commonjs/helpers/pushPayload.js +0 -71
- package/lib/commonjs/helpers/pushPayload.js.map +0 -1
- package/lib/commonjs/helpers/secureFileUrl.js +0 -101
- package/lib/commonjs/helpers/secureFileUrl.js.map +0 -1
- package/lib/commonjs/helpers/secureKeyValue.js +0 -83
- package/lib/commonjs/helpers/secureKeyValue.js.map +0 -1
- package/lib/commonjs/helpers/secureStoreRuntime.js +0 -59
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +0 -1
- package/lib/commonjs/helpers/secureUserStorage.js +0 -75
- package/lib/commonjs/helpers/secureUserStorage.js.map +0 -1
- package/lib/commonjs/helpers/shallowEqual.js +0 -36
- package/lib/commonjs/helpers/shallowEqual.js.map +0 -1
- package/lib/commonjs/helpers/sheetGestures.js +0 -32
- package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
- package/lib/commonjs/hooks/useFileToken.js +0 -10
- package/lib/commonjs/hooks/useFileToken.js.map +0 -1
- package/lib/commonjs/networking/authRefresh.js +0 -332
- package/lib/commonjs/networking/authRefresh.js.map +0 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/module/helpers/getChatBackground.js +0 -18
- package/lib/module/helpers/getChatBackground.js.map +0 -1
- package/lib/module/helpers/getDisplayFileName.js +0 -73
- package/lib/module/helpers/getDisplayFileName.js.map +0 -1
- package/lib/module/helpers/getServerReadTimestamp.js +0 -181
- package/lib/module/helpers/getServerReadTimestamp.js.map +0 -1
- package/lib/module/helpers/isOwnMessage.js +0 -70
- package/lib/module/helpers/isOwnMessage.js.map +0 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
- package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/module/helpers/msgSortableMs.js +0 -32
- package/lib/module/helpers/msgSortableMs.js.map +0 -1
- package/lib/module/helpers/persistCrypto.js +0 -115
- package/lib/module/helpers/persistCrypto.js.map +0 -1
- package/lib/module/helpers/pickImageAsset.js +0 -63
- package/lib/module/helpers/pickImageAsset.js.map +0 -1
- package/lib/module/helpers/pushPayload.js +0 -63
- package/lib/module/helpers/pushPayload.js.map +0 -1
- package/lib/module/helpers/secureFileUrl.js +0 -91
- package/lib/module/helpers/secureFileUrl.js.map +0 -1
- package/lib/module/helpers/secureKeyValue.js +0 -75
- package/lib/module/helpers/secureKeyValue.js.map +0 -1
- package/lib/module/helpers/secureStoreRuntime.js +0 -52
- package/lib/module/helpers/secureStoreRuntime.js.map +0 -1
- package/lib/module/helpers/secureUserStorage.js +0 -72
- package/lib/module/helpers/secureUserStorage.js.map +0 -1
- package/lib/module/helpers/shallowEqual.js +0 -31
- package/lib/module/helpers/shallowEqual.js.map +0 -1
- package/lib/module/helpers/sheetGestures.js +0 -26
- package/lib/module/helpers/sheetGestures.js.map +0 -1
- package/lib/module/hooks/useFileToken.js +0 -5
- package/lib/module/hooks/useFileToken.js.map +0 -1
- package/lib/module/networking/authRefresh.js +0 -321
- package/lib/module/networking/authRefresh.js.map +0 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
- package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
- package/lib/typescript/helpers/getDisplayFileName.d.ts +0 -49
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +0 -1
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +0 -108
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +0 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +0 -36
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +0 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +0 -2
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +0 -1
- package/lib/typescript/helpers/persistCrypto.d.ts +0 -13
- package/lib/typescript/helpers/persistCrypto.d.ts.map +0 -1
- package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
- package/lib/typescript/helpers/pushPayload.d.ts +0 -7
- package/lib/typescript/helpers/pushPayload.d.ts.map +0 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +0 -7
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +0 -1
- package/lib/typescript/helpers/secureKeyValue.d.ts +0 -13
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +0 -1
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +0 -29
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/secureUserStorage.d.ts +0 -23
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +0 -1
- package/lib/typescript/helpers/shallowEqual.d.ts +0 -11
- package/lib/typescript/helpers/shallowEqual.d.ts.map +0 -1
- package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
- package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
- package/lib/typescript/hooks/useFileToken.d.ts +0 -2
- package/lib/typescript/hooks/useFileToken.d.ts.map +0 -1
- package/lib/typescript/networking/authRefresh.d.ts +0 -95
- package/lib/typescript/networking/authRefresh.d.ts.map +0 -1
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
- package/src/helpers/getChatBackground.ts +0 -18
- package/src/helpers/getDisplayFileName.ts +0 -87
- package/src/helpers/getServerReadTimestamp.ts +0 -197
- package/src/helpers/isOwnMessage.ts +0 -90
- package/src/helpers/mediaLibraryRuntime.ts +0 -25
- package/src/helpers/msgSortableMs.ts +0 -25
- package/src/helpers/persistCrypto.ts +0 -127
- package/src/helpers/pickImageAsset.ts +0 -68
- package/src/helpers/pushPayload.ts +0 -62
- package/src/helpers/secureFileUrl.ts +0 -103
- package/src/helpers/secureKeyValue.ts +0 -80
- package/src/helpers/secureStoreRuntime.ts +0 -62
- package/src/helpers/secureUserStorage.ts +0 -80
- package/src/helpers/shallowEqual.ts +0 -33
- package/src/helpers/sheetGestures.ts +0 -25
- package/src/hooks/useFileToken.ts +0 -7
- package/src/networking/authRefresh.ts +0 -451
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_dateComparison","require","
|
|
1
|
+
{"version":3,"names":["_dateComparison","require","deepMerge","target","source","key","undefined","Array","isArray","insertMessageWithDelimiter","roomMessages","message","lastViewedTimestamp","existingIndex","findIndex","msg","id","xmppId","existing","preservedUserId","user","merged","pending","newMessageDate","date","lastMessage","length","firstMessage","isDateAfter","toString","index","push","some","delimiterIndex","firstUnreadMs","Date","parse","String","rawLastViewed","lastViewedMs","Number","now","anchorMs","isFinite","splice","name","token","refreshToken","toISOString","body","roomJid","isDateBefore","unshift","i"],"sourceRoot":"../../../src","sources":["helpers/insertMessageWithDelimiter.ts"],"mappings":";;;;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AAEA,SAASC,SAASA,CAACC,MAAW,EAAEC,MAAW,EAAO;EAChD,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACC,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;IACF;IACA,IACEF,MAAM,CAACC,GAAG,CAAC,IACX,OAAOD,MAAM,CAACC,GAAG,CAAC,KAAK,QAAQ,IAC/B,CAACE,KAAK,CAACC,OAAO,CAACJ,MAAM,CAACC,GAAG,CAAC,CAAC,EAC3B;MACAF,MAAM,CAACE,GAAG,CAAC,GAAGH,SAAS,CAACC,MAAM,CAACE,GAAG,CAAC,IAAI,CAAC,CAAC,EAAED,MAAM,CAACC,GAAG,CAAC,CAAC;IACzD,CAAC,MAAM;MACLF,MAAM,CAACE,GAAG,CAAC,GAAGD,MAAM,CAACC,GAAG,CAAC;IAC3B;EACF;EACA,OAAOF,MAAM;AACf;AAEO,SAASM,0BAA0BA,CACxCC,YAAiC,EACjCC,OAAiB,EACjBC,mBAAsD,EACtD;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AAM,CAACX,cAAc,EAAE,CAAC,EAAE;UACrCjB,EAAE,EAAE,eAAe;UACnBI,IAAI,EAAE;YACJJ,EAAE,EAAE,QAAQ;YACZ6B,IAAI,EAAEvC,SAAS;YACfwC,KAAK,EAAE,EAAE;YACTC,YAAY,EAAE;UAChB,CAAC;UACDvB,IAAI,EAAE,IAAIW,IAAI,CAACO,QAAQ,CAAC,CAACM,WAAW,CAAC,CAAC;UACtCC,IAAI,EAAE,cAAc;UACpBC,OAAO,EAAE;QACX,CAAC,CAAC;MACJ;IACA;EACJ,CAAC,MAAM,IACL,IAAAC,4BAAY,EAAC5B,cAAc,CAACM,QAAQ,CAAC,CAAC,EAAEF,YAAY,EAAEH,IAAI,EAAEK,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAC7E;IACAnB,YAAY,CAAC0C,OAAO,CAACzC,OAAO,CAAC;EAC/B,CAAC,MAAM;IACL,KAAK,IAAI0C,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG3C,YAAY,CAACgB,MAAM,EAAE2B,CAAC,EAAE,EAAE;MAC5C,IACE,IAAAF,4BAAY,EAAC5B,cAAc,CAACM,QAAQ,CAAC,CAAC,EAAEnB,YAAY,CAAC2C,CAAC,CAAC,CAAC7B,IAAI,EAAEK,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAC/E;QACAnB,YAAY,CAACkC,MAAM,CAACS,CAAC,EAAE,CAAC,EAAE1C,OAAO,CAAC;QAClC;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -20,7 +20,12 @@ exports.isUnresolvedSenderId = void 0;
|
|
|
20
20
|
* matches. A raw objectId on its own is matched too, since some senders
|
|
21
21
|
* carry only that half.
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const ETHORA_ID_PART = '[0-9a-f]{24}(?:_[0-9a-f]{24})?';
|
|
24
|
+
// A private (1:1) room's own id is two of those joined by a hyphen —
|
|
25
|
+
// `<appId>_<userA>-<appId>_<userB>` — and that is what a message whose
|
|
26
|
+
// `from` carries no occupant resource resolves to. Matched as well, so a
|
|
27
|
+
// bubble is never captioned with a room id.
|
|
28
|
+
const ETHORA_ID = new RegExp(`^${ETHORA_ID_PART}(?:-${ETHORA_ID_PART})?$`, 'i');
|
|
24
29
|
const isUnresolvedSenderId = name => {
|
|
25
30
|
const trimmed = String(name || '').trim();
|
|
26
31
|
if (!trimmed) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ETHORA_ID","isUnresolvedSenderId","name","trimmed","String","trim","test","exports"],"sourceRoot":"../../../src","sources":["helpers/isUnresolvedSenderId.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,
|
|
1
|
+
{"version":3,"names":["ETHORA_ID_PART","ETHORA_ID","RegExp","isUnresolvedSenderId","name","trimmed","String","trim","test","exports"],"sourceRoot":"../../../src","sources":["helpers/isUnresolvedSenderId.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,gCAAgC;AACvD;AACA;AACA;AACA;AACA,MAAMC,SAAS,GAAG,IAAIC,MAAM,CAC1B,IAAIF,cAAc,OAAOA,cAAc,KAAK,EAC5C,GACF,CAAC;AAEM,MAAMG,oBAAoB,GAAIC,IAAa,IAAc;EAC9D,MAAMC,OAAO,GAAGC,MAAM,CAACF,IAAI,IAAI,EAAE,CAAC,CAACG,IAAI,CAAC,CAAC;EACzC,IAAI,CAACF,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EACA,OAAOJ,SAAS,CAACO,IAAI,CAACH,OAAO,CAAC;AAChC,CAAC;AAACI,OAAA,CAAAN,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -14,17 +14,7 @@ exports.getKeyboardVerticalOffset = getKeyboardVerticalOffset;
|
|
|
14
14
|
const getInputDockPaddingBottom = ({
|
|
15
15
|
platform,
|
|
16
16
|
bottomInset = 0,
|
|
17
|
-
keyboardVisible = false
|
|
18
|
-
|
|
19
|
-
hostOwnsLayout = false
|
|
20
|
-
}) => {
|
|
21
|
-
if (typeof configuredPadding === 'number') {
|
|
22
|
-
return configuredPadding;
|
|
23
|
-
}
|
|
24
|
-
if (hostOwnsLayout) {
|
|
25
|
-
return 0;
|
|
26
|
-
}
|
|
27
|
-
return platform === 'ios' ? bottomInset : ANDROID_INPUT_DOCK_GAP;
|
|
28
|
-
};
|
|
17
|
+
keyboardVisible = false
|
|
18
|
+
}) => platform === 'ios' ? bottomInset : ANDROID_INPUT_DOCK_GAP;
|
|
29
19
|
exports.getInputDockPaddingBottom = getInputDockPaddingBottom;
|
|
30
20
|
//# sourceMappingURL=keyboardLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ANDROID_INPUT_DOCK_GAP","exports","getKeyboardVerticalOffset","platform","configuredOffset","bottomInset","getInputDockPaddingBottom","keyboardVisible"
|
|
1
|
+
{"version":3,"names":["ANDROID_INPUT_DOCK_GAP","exports","getKeyboardVerticalOffset","platform","configuredOffset","bottomInset","getInputDockPaddingBottom","keyboardVisible"],"sourceRoot":"../../../src","sources":["helpers/keyboardLayout.ts"],"mappings":";;;;;;AAOO,MAAMA,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,EAAE;AAEjC,MAAME,yBAAyB,GAAGA,CAAC;EACxCC,QAAQ;EACRC,gBAAgB,GAAG,CAAC;EACpBC,WAAW,GAAG;AACI,CAAC,KACnBD,gBAAgB,IAAID,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAG,CAAC,CAAC;AAACJ,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAErD,MAAMI,yBAAyB,GAAGA,CAAC;EACxCH,QAAQ;EACRE,WAAW,GAAG,CAAC;EACfE,eAAe,GAAG;AAC0B,CAAC,KAC7CJ,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAGL,sBAAsB;AAACC,OAAA,CAAAK,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.deriveDisplayFilename = deriveDisplayFilename;
|
|
6
7
|
exports.ensureFilenameHasExtension = ensureFilenameHasExtension;
|
|
7
8
|
exports.filenameFromUrl = filenameFromUrl;
|
|
8
9
|
exports.getExtensionForMime = getExtensionForMime;
|
|
@@ -237,10 +238,17 @@ function ensureFilenameHasExtension(fileName, mime) {
|
|
|
237
238
|
return `${base}${getExtensionForMime(mime)}`;
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Best-effort filename derivation for a message bubble:
|
|
243
|
+
* - server-provided `fileName`
|
|
244
|
+
* - server-provided `originalName`
|
|
245
|
+
* - URL pathname
|
|
246
|
+
* - generic `media_<timestamp>` so we never render an empty label
|
|
247
|
+
*
|
|
248
|
+
* Always returns a string with a valid extension.
|
|
249
|
+
*/
|
|
250
|
+
function deriveDisplayFilename(opts) {
|
|
251
|
+
const candidate = opts.fileName && opts.fileName.trim() || opts.originalName && opts.originalName.trim() || filenameFromUrl(opts.url) || '';
|
|
252
|
+
return ensureFilenameHasExtension(candidate, opts.mime);
|
|
253
|
+
}
|
|
246
254
|
//# sourceMappingURL=mimeToExtension.js.map
|
|
@@ -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":"
|
|
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,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AAI,CAACD,GAAG,CAAC,IACzB,EAAE;EACJ,OAAOuC,0BAA0B,CAACJ,SAAS,EAAElC,IAAI,CAACH,IAAI,CAAC;AACzD","ignoreList":[]}
|
|
@@ -4,14 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.resolveInitBeforeLoadUser = exports.refreshUserCredentialsForXmpp = exports.default = exports.applyResolvedUserToStore = void 0;
|
|
7
|
-
var _apiClient = require("../networking/apiClient");
|
|
8
|
-
var _authRefresh = require("../networking/authRefresh");
|
|
7
|
+
var _apiClient = _interopRequireWildcard(require("../networking/apiClient"));
|
|
9
8
|
var _auth = require("../networking/api-requests/auth.api");
|
|
10
9
|
var _user = require("../networking/api-requests/user.api");
|
|
11
10
|
var _roomStore = require("../roomStore");
|
|
12
11
|
var _chatSettingsSlice = require("../roomStore/chatSettingsSlice");
|
|
13
12
|
var _walletUsername = require("./walletUsername");
|
|
14
|
-
var
|
|
13
|
+
var _useLocalStorage = require("../hooks/useLocalStorage");
|
|
14
|
+
var _LOCAL_STORAGE = require("./constants/LOCAL_STORAGE");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
16
|
const getStatusCode = error => {
|
|
16
17
|
const status = error?.response?.status;
|
|
17
18
|
return typeof status === 'number' ? status : null;
|
|
@@ -35,112 +36,15 @@ const normalizeUserForXmpp = user => {
|
|
|
35
36
|
xmppUsername: normalizedXmppUsername
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
-
// Hermes has no atob/Buffer; hand-decode just enough base64url to read a
|
|
40
|
-
// JWT's `iat`. Claims are ASCII so the byte-per-char string is fine.
|
|
41
|
-
const B64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
42
|
-
const readJwtIat = token => {
|
|
43
|
-
if (!token || typeof token !== 'string') {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
const part = token.split('.')[1];
|
|
47
|
-
if (!part) {
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
try {
|
|
51
|
-
const clean = part.replace(/-/g, '+').replace(/_/g, '/');
|
|
52
|
-
let out = '';
|
|
53
|
-
let buffer = 0;
|
|
54
|
-
let bits = 0;
|
|
55
|
-
for (let i = 0; i < clean.length; i++) {
|
|
56
|
-
const idx = B64_ALPHABET.indexOf(clean[i]);
|
|
57
|
-
if (idx === -1) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
buffer = buffer << 6 | idx;
|
|
61
|
-
bits += 6;
|
|
62
|
-
if (bits >= 8) {
|
|
63
|
-
bits -= 8;
|
|
64
|
-
out += String.fromCharCode(buffer >> bits & 0xff);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const iat = JSON.parse(out)?.iat;
|
|
68
|
-
return typeof iat === 'number' ? iat : 0;
|
|
69
|
-
} catch {
|
|
70
|
-
return 0;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* A `userLogin.user` is typically a snapshot the host captured at ITS
|
|
76
|
-
* login time and re-presents verbatim on every mount, while this SDK
|
|
77
|
-
* keeps rotating the session and persisting the newest pair to
|
|
78
|
-
* `ETHORA_USER`. Taking the snapshot as-is therefore discards the live
|
|
79
|
-
* session in favour of an ever-aging copy: media goes blank the moment
|
|
80
|
-
* the snapshot has no `fileToken` (secure-files URLs 401 without it),
|
|
81
|
-
* and once the snapshot's refresh token ages out entirely the account
|
|
82
|
-
* looks dead even though the SDK held a working session all along.
|
|
83
|
-
*
|
|
84
|
-
* So, for the SAME account only, prefer whichever refresh pair was
|
|
85
|
-
* minted later (JWT `iat` decides — a host that genuinely re-logged-in
|
|
86
|
-
* hands us newer tokens and wins), and fill in a missing `fileToken`
|
|
87
|
-
* from the persisted copy either way.
|
|
88
|
-
*/
|
|
89
|
-
const adoptFresherPersistedSession = async candidate => {
|
|
90
|
-
try {
|
|
91
|
-
const stored = await (0, _secureUserStorage.secureUserStorage)().get();
|
|
92
|
-
if (!stored) {
|
|
93
|
-
return candidate;
|
|
94
|
-
}
|
|
95
|
-
const sameUser = candidate._id && stored._id && candidate._id === stored._id || candidate.xmppUsername && stored.xmppUsername && candidate.xmppUsername === stored.xmppUsername;
|
|
96
|
-
if (!sameUser) {
|
|
97
|
-
return candidate;
|
|
98
|
-
}
|
|
99
|
-
const merged = {
|
|
100
|
-
...candidate
|
|
101
|
-
};
|
|
102
|
-
if (stored.refreshToken && readJwtIat(stored.refreshToken) > readJwtIat(candidate.refreshToken)) {
|
|
103
|
-
merged.refreshToken = stored.refreshToken;
|
|
104
|
-
if (stored.token) {
|
|
105
|
-
merged.token = stored.token;
|
|
106
|
-
}
|
|
107
|
-
if (stored.fileToken) {
|
|
108
|
-
merged.fileToken = stored.fileToken;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (!merged.fileToken && stored.fileToken) {
|
|
112
|
-
merged.fileToken = stored.fileToken;
|
|
113
|
-
}
|
|
114
|
-
return merged;
|
|
115
|
-
} catch {
|
|
116
|
-
return candidate;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Bootstrap rotation.
|
|
122
|
-
*
|
|
123
|
-
* Was a second, independent `/users/login/refresh` caller that bypassed
|
|
124
|
-
* every lock in the SDK — and, worse, only wrote the rotated token to
|
|
125
|
-
* the store on the happy path, so several of the early-return branches
|
|
126
|
-
* below used to drop it. Under the backend's reuse detection a dropped
|
|
127
|
-
* rotation means the next launch presents a burned token and the
|
|
128
|
-
* session is killed.
|
|
129
|
-
*
|
|
130
|
-
* `refreshAuthTokens` persists the new pair before it resolves, so by
|
|
131
|
-
* the time this returns the rotation is safe no matter which branch the
|
|
132
|
-
* caller takes afterwards. The explicit token is required here: during
|
|
133
|
-
* bootstrap the candidate session isn't in the store yet.
|
|
134
|
-
*/
|
|
135
39
|
const refreshWithToken = async refreshToken => {
|
|
136
|
-
const
|
|
137
|
-
|
|
40
|
+
const response = await _apiClient.default.post('/users/login/refresh', {}, {
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: refreshToken
|
|
43
|
+
}
|
|
138
44
|
});
|
|
139
45
|
return {
|
|
140
|
-
token:
|
|
141
|
-
refreshToken:
|
|
142
|
-
xmppPassword: result.xmppPassword || '',
|
|
143
|
-
fileToken: result.fileToken || ''
|
|
46
|
+
token: response?.data?.token || '',
|
|
47
|
+
refreshToken: response?.data?.refreshToken || refreshToken
|
|
144
48
|
};
|
|
145
49
|
};
|
|
146
50
|
const mergeUsers = (base, patch) => {
|
|
@@ -165,14 +69,10 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
165
69
|
}
|
|
166
70
|
let workingToken = candidate?.token || '';
|
|
167
71
|
let workingRefresh = candidate?.refreshToken || '';
|
|
168
|
-
let rotatedXmppPassword = '';
|
|
169
|
-
let workingFileToken = candidate?.fileToken || '';
|
|
170
72
|
const candidateWithCurrentTokens = () => ({
|
|
171
73
|
...candidate,
|
|
172
74
|
token: workingToken || candidate.token,
|
|
173
|
-
refreshToken: workingRefresh || candidate.refreshToken
|
|
174
|
-
xmppPassword: rotatedXmppPassword || candidate.xmppPassword,
|
|
175
|
-
fileToken: workingFileToken || candidate.fileToken
|
|
75
|
+
refreshToken: workingRefresh || candidate.refreshToken
|
|
176
76
|
});
|
|
177
77
|
const fallbackWithCreds = () => {
|
|
178
78
|
const normalized = normalizeUserForXmpp(candidateWithCurrentTokens());
|
|
@@ -191,8 +91,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
191
91
|
if (merged) {
|
|
192
92
|
merged.token = workingToken || merged.token;
|
|
193
93
|
merged.refreshToken = workingRefresh || merged.refreshToken;
|
|
194
|
-
merged.xmppPassword = rotatedXmppPassword || merged.xmppPassword;
|
|
195
|
-
merged.fileToken = workingFileToken || merged.fileToken;
|
|
196
94
|
}
|
|
197
95
|
return merged;
|
|
198
96
|
} catch (error) {
|
|
@@ -217,8 +115,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
217
115
|
const refreshed = await refreshWithToken(workingRefresh);
|
|
218
116
|
workingToken = refreshed.token;
|
|
219
117
|
workingRefresh = refreshed.refreshToken;
|
|
220
|
-
rotatedXmppPassword = refreshed.xmppPassword || rotatedXmppPassword;
|
|
221
|
-
workingFileToken = refreshed.fileToken || workingFileToken;
|
|
222
118
|
try {
|
|
223
119
|
const myUser = await (0, _user.getMyUser)({
|
|
224
120
|
token: workingToken,
|
|
@@ -228,8 +124,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
228
124
|
if (merged) {
|
|
229
125
|
merged.token = workingToken || merged.token;
|
|
230
126
|
merged.refreshToken = workingRefresh || merged.refreshToken;
|
|
231
|
-
merged.xmppPassword = rotatedXmppPassword || merged.xmppPassword;
|
|
232
|
-
merged.fileToken = workingFileToken || merged.fileToken;
|
|
233
127
|
}
|
|
234
128
|
return merged;
|
|
235
129
|
} catch (myError) {
|
|
@@ -249,13 +143,6 @@ const tryHydrateViaMy = async (candidate, myEndpoint, signal) => {
|
|
|
249
143
|
if (signal?.aborted || isAbortError(error)) {
|
|
250
144
|
return null;
|
|
251
145
|
}
|
|
252
|
-
// A fatal refresh verdict (reuse detected / token not found / stale
|
|
253
|
-
// with nothing newer around) carries no HTTP response, so it would
|
|
254
|
-
// otherwise fall through to `throw` — the session is simply dead,
|
|
255
|
-
// which for bootstrap means "nothing to restore".
|
|
256
|
-
if ((0, _authRefresh.isRefreshFatalError)(error)) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
146
|
if (isAuthError(error)) {
|
|
260
147
|
return null;
|
|
261
148
|
}
|
|
@@ -273,14 +160,14 @@ const resolveInitBeforeLoadUser = async options => {
|
|
|
273
160
|
if (config?.baseUrl) {
|
|
274
161
|
(0, _apiClient.setBaseURL)(config.baseUrl, config.customAppToken);
|
|
275
162
|
}
|
|
276
|
-
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/
|
|
163
|
+
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/users/my';
|
|
277
164
|
|
|
278
165
|
// Priority 1: explicit userLogin
|
|
279
166
|
const explicitUser = config?.userLogin?.enabled ? config?.userLogin?.user : null;
|
|
280
167
|
if (explicitUser) {
|
|
281
168
|
const candidate = normalizeUserForXmpp(explicitUser);
|
|
282
169
|
if (candidate && hasXmppCredentials(candidate)) {
|
|
283
|
-
return
|
|
170
|
+
return candidate;
|
|
284
171
|
}
|
|
285
172
|
const hydrated = await tryHydrateViaMy(explicitUser, myEndpoint, signal).catch(() => null);
|
|
286
173
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
@@ -337,13 +224,13 @@ const resolveInitBeforeLoadUser = async options => {
|
|
|
337
224
|
|
|
338
225
|
// Priority 5: persisted user in AsyncStorage
|
|
339
226
|
try {
|
|
340
|
-
const storedUser = await (0,
|
|
227
|
+
const storedUser = await (0, _useLocalStorage.asyncLocalStorage)(_LOCAL_STORAGE.localStorageConstants.ETHORA_USER).get();
|
|
341
228
|
if (storedUser && (storedUser.token || storedUser.refreshToken || storedUser.xmppPassword)) {
|
|
342
229
|
const hydrated = await tryHydrateViaMy(storedUser, myEndpoint, signal).catch(() => null);
|
|
343
230
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
344
231
|
return hydrated;
|
|
345
232
|
}
|
|
346
|
-
await (0,
|
|
233
|
+
await (0, _useLocalStorage.asyncLocalStorage)(_LOCAL_STORAGE.localStorageConstants.ETHORA_USER).remove();
|
|
347
234
|
}
|
|
348
235
|
} catch {
|
|
349
236
|
// ignore storage errors
|
|
@@ -399,7 +286,7 @@ const refreshUserCredentialsForXmpp = async (config, signal) => {
|
|
|
399
286
|
// fall through to /users/my path
|
|
400
287
|
}
|
|
401
288
|
}
|
|
402
|
-
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/
|
|
289
|
+
const myEndpoint = config?.initBeforeLoadAuth?.myEndpoint || '/users/my';
|
|
403
290
|
|
|
404
291
|
// Priority 2: redux store user (covers userLogin + customLogin +
|
|
405
292
|
// anything previously persisted into chatSettingStore.user). The
|
|
@@ -417,7 +304,7 @@ const refreshUserCredentialsForXmpp = async (config, signal) => {
|
|
|
417
304
|
// should already mirror this, but if the redux state got cleared
|
|
418
305
|
// mid-session (logout race) this gives us one last shot.
|
|
419
306
|
try {
|
|
420
|
-
const storedUser = await (0,
|
|
307
|
+
const storedUser = await (0, _useLocalStorage.asyncLocalStorage)(_LOCAL_STORAGE.localStorageConstants.ETHORA_USER).get();
|
|
421
308
|
if (storedUser && (storedUser.token || storedUser.refreshToken || storedUser.xmppPassword)) {
|
|
422
309
|
const hydrated = await tryHydrateViaMy(storedUser, myEndpoint, signal).catch(() => null);
|
|
423
310
|
if (hydrated && hasXmppCredentials(hydrated)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_apiClient","require","_authRefresh","_auth","_user","_roomStore","_chatSettingsSlice","_walletUsername","_secureUserStorage","getStatusCode","error","status","response","isAuthError","code","isAbortError","message","toLowerCase","includes","hasXmppCredentials","user","Boolean","xmppPassword","xmppUsername","defaultWallet","walletAddress","normalizeUserForXmpp","normalizedXmppUsername","walletToUsername","B64_ALPHABET","readJwtIat","token","part","split","clean","replace","out","buffer","bits","i","length","idx","indexOf","String","fromCharCode","iat","JSON","parse","adoptFresherPersistedSession","candidate","stored","secureUserStorage","get","sameUser","_id","merged","refreshToken","fileToken","refreshWithToken","result","refreshAuthTokens","mergeUsers","base","patch","tryHydrateViaMy","myEndpoint","signal","aborted","mergedCandidate","workingToken","workingRefresh","rotatedXmppPassword","workingFileToken","candidateWithCurrentTokens","fallbackWithCreds","normalized","myUser","getMyUser","endpoint","fallback","refreshed","myError","isRefreshFatalError","resolveInitBeforeLoadUser","options","config","baseUrl","setBaseURL","customAppToken","initBeforeLoadAuth","explicitUser","userLogin","enabled","hydrated","catch","customLogin","loginFunction","customUser","jwtLogin","jwtUser","loginViaJwt","currentUser","store","getState","chatSettingStore","storedUser","remove","exports","applyResolvedUserToStore","dispatch","setUser","refreshUserCredentialsForXmpp","fresh","_default","default"],"sourceRoot":"../../../src","sources":["helpers/resolveInitBeforeLoadUser.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AAYA,MAAMQ,aAAa,GAAIC,KAAc,IAAoB;EACvD,MAAMC,MAAM,GAAID,KAAK,EAAoBE,QAAQ,EAAED,MAAM;EACzD,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAG,IAAI;AACnD,CAAC;AAED,MAAME,WAAW,GAAIH,KAAc,IAAc;EAC/C,MAAMI,IAAI,GAAGL,aAAa,CAACC,KAAK,CAAC;EACjC,OAAOI,IAAI,KAAK,GAAG,IAAIA,IAAI,KAAK,GAAG;AACrC,CAAC;AAED,MAAMC,YAAY,GAAIL,KAAc,IAAc;EAChD,MAAMM,OAAO,GAAIN,KAAK,EAAoBM,OAAO,IAAI,EAAE;EACvD,OAAO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CAAC,MAAM,IAAI,CAAC;MACnB,IAAID,QAAQ,IAAI1E,kBAAkB,CAAC0E,QAAQ,CAAC,EAAE;QAAC,OAAOA,QAAQ;MAAC;IACjE;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAGF,OAAO,IAAI;AACb,CAAC;AAACc,OAAA,CAAAI,6BAAA,GAAAA,6BAAA;AAAA,IAAAE,QAAA,GAAAN,OAAA,CAAAO,OAAA,GAEa/B,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_apiClient","_interopRequireWildcard","require","_auth","_user","_roomStore","_chatSettingsSlice","_walletUsername","_useLocalStorage","_LOCAL_STORAGE","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getStatusCode","error","status","response","isAuthError","code","isAbortError","message","toLowerCase","includes","hasXmppCredentials","user","Boolean","xmppPassword","xmppUsername","defaultWallet","walletAddress","normalizeUserForXmpp","normalizedXmppUsername","walletToUsername","refreshWithToken","refreshToken","http","post","headers","Authorization","token","data","mergeUsers","base","patch","tryHydrateViaMy","candidate","myEndpoint","signal","aborted","mergedCandidate","workingToken","workingRefresh","candidateWithCurrentTokens","fallbackWithCreds","normalized","myUser","getMyUser","endpoint","merged","fallback","refreshed","myError","resolveInitBeforeLoadUser","options","config","baseUrl","setBaseURL","customAppToken","initBeforeLoadAuth","explicitUser","userLogin","enabled","hydrated","catch","customLogin","loginFunction","customUser","jwtLogin","jwtUser","loginViaJwt","currentUser","store","getState","chatSettingStore","storedUser","asyncLocalStorage","localStorageConstants","ETHORA_USER","remove","exports","applyResolvedUserToStore","dispatch","setUser","refreshUserCredentialsForXmpp","fresh","_default"],"sourceRoot":"../../../src","sources":["helpers/resolveInitBeforeLoadUser.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAA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Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveLegacyTranslatesLangSource = exports.resolveExternalReaderLocaleLangSource = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Legacy single-locale config (`translates.translations`) seeds langSource
|
|
9
|
+
* only when the host ACTUALLY set it.
|
|
10
|
+
*
|
|
11
|
+
* The condition used to be inverted (`!translates.translations`), so merely
|
|
12
|
+
* enabling translation fired `setLangSource(undefined)` on every XMPP init
|
|
13
|
+
* and wiped whatever the reader had picked from the globe — the language
|
|
14
|
+
* reset itself on every reconnect. Web fixed this; RN had not.
|
|
15
|
+
*/
|
|
16
|
+
const resolveLegacyTranslatesLangSource = translatesConfig => translatesConfig?.enabled && translatesConfig?.translations ? translatesConfig.translations : undefined;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A host drives the reader's language from OUTSIDE the component by setting
|
|
20
|
+
* `config.translates.readerLocale` (their own language switcher, or the
|
|
21
|
+
* testbed's Setup tab). Nothing was syncing it into `langSource`, so pinning
|
|
22
|
+
* it only redirected the incoming-translation lookup: the UI captions and
|
|
23
|
+
* the `<translate source>` on outgoing messages both kept following the
|
|
24
|
+
* unset `langSource`.
|
|
25
|
+
*
|
|
26
|
+
* Unlike web this keeps the FULL locale rather than the base language. RN's
|
|
27
|
+
* LANGUAGE_OPTIONS are region-tagged (`es-US`, `fr-CA`) because the region
|
|
28
|
+
* is forwarded to the translation service, and the in-chat picker stores
|
|
29
|
+
* that full form — so the external path has to store the same thing or the
|
|
30
|
+
* two would disagree. Caption lookups strip to the base themselves.
|
|
31
|
+
*
|
|
32
|
+
* Resolves only when actually set, so a host that leaves it unset never
|
|
33
|
+
* clobbers what the reader chose for themselves.
|
|
34
|
+
*/
|
|
35
|
+
exports.resolveLegacyTranslatesLangSource = resolveLegacyTranslatesLangSource;
|
|
36
|
+
const resolveExternalReaderLocaleLangSource = readerLocale => readerLocale || undefined;
|
|
37
|
+
exports.resolveExternalReaderLocaleLangSource = resolveExternalReaderLocaleLangSource;
|
|
38
|
+
//# sourceMappingURL=resolveLangSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveLegacyTranslatesLangSource","translatesConfig","enabled","translations","undefined","exports","resolveExternalReaderLocaleLangSource","readerLocale"],"sourceRoot":"../../../src","sources":["helpers/resolveLangSource.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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;AAhBAC,OAAA,CAAAL,iCAAA,GAAAA,iCAAA;AAiBO,MAAMM,qCAAqC,GAChDC,YAAqB,IAEpBA,YAAY,IAAIH,SAAuC;AAACC,OAAA,CAAAC,qCAAA,GAAAA,qCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeXmppUsername = void 0;
|
|
7
|
+
var _roomStore = require("../roomStore");
|
|
8
|
+
/**
|
|
9
|
+
* Collapse a duplicated `<appId>_` prefix down to one.
|
|
10
|
+
*
|
|
11
|
+
* Ported from the web SDK (src/helpers/xmppUsername.ts). Some senders stamp
|
|
12
|
+
* an already-qualified username and it gets qualified a second time, which
|
|
13
|
+
* yields `<appId>_<appId>_<userId>` — a key `usersSet` will never match.
|
|
14
|
+
*
|
|
15
|
+
* RN reads the appId off the logged-in user's own xmppUsername
|
|
16
|
+
* (`<appId>_<userId>`) since the chat store has no standalone `appId` field
|
|
17
|
+
* the way web's does.
|
|
18
|
+
*/
|
|
19
|
+
const normalizeXmppUsername = value => {
|
|
20
|
+
if (!value) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
let result = String(value).trim();
|
|
24
|
+
if (!result) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
const ownXmpp = String(_roomStore.store.getState().chatSettingStore?.user?.xmppUsername || '');
|
|
28
|
+
const appId = ownXmpp.includes('_') ? ownXmpp.split('_')[0] : '';
|
|
29
|
+
if (!appId) {
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
const prefix = `${appId}_`;
|
|
33
|
+
while (result.startsWith(prefix + prefix)) {
|
|
34
|
+
result = result.slice(prefix.length);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
exports.normalizeXmppUsername = normalizeXmppUsername;
|
|
39
|
+
//# sourceMappingURL=xmppUsername.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_roomStore","require","normalizeXmppUsername","value","result","String","trim","ownXmpp","store","getState","chatSettingStore","user","xmppUsername","appId","includes","split","prefix","startsWith","slice","length","exports"],"sourceRoot":"../../../src","sources":["helpers/xmppUsername.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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,CACpBG,gBAAK,CAACC,QAAQ,CAAC,CAAC,CAACC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,IAAI,EAC3D,CAAC;EACD,MAAMC,KAAK,GAAGN,OAAO,CAACO,QAAQ,CAAC,GAAG,CAAC,GAAGP,OAAO,CAACQ,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;EAChE,IAAI,CAACF,KAAK,EAAE;IACV,OAAOT,MAAM;EACf;EAEA,MAAMY,MAAM,GAAG,GAAGH,KAAK,GAAG;EAC1B,OAAOT,MAAM,CAACa,UAAU,CAACD,MAAM,GAAGA,MAAM,CAAC,EAAE;IACzCZ,MAAM,GAAGA,MAAM,CAACc,KAAK,CAACF,MAAM,CAACG,MAAM,CAAC;EACtC;EACA,OAAOf,MAAM;AACf,CAAC;AAACgB,OAAA,CAAAlB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|