@ethora/chat-component-rn 26.8.1 → 26.8.2
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 +96 -0
- package/README.md +43 -10
- package/lib/commonjs/assets/icons.js +7 -2
- 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 +29 -8
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +150 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +34 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +29 -9
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +5 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +13 -5
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +322 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +546 -203
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +69 -27
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -106
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +563 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +2 -1
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +37 -9
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -11
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +14 -4
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +119 -61
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +184 -59
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -1
- 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/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js +188 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +14 -8
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +51 -9
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isOwnMessage.js +75 -0
- package/lib/commonjs/helpers/isOwnMessage.js.map +1 -0
- package/lib/commonjs/helpers/keyboardLayout.js +12 -2
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +6 -14
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/msgSortableMs.js +37 -0
- package/lib/commonjs/helpers/msgSortableMs.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +122 -0
- package/lib/commonjs/helpers/persistCrypto.js.map +1 -0
- package/lib/commonjs/helpers/pickImageAsset.js +68 -0
- package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
- package/lib/commonjs/helpers/pushPayload.js +71 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -0
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +130 -17
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/secureFileUrl.js +101 -0
- package/lib/commonjs/helpers/secureFileUrl.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +83 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js +59 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/commonjs/helpers/secureUserStorage.js +75 -0
- package/lib/commonjs/helpers/secureUserStorage.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +45 -12
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +30 -10
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useFileToken.js +10 -0
- package/lib/commonjs/hooks/useFileToken.js.map +1 -0
- package/lib/commonjs/hooks/useLogout.js +23 -7
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +8 -11
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +50 -14
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +145 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +44 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +134 -60
- 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 +68 -9
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +62 -112
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +332 -0
- package/lib/commonjs/networking/authRefresh.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +41 -28
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +124 -8
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +26 -7
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +35 -2
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +226 -23
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +151 -38
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +15 -13
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +6 -1
- 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 +29 -8
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +9 -3
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +152 -16
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +35 -14
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +30 -10
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +5 -1
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +13 -5
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +207 -35
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +313 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +549 -207
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +70 -28
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -108
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +555 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +2 -1
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +37 -9
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +81 -12
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +14 -4
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +120 -62
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +184 -60
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -1
- 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/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getServerReadTimestamp.js +181 -0
- package/lib/module/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +14 -8
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +52 -9
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isOwnMessage.js +70 -0
- package/lib/module/helpers/isOwnMessage.js.map +1 -0
- package/lib/module/helpers/keyboardLayout.js +12 -2
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +6 -13
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/msgSortableMs.js +32 -0
- package/lib/module/helpers/msgSortableMs.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +115 -0
- package/lib/module/helpers/persistCrypto.js.map +1 -0
- package/lib/module/helpers/pickImageAsset.js +63 -0
- package/lib/module/helpers/pickImageAsset.js.map +1 -0
- package/lib/module/helpers/pushPayload.js +63 -0
- package/lib/module/helpers/pushPayload.js.map +1 -0
- package/lib/module/helpers/resolveInitBeforeLoadUser.js +130 -16
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/secureFileUrl.js +91 -0
- package/lib/module/helpers/secureFileUrl.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +75 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -0
- package/lib/module/helpers/secureStoreRuntime.js +52 -0
- package/lib/module/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/module/helpers/secureUserStorage.js +72 -0
- package/lib/module/helpers/secureUserStorage.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +46 -13
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +30 -10
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useFileToken.js +5 -0
- package/lib/module/hooks/useFileToken.js.map +1 -0
- package/lib/module/hooks/useLogout.js +23 -7
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +8 -11
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +52 -16
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +145 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +14 -2
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +131 -59
- 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 +64 -7
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +61 -113
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/authRefresh.js +321 -0
- package/lib/module/networking/authRefresh.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +41 -28
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +124 -8
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +26 -7
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +37 -4
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +223 -22
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +139 -34
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +15 -13
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/icons.d.ts +16 -0
- 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 +10 -1
- 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/RoomList.d.ts +7 -0
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- 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 +4 -2
- 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/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- 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 +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- 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/MessageImage.d.ts +14 -0
- package/lib/typescript/components/styled/MessageImage.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 +8 -0
- 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/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +108 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +1 -0
- 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/isOwnMessage.d.ts +36 -0
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts +5 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +0 -15
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +2 -0
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +13 -0
- package/lib/typescript/helpers/persistCrypto.d.ts.map +1 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
- package/lib/typescript/helpers/pushPayload.d.ts +7 -0
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -0
- package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +7 -0
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +13 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +29 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts +23 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +4 -1
- 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/useFileToken.d.ts +2 -0
- package/lib/typescript/hooks/useFileToken.d.ts.map +1 -0
- 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 +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +9 -2
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts +12 -6
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +95 -0
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +10 -2
- 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 +14 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +16 -0
- 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 +18 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +43 -3
- 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 +50 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +41 -28
- package/src/assets/icons.tsx +48 -9
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +29 -7
- package/src/components/MainComponents/ChatHeader.tsx +9 -3
- package/src/components/MainComponents/ChatRoom.tsx +161 -15
- package/src/components/MainComponents/ChatWrapper.tsx +36 -20
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +26 -8
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +23 -4
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RoomList.tsx +236 -39
- package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +333 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +600 -282
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +79 -38
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -119
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +624 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +28 -4
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +18 -3
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +2 -1
- package/src/components/styled/MessageImage.tsx +53 -7
- package/src/components/styled/SendInput.tsx +83 -12
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/xmppProvider.tsx +216 -57
- package/src/helpers/createMessageFromXml.ts +20 -1
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getServerReadTimestamp.ts +197 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/initXmppRooms.tsx +14 -10
- package/src/helpers/insertMessageWithDelimiter.ts +55 -19
- package/src/helpers/isOwnMessage.ts +90 -0
- package/src/helpers/keyboardLayout.ts +23 -2
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/persistCrypto.ts +127 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/resolveInitBeforeLoadUser.ts +125 -18
- package/src/helpers/secureFileUrl.ts +103 -0
- package/src/helpers/secureKeyValue.ts +80 -0
- package/src/helpers/secureStoreRuntime.ts +62 -0
- package/src/helpers/secureUserStorage.ts +80 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatRoomFocus.ts +49 -9
- package/src/hooks/useChatWrapperInit.ts +30 -10
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +29 -9
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +145 -37
- package/src/main.ts +26 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- 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 +79 -7
- package/src/networking/apiClient.ts +68 -123
- package/src/networking/authRefresh.ts +451 -0
- package/src/networking/stanzaHandlers.ts +44 -28
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +71 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +141 -9
- package/src/roomStore/chatSettingsSlice.ts +34 -10
- package/src/roomStore/index.ts +40 -4
- package/src/roomStore/persistence.ts +234 -24
- package/src/roomStore/roomsSlice.ts +161 -29
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/types.ts +72 -5
- package/src/version.ts +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.shallowEqual = shallowEqual;
|
|
8
|
+
/**
|
|
9
|
+
* One-level shallow equality for plain objects. Used to avoid re-dispatching
|
|
10
|
+
* config into redux on every render just because the host passed a fresh
|
|
11
|
+
* object literal with the same values (e.g. `<Chat config={{...}} />`
|
|
12
|
+
* re-created inline) — reference equality alone would fire far too often,
|
|
13
|
+
* and a deep/JSON comparison risks throwing on non-serializable fields
|
|
14
|
+
* (functions, React elements) that configs legitimately carry.
|
|
15
|
+
*/
|
|
16
|
+
function shallowEqual(a, b) {
|
|
17
|
+
if (a === b) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const aKeys = Object.keys(a);
|
|
24
|
+
const bKeys = Object.keys(b);
|
|
25
|
+
if (aKeys.length !== bKeys.length) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
for (const key of aKeys) {
|
|
29
|
+
if (a[key] !== b[key]) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
var _default = exports.default = shallowEqual;
|
|
36
|
+
//# sourceMappingURL=shallowEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["shallowEqual","a","b","aKeys","Object","keys","bKeys","length","key","_default","exports","default"],"sourceRoot":"../../../src","sources":["helpers/shallowEqual.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAYA,CAACC,CAAU,EAAEC,CAAU,EAAW;EAC5D,IAAID,CAAC,KAAKC,CAAC,EAAE;IAAC,OAAO,IAAI;EAAC;EAC1B,IACE,OAAOD,CAAC,KAAK,QAAQ,IACrB,OAAOC,CAAC,KAAK,QAAQ,IACrBD,CAAC,KAAK,IAAI,IACVC,CAAC,KAAK,IAAI,EACV;IACA,OAAO,KAAK;EACd;EACA,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,CAA4B,CAAC;EACvD,MAAMK,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACH,CAA4B,CAAC;EACvD,IAAIC,KAAK,CAACI,MAAM,KAAKD,KAAK,CAACC,MAAM,EAAE;IAAC,OAAO,KAAK;EAAC;EACjD,KAAK,MAAMC,GAAG,IAAIL,KAAK,EAAE;IACvB,IACGF,CAAC,CAA6BO,GAAG,CAAC,KAClCN,CAAC,CAA6BM,GAAG,CAAC,EACnC;MACA,OAAO,KAAK;IACd;EACF;EACA,OAAO,IAAI;AACb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcX,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldDismissOnDrag = exports.shouldClaimVerticalDrag = exports.DISMISS_VELOCITY = exports.DISMISS_DISTANCE = void 0;
|
|
7
|
+
/** @format */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shared thresholds for the drag-to-dismiss gesture on bottom sheets (the
|
|
11
|
+
* attach sheet, the profile headers, the room-list menu). Kept in one
|
|
12
|
+
* place so a pull feels identical wherever the user does it — and so the
|
|
13
|
+
* numbers are unit-testable without a touch event.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Drag past this many points and letting go dismisses the sheet. */
|
|
17
|
+
const DISMISS_DISTANCE = exports.DISMISS_DISTANCE = 90;
|
|
18
|
+
/** …or flick faster than this, however short the drag. */
|
|
19
|
+
const DISMISS_VELOCITY = exports.DISMISS_VELOCITY = 0.8;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Claim a drag only once it is clearly a downward pull, so a tap on a row
|
|
23
|
+
* still registers and a horizontal swipe stays with whatever scrolls
|
|
24
|
+
* sideways inside the sheet.
|
|
25
|
+
*/
|
|
26
|
+
const shouldClaimVerticalDrag = (dy, dx) => dy > 6 && Math.abs(dy) > Math.abs(dx) * 1.5;
|
|
27
|
+
|
|
28
|
+
/** Far enough / fast enough to let go of the sheet. */
|
|
29
|
+
exports.shouldClaimVerticalDrag = shouldClaimVerticalDrag;
|
|
30
|
+
const shouldDismissOnDrag = (dy, vy) => dy > DISMISS_DISTANCE || vy > DISMISS_VELOCITY;
|
|
31
|
+
exports.shouldDismissOnDrag = shouldDismissOnDrag;
|
|
32
|
+
//# sourceMappingURL=sheetGestures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DISMISS_DISTANCE","exports","DISMISS_VELOCITY","shouldClaimVerticalDrag","dy","dx","Math","abs","shouldDismissOnDrag","vy"],"sourceRoot":"../../../src","sources":["helpers/sheetGestures.ts"],"mappings":";;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,EAAE;AAClC;AACO,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,GAAG;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAGA,CAACC,EAAU,EAAEC,EAAU,KAC5DD,EAAE,GAAG,CAAC,IAAIE,IAAI,CAACC,GAAG,CAACH,EAAE,CAAC,GAAGE,IAAI,CAACC,GAAG,CAACF,EAAE,CAAC,GAAG,GAAG;;AAE7C;AAAAJ,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AACO,MAAMK,mBAAmB,GAAGA,CAACJ,EAAU,EAAEK,EAAU,KACxDL,EAAE,GAAGJ,gBAAgB,IAAIS,EAAE,GAAGP,gBAAgB;AAACD,OAAA,CAAAO,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _react = require("react");
|
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
9
|
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
10
10
|
var _roomStore = require("../roomStore");
|
|
11
|
+
var _getServerReadTimestamp = require("../helpers/getServerReadTimestamp");
|
|
11
12
|
/**
|
|
12
13
|
* Public hook for consumers embedding `<ChatRoom>` inside a tab-based
|
|
13
14
|
* navigator. Mirrors the mount/unmount unread-tracking that ChatRoom
|
|
@@ -18,7 +19,10 @@ var _roomStore = require("../roomStore");
|
|
|
18
19
|
* Without this hook, `useUnread()` will always return 0 for the chat
|
|
19
20
|
* room because the SDK assumes "mounted == active". With this hook,
|
|
20
21
|
* focus marks the room visible (clearing the badge) and blur stamps
|
|
21
|
-
* `lastViewedTimestamp
|
|
22
|
+
* `lastViewedTimestamp` to the newest SERVER-acknowledged message so
|
|
23
|
+
* future messages count as unread. Deliberately not `Date.now()`: a
|
|
24
|
+
* device clock running ahead would write a future marker that the
|
|
25
|
+
* forward-only private-store merge could never correct again (bug #38).
|
|
22
26
|
*
|
|
23
27
|
* Usage with React Navigation:
|
|
24
28
|
*
|
|
@@ -43,22 +47,51 @@ const useChatRoomFocus = ({
|
|
|
43
47
|
roomJID: null,
|
|
44
48
|
isFocused: false
|
|
45
49
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
|
|
51
|
+
// `clearBoundary`: pass true only when the room the user is leaving is
|
|
52
|
+
// genuinely being released (switching to a different room, or this
|
|
53
|
+
// hook unmounting) - not on a mere same-room blur. `<ChatRoom>`'s
|
|
54
|
+
// MessageList typically stays mounted across a same-room focus loss
|
|
55
|
+
// (the whole point of this hook is that the host keeps `<Chat>`
|
|
56
|
+
// mounted in a hidden tab), so its own scroll-tracking ref is still
|
|
57
|
+
// intact and the redux boundary must stay in sync with it - clearing
|
|
58
|
+
// it here would desync the two.
|
|
59
|
+
const leaveRoom = (jid, clearBoundary) => {
|
|
60
|
+
const state = _roomStore.store.getState();
|
|
61
|
+
const rooms = state.rooms?.rooms;
|
|
62
|
+
const boundaryTs = state.rooms?.readBoundaries?.[jid] ?? null;
|
|
63
|
+
// getReadMarkerTimestamp: honour the boundary (the newest message the
|
|
64
|
+
// user actually reached) when the user left this room scrolled up,
|
|
65
|
+
// otherwise fall back to the newest server-acked message. Only stamp
|
|
66
|
+
// when we actually have something to anchor to - skip rather than
|
|
67
|
+
// fall back to the device clock (bug #38). Ignoring the boundary here
|
|
68
|
+
// would stamp "everything read" regardless of scroll position (bug
|
|
69
|
+
// #42, a regression of #33 reintroduced by #38).
|
|
70
|
+
const timestamp = (0, _getServerReadTimestamp.getReadMarkerTimestamp)(rooms?.[jid], state.roomHeapSlice, boundaryTs);
|
|
71
|
+
if (timestamp > 0) {
|
|
72
|
+
dispatch((0, _roomsSlice.setLastViewedTimestamp)({
|
|
73
|
+
chatJID: jid,
|
|
74
|
+
timestamp
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
52
77
|
dispatch((0, _roomsSlice.clearVisibleRoom)());
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
78
|
+
state.chatSettingStore?.client?.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
79
|
+
visibleRoomJID: jid,
|
|
80
|
+
// Carry the same boundary to the SERVER marker - without it the
|
|
81
|
+
// flush defaults to "everything" for the visible room. Clamped
|
|
82
|
+
// through the same helper as the local stamp above.
|
|
83
|
+
visibleRoomTs: (0, _getServerReadTimestamp.getFlushBoundaryTs)(rooms?.[jid], state.roomHeapSlice, boundaryTs)
|
|
56
84
|
}).catch(() => {});
|
|
85
|
+
if (clearBoundary) {
|
|
86
|
+
dispatch((0, _roomsSlice.clearReadBoundary)({
|
|
87
|
+
jid
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
57
90
|
};
|
|
58
91
|
(0, _react.useEffect)(() => {
|
|
59
92
|
const prev = prevRef.current;
|
|
60
93
|
if (prev.isFocused && prev.roomJID && (prev.roomJID !== roomJID || !isFocused)) {
|
|
61
|
-
leaveRoom(prev.roomJID);
|
|
94
|
+
leaveRoom(prev.roomJID, prev.roomJID !== roomJID);
|
|
62
95
|
}
|
|
63
96
|
if (roomJID && isFocused) {
|
|
64
97
|
dispatch((0, _roomsSlice.setCurrentRoom)({
|
|
@@ -77,7 +110,7 @@ const useChatRoomFocus = ({
|
|
|
77
110
|
return () => {
|
|
78
111
|
const prev = prevRef.current;
|
|
79
112
|
if (prev.isFocused && prev.roomJID) {
|
|
80
|
-
leaveRoom(prev.roomJID);
|
|
113
|
+
leaveRoom(prev.roomJID, true);
|
|
81
114
|
}
|
|
82
115
|
};
|
|
83
116
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_roomsSlice","_roomStore","useChatRoomFocus","roomJID","isFocused","dispatch","useDispatch","prevRef","useRef","leaveRoom","jid","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_roomsSlice","_roomStore","_getServerReadTimestamp","useChatRoomFocus","roomJID","isFocused","dispatch","useDispatch","prevRef","useRef","leaveRoom","jid","clearBoundary","state","store","getState","rooms","boundaryTs","readBoundaries","timestamp","getReadMarkerTimestamp","roomHeapSlice","setLastViewedTimestamp","chatJID","clearVisibleRoom","chatSettingStore","client","flushLastViewedToPrivateStoreStanza","visibleRoomJID","visibleRoomTs","getFlushBoundaryTs","catch","clearReadBoundary","useEffect","prev","current","setCurrentRoom","setVisibleRoom","exports","_default","default"],"sourceRoot":"../../../src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AAC9B,OAAO,EAAE;QAClCM,SAAS,CAACwB,IAAI,CAAC9B,OAAO,EAAE,IAAI,CAAC;MAC/B;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAACkC,OAAA,CAAAnC,gBAAA,GAAAA,gBAAA;AAAA,IAAAoC,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEarC,gBAAgB","ignoreList":[]}
|
|
@@ -10,9 +10,8 @@ var _resolveLangSource = require("../helpers/resolveLangSource");
|
|
|
10
10
|
var _xmppProvider = require("../context/xmppProvider");
|
|
11
11
|
var _chatAutoEnterer = require("../helpers/chatAutoEnterer");
|
|
12
12
|
var _initRoomsPresence = require("../helpers/initRoomsPresence");
|
|
13
|
-
var _updatedChatLastTimestamps = require("../helpers/updatedChatLastTimestamps");
|
|
14
13
|
var _updateMessagesTillLast = require("../helpers/updateMessagesTillLast");
|
|
15
|
-
var
|
|
14
|
+
var _authRefresh = require("../networking/authRefresh");
|
|
16
15
|
var _chatSettingsSlice = require("../roomStore/chatSettingsSlice");
|
|
17
16
|
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
18
17
|
var _useRoomState = require("./useRoomState");
|
|
@@ -20,6 +19,7 @@ var _useChatSettingState = require("./useChatSettingState");
|
|
|
20
19
|
var _isChatIdPresentInArray = require("../helpers/isChatIdPresentInArray");
|
|
21
20
|
var _useGetNewArchRoom = _interopRequireDefault(require("./useGetNewArchRoom"));
|
|
22
21
|
var _getRoomsWithRetry = require("../helpers/getRoomsWithRetry");
|
|
22
|
+
var _shallowEqual = require("../helpers/shallowEqual");
|
|
23
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
24
|
/** @format */
|
|
25
25
|
|
|
@@ -58,6 +58,20 @@ const useChatWrapperInit = ({
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
}, [user.xmppPassword]);
|
|
61
|
+
|
|
62
|
+
// Presentational config flags (e.g. `disableHeader`) can change while the
|
|
63
|
+
// chat stays mounted — sync them to redux whenever `config` actually
|
|
64
|
+
// changes, not just at init. Shallow-equal guard: an inline object
|
|
65
|
+
// literal from the host is a fresh reference every render even when
|
|
66
|
+
// nothing in it changed, and dispatching unconditionally would re-render
|
|
67
|
+
// every config consumer on every host render.
|
|
68
|
+
const lastSyncedConfigRef = (0, _react.useRef)(undefined);
|
|
69
|
+
(0, _react.useEffect)(() => {
|
|
70
|
+
if (!(0, _shallowEqual.shallowEqual)(lastSyncedConfigRef.current, config)) {
|
|
71
|
+
lastSyncedConfigRef.current = config;
|
|
72
|
+
dispatch((0, _chatSettingsSlice.setConfig)(config));
|
|
73
|
+
}
|
|
74
|
+
}, [config, dispatch]);
|
|
61
75
|
const getRoomsWithRertyRequest = async () => {
|
|
62
76
|
setIsRetrying(true);
|
|
63
77
|
const retryRooms = await (0, _getRoomsWithRetry.getRoomsWithRetry)(client, config, syncRooms, roomJID);
|
|
@@ -128,11 +142,17 @@ const useChatWrapperInit = ({
|
|
|
128
142
|
}
|
|
129
143
|
}
|
|
130
144
|
try {
|
|
145
|
+
// getChatsPrivateStoreRequestStanza hydrates redux itself
|
|
146
|
+
// (dispatch(applyPrivateStoreMarkers(...)) internally,
|
|
147
|
+
// clamped + forward-only) - do not also apply the raw
|
|
148
|
+
// return value here. That used to double-dispatch via
|
|
149
|
+
// updatedChatLastTimestamps' unconditional
|
|
150
|
+
// setLastViewedTimestamp, which has neither the
|
|
151
|
+
// forward-only guard nor the future-marker clamp, so on
|
|
152
|
+
// every reconnect it could silently re-clobber a value
|
|
153
|
+
// the clamp had just corrected (bug #38).
|
|
131
154
|
const roomTimestampObject = await newClient.getChatsPrivateStoreRequestStanza();
|
|
132
155
|
console.log('Got chats private store', roomTimestampObject?.length || 0);
|
|
133
|
-
if (roomTimestampObject) {
|
|
134
|
-
(0, _updatedChatLastTimestamps.updatedChatLastTimestamps)(roomTimestampObject, dispatch);
|
|
135
|
-
}
|
|
136
156
|
if (!hasSyncedHistoryRef.current) {
|
|
137
157
|
console.log('Updating messages till last');
|
|
138
158
|
await (0, _updateMessagesTillLast.updateMessagesTillLast)(rooms, newClient);
|
|
@@ -147,7 +167,7 @@ const useChatWrapperInit = ({
|
|
|
147
167
|
setConnectionLost(false);
|
|
148
168
|
}
|
|
149
169
|
{
|
|
150
|
-
config?.refreshTokens?.enabled && (0,
|
|
170
|
+
config?.refreshTokens?.enabled && (0, _authRefresh.refreshAuthTokensQuietly)();
|
|
151
171
|
}
|
|
152
172
|
} catch (error) {
|
|
153
173
|
console.error(' Error during initialization', error);
|
|
@@ -167,11 +187,11 @@ const useChatWrapperInit = ({
|
|
|
167
187
|
setInited(true);
|
|
168
188
|
console.log(' Getting chats private store for existing client');
|
|
169
189
|
try {
|
|
190
|
+
// See the "new client" branch above: getChatsPrivateStoreRequestStanza
|
|
191
|
+
// already hydrates redux (clamped + forward-only); do not
|
|
192
|
+
// also apply the raw return value here.
|
|
170
193
|
const roomTimestampObject = await client.getChatsPrivateStoreRequestStanza();
|
|
171
194
|
console.log('Got chats private store for existing client', roomTimestampObject?.length || 0);
|
|
172
|
-
if (roomTimestampObject) {
|
|
173
|
-
(0, _updatedChatLastTimestamps.updatedChatLastTimestamps)(roomTimestampObject, dispatch);
|
|
174
|
-
}
|
|
175
195
|
if (!hasSyncedHistoryRef.current) {
|
|
176
196
|
console.log('Updating messages till last for existing client');
|
|
177
197
|
await (0, _updateMessagesTillLast.updateMessagesTillLast)(rooms, client);
|
|
@@ -186,7 +206,7 @@ const useChatWrapperInit = ({
|
|
|
186
206
|
setConnectionLost(false);
|
|
187
207
|
}
|
|
188
208
|
{
|
|
189
|
-
config?.refreshTokens?.enabled && (0,
|
|
209
|
+
config?.refreshTokens?.enabled && (0, _authRefresh.refreshAuthTokensQuietly)();
|
|
190
210
|
}
|
|
191
211
|
}
|
|
192
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_resolveLangSource","_xmppProvider","_chatAutoEnterer","_initRoomsPresence","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_resolveLangSource","_xmppProvider","_chatAutoEnterer","_initRoomsPresence","_updateMessagesTillLast","_authRefresh","_chatSettingsSlice","_roomsSlice","_useRoomState","_useChatSettingState","_isChatIdPresentInArray","_useGetNewArchRoom","_interopRequireDefault","_getRoomsWithRetry","_shallowEqual","e","__esModule","default","useChatWrapperInit","roomJID","wasAutoSelected","config","dispatch","useDispatch","inited","setInited","useState","showModal","setShowModal","isConnectionLost","setConnectionLost","isRetrying","setIsRetrying","hasSyncedHistoryRef","useRef","client","initializeClient","setClient","useXmppClient","syncRooms","useGetNewArchRoom","rooms","useSelector","state","roomsList","useRoomState","user","useChatSettingState","useEffect","xmppPassword","console","log","close","lastSyncedConfigRef","undefined","shallowEqual","current","setConfig","getRoomsWithRertyRequest","retryRooms","getRoomsWithRetry","loadRooms","disableLoad","setIsLoading","loading","loadingText","retryTimeout","initXmmpClient","legacyLangSource","resolveLegacyTranslatesLangSource","translates","setLangSource","xmppUsername","error","chatAutoEnterer","newClient","defaultWallet","walletAddress","xmppSettings","status","Object","keys","length","initRoomsPresence","newArch","loadedRooms","enableRoomsRetry","enabled","isSelectedRoomPresent","isChatIdPresentInArray","getRoomsStanza","roomTimestampObject","getChatsPrivateStoreRequestStanza","updateMessagesTillLast","err","warn","refreshTokens","refreshAuthTokensQuietly","setTimeout","clearTimeout","_default","exports"],"sourceRoot":"../../../src","sources":["hooks/useChatWrapperInit.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,uBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IA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AE,CAACpB,IAAI,CAACG,YAAY,EAAEH,IAAI,CAAC0B,YAAY,CAAC,CAAC;EAE1C,OAAO;IACLrC,MAAM;IACNX,MAAM;IACNO,UAAU;IACVJ,SAAS;IACTE,gBAAgB;IAChBQ,SAAS,EAAEA,SAAgB;IAC3BZ,SAAS;IACTG;EACF,CAAC;AACH,CAAC;AAAC,IAAAwE,QAAA,GAAAC,OAAA,CAAApF,OAAA,GAEaC,kBAAkB","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
8
9
|
var _xmppProvider = require("../context/xmppProvider");
|
|
9
10
|
var _reactRedux = require("react-redux");
|
|
10
11
|
var _useChatSettingState = require("./useChatSettingState");
|
|
@@ -18,7 +19,15 @@ const useComposing = config => {
|
|
|
18
19
|
const {
|
|
19
20
|
user
|
|
20
21
|
} = (0, _useChatSettingState.useChatSettingState)();
|
|
22
|
+
// RN keeps a focused TextInput focused when the app is backgrounded or
|
|
23
|
+
// the device is locked — nothing fires `onBlur`, so without this the
|
|
24
|
+
// other participant sees "typing…" for as long as the user is away.
|
|
25
|
+
// Tracks whether the input is *currently* focused, independent of the
|
|
26
|
+
// foreground/background transition, so we know whether to resume
|
|
27
|
+
// composing on return.
|
|
28
|
+
const isFocusedRef = (0, _react.useRef)(false);
|
|
21
29
|
const sendStartComposing = (0, _react.useCallback)(() => {
|
|
30
|
+
isFocusedRef.current = true;
|
|
22
31
|
if (config?.disableTypingIndicator) {
|
|
23
32
|
return;
|
|
24
33
|
}
|
|
@@ -27,6 +36,7 @@ const useComposing = config => {
|
|
|
27
36
|
}
|
|
28
37
|
}, [activeRoomJID, client, config?.disableTypingIndicator, user.firstName, user.lastName]);
|
|
29
38
|
const sendEndComposing = (0, _react.useCallback)(() => {
|
|
39
|
+
isFocusedRef.current = false;
|
|
30
40
|
if (config?.disableTypingIndicator) {
|
|
31
41
|
return;
|
|
32
42
|
}
|
|
@@ -40,6 +50,23 @@ const useComposing = config => {
|
|
|
40
50
|
}, 100);
|
|
41
51
|
return () => clearTimeout(timerId);
|
|
42
52
|
}, [sendEndComposing]);
|
|
53
|
+
|
|
54
|
+
// Foreground/background transition only — a pause in typing must NOT
|
|
55
|
+
// clear the indicator (that would flicker for a slowly-composing user),
|
|
56
|
+
// so this deliberately does not hook keystroke/idle timing at all.
|
|
57
|
+
(0, _react.useEffect)(() => {
|
|
58
|
+
const handleAppStateChange = nextState => {
|
|
59
|
+
if (nextState !== 'active') {
|
|
60
|
+
if (isFocusedRef.current && !config?.disableTypingIndicator && client) {
|
|
61
|
+
client.sendTypingRequestStanza(activeRoomJID || '', `${user.firstName} ${user.lastName}`, false);
|
|
62
|
+
}
|
|
63
|
+
} else if (isFocusedRef.current && !config?.disableTypingIndicator && client) {
|
|
64
|
+
client.sendTypingRequestStanza(activeRoomJID || '', `${user.firstName} ${user.lastName}`, true);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const subscription = _reactNative.AppState.addEventListener('change', handleAppStateChange);
|
|
68
|
+
return () => subscription.remove();
|
|
69
|
+
}, [activeRoomJID, client, config?.disableTypingIndicator, user.firstName, user.lastName]);
|
|
43
70
|
return {
|
|
44
71
|
sendStartComposing,
|
|
45
72
|
sendEndComposing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_xmppProvider","_reactRedux","_useChatSettingState","useComposing","config","client","useXmppClient","activeRoomJID","useSelector","state","rooms","user","useChatSettingState","sendStartComposing","useCallback","disableTypingIndicator","sendTypingRequestStanza","firstName","lastName","sendEndComposing","useEffect","timerId","setTimeout","clearTimeout","_default","exports","default"],"sourceRoot":"../../../src","sources":["hooks/useComposing.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_xmppProvider","_reactRedux","_useChatSettingState","useComposing","config","client","useXmppClient","activeRoomJID","useSelector","state","rooms","user","useChatSettingState","isFocusedRef","useRef","sendStartComposing","useCallback","current","disableTypingIndicator","sendTypingRequestStanza","firstName","lastName","sendEndComposing","useEffect","timerId","setTimeout","clearTimeout","handleAppStateChange","nextState","subscription","AppState","addEventListener","remove","_default","exports","default"],"sourceRoot":"../../../src","sources":["hooks/useComposing.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAAJ,OAAA;AAGA,MAAMK,YAAY,GAAIC,MAAgB,IAAK;EACzC,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,2BAAa,EAAC,CAAC;EAClC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACC,KAAK,CAAC;EACxE,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,wCAAmB,EAAC,CAAC;EACtC;EACA;EACA;EACA;EACA;EACA;EACA,MAAMC,YAAY,GAAG,IAAAC,aAAM,EAAC,KAAK,CAAC;EAElC,MAAMC,kBAAkB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC3CH,YAAY,CAACI,OAAO,GAAG,IAAI;IAC3B,IAAIb,MAAM,EAAEc,sBAAsB,EAAE;MAClC;IACF;IACA,IAAIb,MAAM,EAAE;MACVA,MAAM,CAACc,uBAAuB,CAC5BZ,aAAa,IAAI,EAAE,EACnB,GAAGI,IAAI,CAACS,SAAS,IAAIT,IAAI,CAACU,QAAQ,EAAE,EACpC,IACF,CAAC;IACH;EACF,CAAC,EAAE,CAACd,aAAa,EAAEF,MAAM,EAAED,MAAM,EAAEc,sBAAsB,EAAEP,IAAI,CAACS,SAAS,EAAET,IAAI,CAACU,QAAQ,CAAC,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AQ,EAAE,EACpC,IACF,CAAC;MACH;IACF,CAAC;IAED,MAAMQ,YAAY,GAAGC,qBAAQ,CAACC,gBAAgB,CAAC,QAAQ,EAAEJ,oBAAoB,CAAC;IAC9E,OAAO,MAAME,YAAY,CAACG,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAACzB,aAAa,EAAEF,MAAM,EAAED,MAAM,EAAEc,sBAAsB,EAAEP,IAAI,CAACS,SAAS,EAAET,IAAI,CAACU,QAAQ,CAAC,CAAC;EAE1F,OAAO;IAAEN,kBAAkB;IAAEO;EAAiB,CAAC;AACjD,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEahC,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFileToken = void 0;
|
|
7
|
+
var _reactRedux = require("react-redux");
|
|
8
|
+
const useFileToken = () => (0, _reactRedux.useSelector)(state => state.chatSettingStore.user?.fileToken || '');
|
|
9
|
+
exports.useFileToken = useFileToken;
|
|
10
|
+
//# sourceMappingURL=useFileToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactRedux","require","useFileToken","useSelector","state","chatSettingStore","user","fileToken","exports"],"sourceRoot":"../../../src","sources":["hooks/useFileToken.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGO,MAAMC,YAAY,GAAGA,CAAA,KAC1B,IAAAC,uBAAW,EACRC,KAAgB,IAAKA,KAAK,CAACC,gBAAgB,CAACC,IAAI,EAAEC,SAAS,IAAI,EAClE,CAAC;AAACC,OAAA,CAAAN,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -15,7 +15,8 @@ var _roomHeapSlice = require("../roomStore/roomHeapSlice");
|
|
|
15
15
|
var _pushSubscriptionService = require("../services/pushSubscriptionService");
|
|
16
16
|
var _rooms = require("../networking/api-requests/rooms.api");
|
|
17
17
|
var _persistence = require("../roomStore/persistence");
|
|
18
|
-
var
|
|
18
|
+
var _secureUserStorage = require("../helpers/secureUserStorage");
|
|
19
|
+
var _getServerReadTimestamp = require("../helpers/getServerReadTimestamp");
|
|
19
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
21
|
// AsyncStorage keys the library writes but that aren't cleared by any
|
|
21
22
|
// slice reducer. Listed here so a single logout call wipes the full
|
|
@@ -63,9 +64,16 @@ const logoutService = exports.logoutService = {
|
|
|
63
64
|
const client = state.chatSettingStore?.client;
|
|
64
65
|
const rooms = state.rooms?.rooms;
|
|
65
66
|
const visibleRoomJID = state.rooms?.visibleRoomJID || null;
|
|
67
|
+
// The visible room is exempt from `onlyIfNoUnread`'s skip (it's
|
|
68
|
+
// meant to write "read up to now" for whatever's open), so if the
|
|
69
|
+
// user is logging out while scrolled up with unread messages
|
|
70
|
+
// above, the boundary must still be carried through here - same
|
|
71
|
+
// reasoning as every other "leaving a room" path (bug #42).
|
|
72
|
+
const boundaryTs = visibleRoomJID ? (0, _getServerReadTimestamp.getFlushBoundaryTs)(rooms?.[visibleRoomJID], state.roomHeapSlice, state.rooms?.readBoundaries?.[visibleRoomJID] ?? null) : undefined;
|
|
66
73
|
if (client?.flushLastViewedToPrivateStoreStanza) {
|
|
67
74
|
await Promise.race([client.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
68
75
|
visibleRoomJID,
|
|
76
|
+
visibleRoomTs: boundaryTs,
|
|
69
77
|
onlyIfNoUnread: true
|
|
70
78
|
}), new Promise(res => setTimeout(res, 2000))]);
|
|
71
79
|
}
|
|
@@ -121,15 +129,23 @@ const logoutService = exports.logoutService = {
|
|
|
121
129
|
|
|
122
130
|
// 6. Stray keys the slices don't touch.
|
|
123
131
|
try {
|
|
124
|
-
await _asyncStorage.default.multiRemove(
|
|
125
|
-
// Belt-and-suspenders: the chat slice's `logout` reducer
|
|
126
|
-
// schedules an async remove of ETHORA_USER fire-and-forget;
|
|
127
|
-
// re-issue it here so the disk is provably clean before this
|
|
128
|
-
// Promise resolves.
|
|
129
|
-
_LOCAL_STORAGE.localStorageConstants.ETHORA_USER]);
|
|
132
|
+
await _asyncStorage.default.multiRemove(LIBRARY_STRAY_KEYS);
|
|
130
133
|
} catch (e) {
|
|
131
134
|
console.warn('logoutService: stray-key clear failed', e);
|
|
132
135
|
}
|
|
136
|
+
|
|
137
|
+
// 7. Belt-and-suspenders: the chat slice's `logout` reducer already
|
|
138
|
+
// fires an async ETHORA_USER removal, but re-issue it here (via
|
|
139
|
+
// the same secureUserStorage split the reducer uses) so BOTH the
|
|
140
|
+
// plain-AsyncStorage profile half AND the Keychain/Keystore
|
|
141
|
+
// secrets are provably gone before this Promise resolves — a bare
|
|
142
|
+
// `AsyncStorage.removeItem(ETHORA_USER)` here would only clear the
|
|
143
|
+
// profile half and leave the tokens behind.
|
|
144
|
+
try {
|
|
145
|
+
await (0, _secureUserStorage.secureUserStorage)().remove();
|
|
146
|
+
} catch (e) {
|
|
147
|
+
console.warn('logoutService: secure user storage clear failed', e);
|
|
148
|
+
}
|
|
133
149
|
}
|
|
134
150
|
};
|
|
135
151
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactRedux","require","_reactNative","_asyncStorage","_interopRequireDefault","_roomStore","_chatSettingsSlice","_roomsSlice","_react","_roomHeapSlice","_pushSubscriptionService","_rooms","_persistence","
|
|
1
|
+
{"version":3,"names":["_reactRedux","require","_reactNative","_asyncStorage","_interopRequireDefault","_roomStore","_chatSettingsSlice","_roomsSlice","_react","_roomHeapSlice","_pushSubscriptionService","_rooms","_persistence","_secureUserStorage","_getServerReadTimestamp","e","__esModule","default","LIBRARY_STRAY_KEYS","logoutService","exports","performLogout","state","store","getState","client","chatSettingStore","rooms","visibleRoomJID","boundaryTs","getFlushBoundaryTs","roomHeapSlice","readBoundaries","undefined","flushLastViewedToPrivateStoreStanza","Promise","race","visibleRoomTs","onlyIfNoUnread","res","setTimeout","console","warn","DeviceEventEmitter","emit","pushSubscriptionService","reset","clearRoomsRestCache","dispatch","setLogoutState","clearHeap","logout","clearPersistedState","AsyncStorage","multiRemove","secureUserStorage","remove","useLogout","useDispatch","useCallback","err"],"sourceRoot":"../../../src","sources":["hooks/useLogout.tsx"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,wBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAb,OAAA;AAAuE,SAAAG,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,kBAAkB,GAAG,CACzB,iCAAiC,CAAE;AAAA,CACpC;AAED,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,aAAa,EAAE,MAAAA,CAAA,KAA2B;IACxC;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI;MACF,MAAMC,KAAK,GAAGC,gBAAK,CAACC,QAAQ,CAAC,CAAC;MAC9B,MAAMC,MAAM,GAAIH,KAAK,CAACI,gBA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,CAAC;AAACxC,OAAA,CAAAqC,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -8,8 +8,9 @@ exports.usePendingNotification = usePendingNotification;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _reactRedux = require("react-redux");
|
|
10
10
|
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
11
|
+
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
12
|
+
var _pushPayload = require("../helpers/pushPayload");
|
|
11
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const PENDING_NOTIFICATION_JID_KEY = 'ethora_pending_notification_jid';
|
|
13
14
|
function usePendingNotification() {
|
|
14
15
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
15
16
|
const rooms = (0, _reactRedux.useSelector)(state => state.rooms.rooms);
|
|
@@ -22,20 +23,16 @@ function usePendingNotification() {
|
|
|
22
23
|
}
|
|
23
24
|
let jidToOpen = pendingNotificationJid;
|
|
24
25
|
if (!jidToOpen) {
|
|
25
|
-
|
|
26
|
-
const storedJid = await _asyncStorage.default.getItem(PENDING_NOTIFICATION_JID_KEY);
|
|
27
|
-
if (storedJid) {
|
|
28
|
-
jidToOpen = storedJid;
|
|
29
|
-
await _asyncStorage.default.removeItem(PENDING_NOTIFICATION_JID_KEY);
|
|
30
|
-
}
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error('Error reading from AsyncStorage:', error);
|
|
33
|
-
}
|
|
26
|
+
jidToOpen = await (0, _pushPayload.readPendingJid)();
|
|
34
27
|
}
|
|
35
28
|
if (jidToOpen) {
|
|
36
29
|
const room = rooms[jidToOpen];
|
|
37
30
|
if (room) {
|
|
38
|
-
|
|
31
|
+
dispatch((0, _roomsSlice.clearPendingNotificationJid)());
|
|
32
|
+
_asyncStorage.default.removeItem(_pushPayload.PENDING_NOTIFICATION_JID_KEY).catch(() => undefined);
|
|
33
|
+
dispatch((0, _roomsSlice.setCurrentRoom)({
|
|
34
|
+
roomJID: jidToOpen
|
|
35
|
+
}));
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactRedux","_asyncStorage","_interopRequireDefault","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","_asyncStorage","_interopRequireDefault","_roomsSlice","_pushPayload","e","__esModule","default","usePendingNotification","dispatch","useDispatch","rooms","useSelector","state","pendingNotificationJid","isLoading","useEffect","checkPendingNotification","jidToOpen","readPendingJid","room","clearPendingNotificationJid","AsyncStorage","removeItem","PENDING_NOTIFICATION_JID_KEY","catch","undefined","setCurrentRoom","roomJID","_default","exports"],"sourceRoot":"../../../src","sources":["hooks/usePendingNotification.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAAsF,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/E,SAASG,sBAAsBA,CAAA,EAAG;EACvC,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAC9B,MAAMC,KAAK,GAAG,IAAAC,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACA,KAAK,CAAC;EAClE,MAAMG,sBAAsB,GAAG,IAAAF,uBAAW,EACvCC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACG,sBACpC,CAAC;EACD,MAAMC,SAAS,GAAG,IAAAH,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACF,KAAK,CAACI,SAAS,CAAC;EAE1E,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,wBAAwB,GAAG,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