@ethora/chat-component-rn 26.8.1 → 26.8.3
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 +110 -0
- package/README.md +70 -11
- package/lib/commonjs/assets/EmptyChatIllustration.js +7 -6
- package/lib/commonjs/assets/EmptyChatIllustration.js.map +1 -1
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +27 -12
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +12 -4
- package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/commonjs/components/DropdownMenu/DropdownMenu.js +16 -9
- package/lib/commonjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/commonjs/components/ExampleComponents/CustomMessage.js +25 -7
- package/lib/commonjs/components/ExampleComponents/CustomMessage.js.map +1 -1
- package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
- package/lib/commonjs/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +34 -10
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/InputComponents/Search.js +13 -4
- package/lib/commonjs/components/InputComponents/Search.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +18 -6
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +154 -15
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +42 -19
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +37 -10
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.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 +72 -28
- 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 +22 -8
- 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/RNStyled.js +12 -4
- package/lib/commonjs/components/MainComponents/RNStyled.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +25 -8
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +214 -38
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/Select.js +29 -8
- package/lib/commonjs/components/MainComponents/Select.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +329 -99
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +24 -8
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +46 -24
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +15 -4
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReaction.js +10 -5
- package/lib/commonjs/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js +1 -5
- package/lib/commonjs/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +345 -118
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +599 -203
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +5 -7
- package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +230 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +89 -36
- 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/ModalHeaderComponent.js +8 -2
- package/lib/commonjs/components/Modals/ModalHeaderComponent.js.map +1 -1
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +8 -8
- package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +3 -6
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +205 -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 +215 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +7 -9
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +10 -22
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +510 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +77 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +68 -17
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +30 -10
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +6 -2
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.js +6 -0
- package/lib/commonjs/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +9 -2
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/Toast/Toast.js +3 -1
- package/lib/commonjs/components/Toast/Toast.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 +18 -12
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/Button.js +18 -9
- package/lib/commonjs/components/styled/Button.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +8 -5
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/components/styled/MediaModal.js +27 -21
- package/lib/commonjs/components/styled/MediaModal.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/RoomListComponents/index.js +60 -38
- package/lib/commonjs/components/styled/RoomListComponents/index.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +93 -19
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +75 -25
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInput.js +32 -18
- package/lib/commonjs/components/styled/StyledInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
- package/lib/commonjs/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +20 -9
- package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +50 -22
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/TreadLabel.js +6 -3
- package/lib/commonjs/components/styled/TreadLabel.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/MessageNotificationContext.js +14 -3
- package/lib/commonjs/context/MessageNotificationContext.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 +26 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/getDateLabelColor.js +3 -1
- package/lib/commonjs/helpers/getDateLabelColor.js.map +1 -1
- package/lib/commonjs/helpers/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getIconColor.js +4 -1
- package/lib/commonjs/helpers/getIconColor.js.map +1 -1
- package/lib/commonjs/helpers/getSenderNameColor.js +3 -1
- package/lib/commonjs/helpers/getSenderNameColor.js.map +1 -1
- 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/markdownParser.js +27 -5
- package/lib/commonjs/helpers/markdownParser.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/parseMessageBody.js +82 -24
- package/lib/commonjs/helpers/parseMessageBody.js.map +1 -1
- 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/useCustomTypingIndicator.js +7 -3
- package/lib/commonjs/hooks/useCustomTypingIndicator.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 +33 -10
- 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/useTheme.js +35 -0
- package/lib/commonjs/hooks/useTheme.js.map +1 -0
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +163 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +119 -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/push.api.js +130 -45
- package/lib/commonjs/networking/api-requests/push.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 +22 -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/pushRegistration.js +250 -0
- package/lib/commonjs/services/pushRegistration.js.map +1 -0
- package/lib/commonjs/services/pushSubscriptionService.js +15 -37
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/theme/index.js +38 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/styled.d.js +4 -0
- package/lib/commonjs/theme/styled.d.js.map +1 -0
- package/lib/commonjs/theme/theme.js +137 -0
- package/lib/commonjs/theme/theme.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/EmptyChatIllustration.js +7 -6
- package/lib/module/assets/EmptyChatIllustration.js.map +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 +27 -12
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/ContextMenu/ContextMenuComponents.js +12 -4
- package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
- package/lib/module/components/DropdownMenu/DropdownMenu.js +16 -9
- package/lib/module/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/module/components/ExampleComponents/CustomMessage.js +25 -7
- package/lib/module/components/ExampleComponents/CustomMessage.js.map +1 -1
- package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js +18 -6
- package/lib/module/components/ExampleComponents/CustomTypingIndicatorExamples.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +34 -10
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/InputComponents/Search.js +13 -4
- package/lib/module/components/InputComponents/Search.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +18 -6
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +156 -17
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +43 -20
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorModal.js +37 -10
- package/lib/module/components/MainComponents/LanguageSelectorModal.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 +72 -29
- 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 +22 -8
- 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/RNStyled.js +12 -4
- package/lib/module/components/MainComponents/RNStyled.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +25 -8
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +213 -38
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MainComponents/Select.js +29 -8
- package/lib/module/components/MainComponents/Select.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +331 -102
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js +24 -8
- package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +47 -25
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +15 -4
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReaction.js +10 -5
- package/lib/module/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js +2 -6
- package/lib/module/components/Modals/AddMembersModal/AddMembersModal.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +336 -121
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +603 -208
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +6 -8
- package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +225 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +90 -37
- 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/ModalHeaderComponent.js +8 -2
- package/lib/module/components/Modals/ModalHeaderComponent.js.map +1 -1
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +10 -10
- package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +4 -7
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +208 -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 +210 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -10
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +8 -6
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +7 -2
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +7 -3
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js +10 -6
- package/lib/module/components/Modals/SettingsModals/Visibility/RadioInput.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +7 -6
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +11 -24
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +512 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +79 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +67 -16
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +30 -10
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +6 -2
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.js +6 -0
- package/lib/module/components/RoomComponents/styled/StyledRoomComponents.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +9 -2
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/Toast/Toast.js +3 -1
- package/lib/module/components/Toast/Toast.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 +18 -12
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/Button.js +17 -9
- package/lib/module/components/styled/Button.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +8 -5
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/components/styled/MediaModal.js +29 -23
- package/lib/module/components/styled/MediaModal.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/RoomListComponents/index.js +62 -39
- package/lib/module/components/styled/RoomListComponents/index.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +94 -20
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +75 -25
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInput.js +32 -18
- package/lib/module/components/styled/StyledInput.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js +13 -8
- package/lib/module/components/styled/StyledInputComponents/CustomTypingIndicator.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +20 -9
- package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +50 -22
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/TreadLabel.js +6 -3
- package/lib/module/components/styled/TreadLabel.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/MessageNotificationContext.js +14 -3
- package/lib/module/context/MessageNotificationContext.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 +22 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/getDateLabelColor.js +4 -1
- package/lib/module/helpers/getDateLabelColor.js.map +1 -1
- package/lib/module/helpers/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getIconColor.js +5 -1
- package/lib/module/helpers/getIconColor.js.map +1 -1
- package/lib/module/helpers/getSenderNameColor.js +4 -1
- package/lib/module/helpers/getSenderNameColor.js.map +1 -1
- 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/markdownParser.js +27 -5
- package/lib/module/helpers/markdownParser.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/parseMessageBody.js +82 -24
- package/lib/module/helpers/parseMessageBody.js.map +1 -1
- 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/useCustomTypingIndicator.js +8 -3
- package/lib/module/hooks/useCustomTypingIndicator.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 +33 -10
- 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/useTheme.js +30 -0
- package/lib/module/hooks/useTheme.js.map +1 -0
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +163 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +17 -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/push.api.js +119 -45
- package/lib/module/networking/api-requests/push.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 +21 -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/pushRegistration.js +239 -0
- package/lib/module/services/pushRegistration.js.map +1 -0
- package/lib/module/services/pushSubscriptionService.js +15 -37
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/theme/index.js +7 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/styled.d.js +6 -0
- package/lib/module/theme/styled.d.js.map +1 -0
- package/lib/module/theme/theme.js +131 -0
- package/lib/module/theme/theme.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/EmptyChatIllustration.d.ts +1 -0
- package/lib/typescript/assets/EmptyChatIllustration.d.ts.map +1 -1
- package/lib/typescript/assets/icons.d.ts +24 -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/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/ExampleComponents/CustomMessage.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/InputComponents/Search.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/LanguageSelectorModal.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/ReduxWrapper.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/MainComponents/Select.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/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReaction.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/DeleteChatModal.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/ModalHeaderComponent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.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/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +2 -2
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/RadioInput.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.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 +2 -0
- 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/LastAudioMessage.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/RoomComponents/styled/StyledRoomComponents.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadWrapper.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/Button.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/MediaModal.d.ts +2 -2
- package/lib/typescript/components/styled/MediaModal.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/RoomListComponents/index.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/StyledInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/TreadLabel.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/MessageNotificationContext.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/getAvatarColor.d.ts +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/getDateLabelColor.d.ts +3 -7
- package/lib/typescript/helpers/getDateLabelColor.d.ts.map +1 -1
- package/lib/typescript/helpers/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getIconColor.d.ts +4 -7
- package/lib/typescript/helpers/getIconColor.d.ts.map +1 -1
- package/lib/typescript/helpers/getSenderNameColor.d.ts +3 -7
- package/lib/typescript/helpers/getSenderNameColor.d.ts.map +1 -1
- 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/markdownParser.d.ts +8 -1
- package/lib/typescript/helpers/markdownParser.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/parseMessageBody.d.ts +8 -1
- package/lib/typescript/helpers/parseMessageBody.d.ts.map +1 -1
- 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/useCustomTypingIndicator.d.ts +2 -0
- package/lib/typescript/hooks/useCustomTypingIndicator.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/useTheme.d.ts +16 -0
- package/lib/typescript/hooks/useTheme.d.ts.map +1 -0
- 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 +16 -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/push.api.d.ts +46 -3
- package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts +1 -0
- package/lib/typescript/networking/api-requests/rooms.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/pushRegistration.d.ts +21 -0
- package/lib/typescript/services/pushRegistration.d.ts.map +1 -0
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -5
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/theme/index.d.ts +5 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/theme.d.ts +113 -0
- package/lib/typescript/theme/theme.d.ts.map +1 -0
- package/lib/typescript/types/models/room.model.d.ts +1 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +70 -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/EmptyChatIllustration.tsx +7 -5
- package/src/assets/icons.tsx +72 -9
- package/src/components/AuthForms/Login.tsx +14 -12
- package/src/components/ContextMenu/ContextMenuComponents.tsx +4 -4
- package/src/components/DropdownMenu/DropdownMenu.tsx +14 -6
- package/src/components/ExampleComponents/CustomMessage.tsx +9 -8
- package/src/components/ExampleComponents/CustomTypingIndicatorExamples.tsx +6 -6
- package/src/components/Header/HeaderRoomList.tsx +35 -8
- package/src/components/InputComponents/Search.tsx +7 -4
- package/src/components/MainComponents/ChatHeader.tsx +18 -6
- package/src/components/MainComponents/ChatRoom.tsx +164 -15
- package/src/components/MainComponents/ChatWrapper.tsx +44 -26
- package/src/components/MainComponents/LanguageSelectorModal.tsx +33 -7
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +63 -26
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +36 -7
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RNStyled.tsx +4 -4
- package/src/components/MainComponents/ReduxWrapper.tsx +23 -7
- package/src/components/MainComponents/RoomList.tsx +243 -40
- package/src/components/MainComponents/Select.tsx +13 -8
- package/src/components/Menu/HeaderRoomListMenu.tsx +347 -77
- package/src/components/MessageBubble/BottomReplyContainer.tsx +16 -11
- package/src/components/MessageBubble/Message.tsx +48 -25
- package/src/components/MessageBubble/MessageInteractions.tsx +17 -4
- package/src/components/MessageBubble/MessageReaction.tsx +9 -4
- package/src/components/Modals/AddMembersModal/AddMembersModal.tsx +2 -2
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +376 -106
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +639 -283
- package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +6 -4
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +248 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +93 -47
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/ModalHeaderComponent.tsx +9 -2
- package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +14 -6
- package/src/components/Modals/NewChatModal/ModalContent.tsx +8 -5
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +223 -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 +224 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +16 -7
- package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +8 -6
- package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +5 -3
- package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +4 -4
- package/src/components/Modals/SettingsModals/Visibility/RadioInput.tsx +9 -5
- package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +7 -7
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +12 -26
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +621 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +84 -58
- package/src/components/Modals/styledModalComponents.tsx +31 -16
- package/src/components/RoomComponents/ChatRoomItem.tsx +30 -6
- package/src/components/RoomComponents/styled/LastAudioMessage.tsx +4 -2
- 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/RoomComponents/styled/StyledRoomComponents.ts +2 -0
- package/src/components/Thread/ThreadWrapper.tsx +6 -5
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +14 -10
- package/src/components/styled/Button.tsx +15 -8
- package/src/components/styled/DateLabel.tsx +7 -3
- package/src/components/styled/MediaModal.tsx +30 -25
- package/src/components/styled/MessageImage.tsx +53 -7
- package/src/components/styled/RoomListComponents/index.tsx +60 -35
- package/src/components/styled/SendInput.tsx +106 -20
- package/src/components/styled/StyledComponents.ts +38 -25
- package/src/components/styled/StyledInput.tsx +35 -21
- package/src/components/styled/StyledInputComponents/CustomTypingIndicator.tsx +8 -8
- package/src/components/styled/StyledInputComponents/MediaComponents.tsx +20 -7
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +26 -23
- package/src/components/styled/TreadLabel.tsx +9 -3
- package/src/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/MessageNotificationContext.tsx +18 -4
- 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 +20 -0
- package/src/helpers/getDateLabelColor.ts +5 -3
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getIconColor.ts +6 -3
- package/src/helpers/getSenderNameColor.ts +5 -3
- 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/markdownParser.tsx +29 -5
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/parseMessageBody.tsx +79 -26
- 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/useCustomTypingIndicator.tsx +7 -3
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +39 -12
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useTheme.ts +41 -0
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +163 -37
- package/src/main.ts +57 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/push.api.ts +185 -62
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +18 -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/pushRegistration.ts +356 -0
- package/src/services/pushSubscriptionService.ts +18 -47
- package/src/theme/index.ts +10 -0
- package/src/theme/styled.d.ts +9 -0
- package/src/theme/theme.ts +243 -0
- package/src/types/models/room.model.ts +1 -0
- package/src/types/types.ts +96 -5
- package/src/version.ts +1 -1
- package/lib/commonjs/context/PushNotificationProvider.js +0 -79
- package/lib/commonjs/context/PushNotificationProvider.js.map +0 -1
- package/lib/commonjs/hooks/usePushNotifications.js +0 -110
- package/lib/commonjs/hooks/usePushNotifications.js.map +0 -1
- package/lib/commonjs/services/pushNotifications.js +0 -143
- package/lib/commonjs/services/pushNotifications.js.map +0 -1
- package/lib/module/context/PushNotificationProvider.js +0 -79
- package/lib/module/context/PushNotificationProvider.js.map +0 -1
- package/lib/module/hooks/usePushNotifications.js +0 -106
- package/lib/module/hooks/usePushNotifications.js.map +0 -1
- package/lib/module/services/pushNotifications.js +0 -130
- package/lib/module/services/pushNotifications.js.map +0 -1
- package/lib/typescript/context/PushNotificationProvider.d.ts +0 -2
- package/lib/typescript/context/PushNotificationProvider.d.ts.map +0 -1
- package/lib/typescript/hooks/usePushNotifications.d.ts +0 -5
- package/lib/typescript/hooks/usePushNotifications.d.ts.map +0 -1
- package/lib/typescript/services/pushNotifications.d.ts +0 -10
- package/lib/typescript/services/pushNotifications.d.ts.map +0 -1
- package/src/context/PushNotificationProvider.tsx +0 -78
- package/src/hooks/usePushNotifications.ts +0 -131
- package/src/services/pushNotifications.ts +0 -170
|
@@ -13,6 +13,13 @@ const DEFAULT_CONCURRENCY = 3;
|
|
|
13
13
|
// `mergeHistoryIntoCache` rarely has to fall back to clear-and-replace.
|
|
14
14
|
const DEFAULT_PAGE_SIZE = 20;
|
|
15
15
|
const DEFAULT_RETRY_LIMIT = 2;
|
|
16
|
+
// When the first page is entirely unread (every fetched message is newer
|
|
17
|
+
// than `lastViewedTimestamp`), the true unread count could be far bigger
|
|
18
|
+
// than `pageSize` — `useUnread()` only ever sees what's been loaded. Page
|
|
19
|
+
// further back, up to this many extra fetches, until we either find the
|
|
20
|
+
// boundary or give up (`unreadCapped` then stays true so callers at least
|
|
21
|
+
// know the count is a floor, not exact). Customer-reported #34.
|
|
22
|
+
const MAX_UNREAD_CATCHUP_PAGES = 8;
|
|
16
23
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
17
24
|
const messageTimestamp = m => {
|
|
18
25
|
if (!m) {
|
|
@@ -184,11 +191,67 @@ const runHistoryPreloadScheduler = async options => {
|
|
|
184
191
|
throw new Error('history_timeout');
|
|
185
192
|
}
|
|
186
193
|
const nextRoom = _roomStore.store.getState().rooms.rooms[item.jid];
|
|
187
|
-
|
|
194
|
+
let combined = fetchedMessages || [];
|
|
195
|
+
const lastViewed = Number(nextRoom?.lastViewedTimestamp) || 0;
|
|
196
|
+
|
|
197
|
+
// The first page was entirely unread — keep paging older until
|
|
198
|
+
// we find a message at/before `lastViewedTimestamp` (the true
|
|
199
|
+
// boundary) or run out of catch-up budget, so the count isn't
|
|
200
|
+
// silently truncated at `pageSize`.
|
|
201
|
+
if (lastViewed > 0 && computeUnreadCapped(nextRoom, combined, pageSize)) {
|
|
202
|
+
let lastPageLen = combined.length;
|
|
203
|
+
let extraPages = 0;
|
|
204
|
+
while (extraPages < MAX_UNREAD_CATCHUP_PAGES && lastPageLen >= pageSize && !signal?.aborted) {
|
|
205
|
+
const oldestId = combined.reduce((min, m) => {
|
|
206
|
+
const idNum = Number(m?.id);
|
|
207
|
+
if (!Number.isFinite(idNum)) {
|
|
208
|
+
return min;
|
|
209
|
+
}
|
|
210
|
+
return min === null || idNum < min ? idNum : min;
|
|
211
|
+
}, null);
|
|
212
|
+
if (oldestId === null) {
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
let older;
|
|
216
|
+
try {
|
|
217
|
+
older = await client.getHistoryStanza(item.jid, pageSize, oldestId, undefined, {
|
|
218
|
+
coalesceRoom: true,
|
|
219
|
+
skipIfPreloaded: !forceReload,
|
|
220
|
+
source: 'background'
|
|
221
|
+
});
|
|
222
|
+
} catch {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
if (!older || !older.length) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
combined = [...older, ...combined];
|
|
229
|
+
lastPageLen = older.length;
|
|
230
|
+
extraPages++;
|
|
231
|
+
const oldestTs = combined.reduce((minTs, m) => {
|
|
232
|
+
const ts = messageTimestamp(m);
|
|
233
|
+
return ts > 0 ? Math.min(minTs, ts) : minTs;
|
|
234
|
+
}, Number.MAX_SAFE_INTEGER);
|
|
235
|
+
if (oldestTs !== Number.MAX_SAFE_INTEGER && oldestTs <= lastViewed) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// `mergeHistoryIntoCache` (roomsSlice) caps whatever we dispatch
|
|
242
|
+
// here to the newest RUNTIME_MESSAGE_LIMIT messages before it
|
|
243
|
+
// ever reaches `unreadMiddleware` — so a catch-up fetch that
|
|
244
|
+
// pulled the true boundary can still have it silently dropped
|
|
245
|
+
// by that cap, leaving a falsely-confident `unreadCapped:false`
|
|
246
|
+
// (bug #34's failure mode again, just one layer downstream).
|
|
247
|
+
// Simulate that cap here so the flag reflects what will
|
|
248
|
+
// actually survive, not just what this fetch retrieved.
|
|
249
|
+
const simulatedStored = combined.length > _roomsSlice.RUNTIME_MESSAGE_LIMIT ? combined.slice(-_roomsSlice.RUNTIME_MESSAGE_LIMIT) : combined;
|
|
250
|
+
const unreadCapped = computeUnreadCapped(nextRoom, simulatedStored, pageSize);
|
|
188
251
|
_roomStore.store.dispatch((0, _roomsSlice.applyRoomsPreloadBatch)({
|
|
189
252
|
rooms: [{
|
|
190
253
|
jid: item.jid,
|
|
191
|
-
messages:
|
|
254
|
+
messages: combined,
|
|
192
255
|
unreadCapped,
|
|
193
256
|
historyPreloadState: 'done'
|
|
194
257
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_roomStore","_roomsSlice","DEFAULT_CONCURRENCY","DEFAULT_PAGE_SIZE","DEFAULT_RETRY_LIMIT","sleep","ms","Promise","resolve","setTimeout","messageTimestamp","m","t","timestamp","Number","isFinite","id","getRoomLastActivityScore","room","messages","length","reduce","max","Math","computeUnreadCapped","pageSize","historyComplete","countable","filter","msg","pending","lastViewed","lastViewedTimestamp","oldestTs","minTs","ts","min","MAX_SAFE_INTEGER","getRoomPriority","jid","_room","selectedRoomJid","defaultRoomJids","has","shouldPauseForVisibility","AppState","currentState","runHistoryPreloadScheduler","options","client","signal","concurrency","retryLimit","roomLimit","forceReload","aborted","store","dispatch","setUnreadSyncing","state","getState","rooms","defaultSet","Set","sortedQueue","Object","entries","map","priority","activityScore","attempts","readyAt","Date","now","sort","a","b","localeCompare","queue","slice","inFlightByRoom","Map","consecutiveErrorCount","isActiveRoomGateOpen","readyItems","item","batch","preBatchPreloadStateByJid","historyPreloadState","applyRoomsPreloadBatch","all","queueIndex","findIndex","queued","splice","task","currentRoom","preState","get","fetchedMessages","getHistoryStanza","undefined","coalesceRoom","skipIfPreloaded","source","Error","nextRoom","unreadCapped","retries","canRetry","jitter","floor","random","backoff","push","set","finally","delete","r","exports","_default","default"],"sourceRoot":"../../../src","sources":["helpers/historyPreloadScheduler.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAuBA,MAAMG,mBAAmB,GAAG,CAAC;AAC7B;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,mBAAmB,GAAG,CAAC;AAE7B,MAAMC,KAAK,GAAIC,EAAU,IAAK,IAAIC,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC,CAAC;AAE/E,MAAMI,gBAAgB,GAAIC,CAAW,IAAa;EAChD,IAAI,CAACA,CAAC,EAAE;IAAC,OAAO,CAAC;EAAC;EAClB,MAAMC,CAAC,GAAID,CAAC,CAASE,SAAS;EAC9B,IAAIC,MAAM,CAACC,QAAQ,CAACH,CAAC,CAAC,IAAIA,CAAC,GAAG,CAAC,EAAE;IAAC,OAAOE,MAAM,CAACF,CAAC,CAAC;EAAC;EACnD,MAAMI,EAAE,GAAGF,MAAM,CAACH,CAAC,CAACK,EAAE,CAAC;EACvB,IAAIF,MAAM,CAACC,QAAQ,CAACC,EAAE,CAA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AAIA,qBAAqB,IAAI,CAAC,EAAE;cAC9B,MAAM7E,KAAK,CAAC,GAAG,CAAC;cAChB6E,qBAAqB,GAAG,CAAC;YAC3B;UACF;QACF,CAAC,EAAE,CAAC;QAEJF,cAAc,CAACmC,GAAG,CAAC9B,IAAI,CAAC9C,GAAG,EAAEwD,IAAI,CAAC;QAClC,MAAMA,IAAI,CAACqB,OAAO,CAAC,MAAMpC,cAAc,CAACqC,MAAM,CAAChC,IAAI,CAAC9C,GAAG,CAAC,CAAC;MAC3D,CAAC,CACH,CAAC;;MAED;MACA,MAAM,IAAIhC,OAAO,CAAE+G,CAAC,IAAK7G,UAAU,CAAC6G,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C;EACA,CAAC,SAAS;IACR9D,gBAAK,CAACC,QAAQ,CAAC,IAAAC,4BAAgB,EAAC,KAAK,CAAC,CAAC;EACzC;AACF,CAAC;AAAC6D,OAAA,CAAAxE,0BAAA,GAAAA,0BAAA;AAAA,IAAAyE,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEa1E,0BAA0B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_roomStore","_roomsSlice","DEFAULT_CONCURRENCY","DEFAULT_PAGE_SIZE","DEFAULT_RETRY_LIMIT","MAX_UNREAD_CATCHUP_PAGES","sleep","ms","Promise","resolve","setTimeout","messageTimestamp","m","t","timestamp","Number","isFinite","id","getRoomLastActivityScore","room","messages","length","reduce","max","Math","computeUnreadCapped","pageSize","historyComplete","countable","filter","msg","pending","lastViewed","lastViewedTimestamp","oldestTs","minTs","ts","min","MAX_SAFE_INTEGER","getRoomPriority","jid","_room","selectedRoomJid","defaultRoomJids","has","shouldPauseForVisibility","AppState","currentState","runHistoryPreloadScheduler","options","client","signal","concurrency","retryLimit","roomLimit","forceReload","aborted","store","dispatch","setUnreadSyncing","state","getState","rooms","defaultSet","Set","sortedQueue","Object","entries","map","priority","activityScore","attempts","readyAt","Date","now","sort","a","b","localeCompare","queue","slice","inFlightByRoom","Map","consecutiveErrorCount","isActiveRoomGateOpen","readyItems","item","batch","preBatchPreloadStateByJid","historyPreloadState","applyRoomsPreloadBatch","all","queueIndex","findIndex","queued","splice","task","currentRoom","preState","get","fetchedMessages","getHistoryStanza","undefined","coalesceRoom","skipIfPreloaded","source","Error","nextRoom","combined","lastPageLen","extraPages","oldestId","idNum","older","simulatedStored","RUNTIME_MESSAGE_LIMIT","unreadCapped","retries","canRetry","jitter","floor","random","backoff","push","set","finally","delete","r","exports","_default","default"],"sourceRoot":"../../../src","sources":["helpers/historyPreloadScheduler.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AA2BA,MAAMG,mBAAmB,GAAG,CAAC;AAC7B;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,EAAE;AAC5B,MAAMC,mBAAmB,GAAG,CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,CAAC;AAElC,MAAMC,KAAK,GAAIC,EAAU,IAAK,IAAIC,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEF,EAAE,CAAC,CAAC;AAE/E,MAAMI,gBAAgB,GAAIC,CAAW,IAAa;EAChD,IAAI,CAACA,CAAC,EAAE;IAAC,OAAO,CAAC;EAAC;EAClB,MAAMC,CAAC,GAAID,CAAC,CAASE,SAAS;EAC9B,IAAIC,MAAM,CAACC,QAAQ,CAACH,CAAC,CAAC,IAAIA,CAAC,GAAG,CAAC,EAAE;IAAC,OAAOE,MAAM,CAACF,CAAC,CAAC;EAAC;EACnD,MAAMI,EAAE,GAAGF,MAAM,CAACH,CAAC,CAACK,EAAE,CAAC;EACvB,IAAIF,MAAM,CAACC,QAAQ,CAACC,EAAE,CAAC,IAAIA,EAAE,GAAG,CAAC,EAAE;IAAC,OAAOA,EAAE;EAAC;EAC9C,OAAO,CAAC;AACV,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F,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEalF,0BAA0B","ignoreList":[]}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
8
|
-
var _updatedChatLastTimestamps = require("./updatedChatLastTimestamps");
|
|
9
8
|
var _initRoomsPresence = require("./initRoomsPresence");
|
|
10
9
|
var _roomStore = require("../roomStore");
|
|
10
|
+
var _authRefresh = require("../networking/authRefresh");
|
|
11
11
|
const initXmppRooms = async (user, config, xmmpClient, rooms, roomJID) => {
|
|
12
12
|
if (roomJID) {
|
|
13
13
|
_roomStore.store.dispatch((0, _roomsSlice.setCurrentRoom)({
|
|
@@ -43,16 +43,22 @@ const initXmppRooms = async (user, config, xmmpClient, rooms, roomJID) => {
|
|
|
43
43
|
console.log(res);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
// getChatsPrivateStoreRequestStanza hydrates redux itself
|
|
47
|
+
// (dispatch(applyPrivateStoreMarkers(...)) internally, clamped +
|
|
48
|
+
// forward-only) - do not also apply the raw return value here. That
|
|
49
|
+
// used to double-dispatch via updatedChatLastTimestamps' unconditional
|
|
50
|
+
// setLastViewedTimestamp, which has neither the forward-only guard
|
|
51
|
+
// nor the future-marker clamp, so it could silently re-clobber a
|
|
52
|
+
// value the clamp had just corrected (bug #38).
|
|
53
|
+
await xmmpClient.getChatsPrivateStoreRequestStanza();
|
|
49
54
|
} else {
|
|
50
|
-
|
|
51
|
-
const roomTimestampObject = await xmmpClient.getChatsPrivateStoreRequestStanza();
|
|
52
|
-
(0, _updatedChatLastTimestamps.updatedChatLastTimestamps)(roomTimestampObject, _roomStore.store.dispatch);
|
|
55
|
+
await xmmpClient.getChatsPrivateStoreRequestStanza();
|
|
53
56
|
}
|
|
54
57
|
if (config?.refreshTokens?.enabled) {
|
|
55
|
-
|
|
58
|
+
// Was a bare call to the consumer-supplied refreshFunction, i.e. a
|
|
59
|
+
// rotation completely outside the SDK's lock. Routed through the
|
|
60
|
+
// one rotation point, which calls that same function internally.
|
|
61
|
+
(0, _authRefresh.refreshAuthTokensQuietly)();
|
|
56
62
|
}
|
|
57
63
|
} catch (error) {
|
|
58
64
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_roomsSlice","require","
|
|
1
|
+
{"version":3,"names":["_roomsSlice","require","_initRoomsPresence","_roomStore","_authRefresh","initXmppRooms","user","config","xmmpClient","rooms","roomJID","store","dispatch","setCurrentRoom","defaultWallet","walletAddress","console","log","Object","keys","length","initRoomsPresence","newArch","res","getRoomsStanza","getChatsPrivateStoreRequestStanza","refreshTokens","enabled","refreshAuthTokensQuietly","error","setIsLoading","loading","_default","exports","default"],"sourceRoot":"../../../src","sources":["helpers/initXmppRooms.tsx"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,MAAMI,aAAa,GAAG,MAAAA,CACpBC,IAAU,EACVC,MAAe,EACfC,UAAsB,EACtBC,KAAgC,EAChCC,OAAgB,KACb;EACH,IAAIA,OAAO,EAAE;IACXC,gBAAK,CAACC,QAAQ,CAAC,IAAAC,0BAAc,EAAC;MAAEH,OAAO,EAAEA;IAAQ,CAAC,CAAC,CAAC;EACtD;EAEA,IAAI;IACF,IAAI,CAACJ,IAAI,CAACQ,aAAa,IAAI,CAACR,IAAI,CAACQ,aAAa,CAACC,aAAa,EAAE;MAC5DC,OAAO,CAACC,GAAG,CAAC,gBAAgB,CAAC;MAC7B;IACF;IAEA,IAAI,CAACT,UAAU,EAAE;MACfQ,OAAO,CAACC,GAAG,CAAC,iCAAiC,CAAC;MAE9C,IAAIR,KAAK,IAAIS,MAAM,CAACC,IAAI,CAACV,KAAK,CAAC,CAACW,MAAM,GAAG,CAAC,EAAE;QAC1C,MAAM,IAAAC,oCAAiB,EAACb,UAAU,EAAEC,KAAK,CAAC;MAC5C,CAAC,MAAM;QACL,IAAIF,MAAM,EAAEe,OAAO,EAAE;UACnB;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;QACF;QACA,MAAMC,GAAG,GAAG,MAAOf,UAAU,CAAuBgB,cAAc,CAAC,CAAC;QACpER,OAAO,CAACC,GAAG,CAACM,GAAG,CAAC;MAClB;;MAEA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,MAAOf,UAAU,CAAuBiB,iCAAiC,CAAC,CAAC;IAC7E,CAAC,MAAM;MACL,MAAMjB,UAAU,CAACiB,iCAAiC,CAAC,CAAC;IACtD;IAEA,IAAIlB,MAAM,EAAEmB,aAAa,EAAEC,OAAO,EAAE;MAClC;MACA;MACA;MACA,IAAAC,qCAAwB,EAAC,CAAC;IAC5B;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdb,OAAO,CAACa,KAAK,CAACA,KAAK,CAAC;EACtB,CAAC,SAAS;IACRlB,gBAAK,CAACC,QAAQ,CAAC,IAAAkB,wBAAY,EAAC;MAAEC,OAAO,EAAE;IAAM,CAAC,CAAC,CAAC;EAClD;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa7B,aAAa","ignoreList":[]}
|
|
@@ -5,6 +5,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.insertMessageWithDelimiter = insertMessageWithDelimiter;
|
|
7
7
|
var _dateComparison = require("./dateComparison");
|
|
8
|
+
var _msgSortableMs = require("./msgSortableMs");
|
|
9
|
+
// Robustly resolve a caller-supplied read marker to epoch milliseconds.
|
|
10
|
+
// Callers pass a plain number (the redux read boundary, or a room's
|
|
11
|
+
// lastViewedTimestamp), a Date object (older call sites), or occasionally
|
|
12
|
+
// a numeric string. These are NOT interchangeable through the Date
|
|
13
|
+
// constructor: `new Date(1757000000123)` (a number) reads as epoch-ms,
|
|
14
|
+
// but `new Date("1757000000123")` (a string) is parsed as a date STRING
|
|
15
|
+
// - a bare 13-digit string matches no recognized date format, so the
|
|
16
|
+
// result is silently Invalid Date and every comparison against it is
|
|
17
|
+
// `false`. Try Number() first so a numeric string/number is read as
|
|
18
|
+
// epoch-ms; only fall through to Date parsing for genuine date/ISO
|
|
19
|
+
// strings (e.g. a Date object's own `.toString()`). Never falls back to
|
|
20
|
+
// `Date.now()` - a marker we can't resolve is treated as "no marker",
|
|
21
|
+
// not "now" (bug #38).
|
|
22
|
+
function resolveMarkerMs(marker) {
|
|
23
|
+
if (marker == null) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
if (typeof marker === 'number') {
|
|
27
|
+
return Number.isFinite(marker) ? marker : 0;
|
|
28
|
+
}
|
|
29
|
+
const raw = marker.toString();
|
|
30
|
+
if (raw.trim() !== '') {
|
|
31
|
+
const asNumber = Number(raw);
|
|
32
|
+
if (Number.isFinite(asNumber)) {
|
|
33
|
+
return asNumber;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const parsed = Date.parse(raw);
|
|
37
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
38
|
+
}
|
|
8
39
|
function deepMerge(target, source) {
|
|
9
40
|
for (const key in source) {
|
|
10
41
|
if (source[key] === undefined) {
|
|
@@ -66,21 +97,32 @@ function insertMessageWithDelimiter(roomMessages, message, lastViewedTimestamp)
|
|
|
66
97
|
} else {
|
|
67
98
|
roomMessages.push(message);
|
|
68
99
|
}
|
|
69
|
-
|
|
70
|
-
|
|
100
|
+
const lastViewedMs = resolveMarkerMs(lastViewedTimestamp);
|
|
101
|
+
const newMessageMs = (0, _msgSortableMs.msgSortableMs)(message);
|
|
102
|
+
if (lastViewedMs > 0 && newMessageMs > lastViewedMs && !roomMessages.some(msg => msg.id === 'delimiter-new')) {
|
|
103
|
+
// Find the first message STRICTLY newer than the marker, using the
|
|
104
|
+
// SAME timestamp source (msgSortableMs - the server id-encoded ms)
|
|
105
|
+
// as the unread middleware and countNewerMessages use to decide
|
|
106
|
+
// what counts as unread. Comparing against a DIFFERENT source (the
|
|
107
|
+
// old code compared `msg.date` strings) risks the boundary message
|
|
108
|
+
// itself landing on the wrong side of the cut: since bug #38 the
|
|
109
|
+
// marker can equal a real message's own timestamp exactly, and any
|
|
110
|
+
// drift between `date` and the id-encoded ms - or a raw numeric
|
|
111
|
+
// marker silently producing an Invalid Date via the Date
|
|
112
|
+
// constructor's string-parsing path - could count that message as
|
|
113
|
+
// unread, pushing the divider one message too early (ABOVE the
|
|
114
|
+
// last read message instead of directly below it). Customer #42.
|
|
115
|
+
const delimiterIndex = roomMessages.findIndex(msg => msg.id !== 'delimiter-new' && (0, _msgSortableMs.msgSortableMs)(msg) > lastViewedMs);
|
|
71
116
|
if (delimiterIndex !== -1) {
|
|
72
117
|
// The divider's date is what ORDERS it: roomsSlice re-sorts every
|
|
73
118
|
// merged page by timestamp (see `byMs`), so a divider stamped with
|
|
74
|
-
// `new Date()`
|
|
119
|
+
// `new Date()` (i.e. now) sorted past every real message and
|
|
75
120
|
// rendered at the very bottom, BELOW the new messages it is
|
|
76
121
|
// supposed to introduce. Anchor it a hair before the first unread
|
|
77
122
|
// instead, which is where it belongs and where any later sort keeps
|
|
78
|
-
// it.
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const rawLastViewed = lastViewedTimestamp.toString();
|
|
82
|
-
const lastViewedMs = Date.parse(rawLastViewed) || Number(rawLastViewed) || Date.now();
|
|
83
|
-
const anchorMs = Number.isFinite(firstUnreadMs) ? firstUnreadMs - 1 : lastViewedMs;
|
|
123
|
+
// it.
|
|
124
|
+
const firstUnreadMs = (0, _msgSortableMs.msgSortableMs)(roomMessages[delimiterIndex]);
|
|
125
|
+
const anchorMs = firstUnreadMs > 0 ? firstUnreadMs - 1 : lastViewedMs;
|
|
84
126
|
roomMessages.splice(delimiterIndex, 0, {
|
|
85
127
|
id: 'delimiter-new',
|
|
86
128
|
user: {
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
1
|
+
{"version":3,"names":["_dateComparison","require","_msgSortableMs","resolveMarkerMs","marker","Number","isFinite","raw","toString","trim","asNumber","parsed","Date","parse","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","index","push","lastViewedMs","newMessageMs","msgSortableMs","some","delimiterIndex","firstUnreadMs","anchorMs","splice","name","token","refreshToken","toISOString","body","roomJid","isDateBefore","unshift","i"],"sourceRoot":"../../../src","sources":["helpers/insertMessageWithDelimiter.ts"],"mappings":";;;;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,eAAeA,CACtBC,MAA8D,EACtD;EACR,IAAIA,MAAM,IAAI,IAAI,EAAE;IAAC,OAAO,CAAC;EAAC;EAC9B,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOC,MAAM,CAACC,QAAQ,CAACF,MAAM,CAAC,GAAGA,MAAM,GAAG,CAAC;EAC7C;EACA,MAAMG,GAAG,GAAGH,MAAM,CAACI,QAAQ,CAAC,CAAC;EAC7B,IAAID,GAAG,CAACE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAMC,QAAQ,GAAGL,MAAM,CAACE,GAAG,CAAC;IAC5B,IA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C,OAAO,CAACnC,OAAO,CAAC;EAC/B,CAAC,MAAM;IACL,KAAK,IAAIoC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGrC,YAAY,CAACgB,MAAM,EAAEqB,CAAC,EAAE,EAAE;MAC5C,IACE,IAAAF,4BAAY,EAACtB,cAAc,CAAC3B,QAAQ,CAAC,CAAC,EAAEc,YAAY,CAACqC,CAAC,CAAC,CAACvB,IAAI,EAAE5B,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAC/E;QACAc,YAAY,CAAC4B,MAAM,CAACS,CAAC,EAAE,CAAC,EAAEpC,OAAO,CAAC;QAClC;MACF;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isOwnMessage = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Bug #41: during reconnect catch-up (app was backgrounded/offline, then
|
|
9
|
+
* comes back online), messages replayed from MAM could transiently render
|
|
10
|
+
* on the RIGHT (as if sent by the current user) before flipping to the
|
|
11
|
+
* LEFT a moment later. Root cause: `message.user.id === walletAddress`
|
|
12
|
+
* treats `undefined === undefined` (or `'' === ''`) as a match, and the
|
|
13
|
+
* two sides could independently be empty for one frame -- the message's
|
|
14
|
+
* sender id before the MAM-derived value settled, and/or the current
|
|
15
|
+
* user's id before it rehydrated. Two blank ids must never compare equal.
|
|
16
|
+
*
|
|
17
|
+
* A second, related issue: the same logical sender id can show up in
|
|
18
|
+
* different shapes depending on which code path produced it -- a bare
|
|
19
|
+
* id ("wallet123") or a bare JID with an incidental session resource
|
|
20
|
+
* ("wallet123@host/sessionResource", as `senderJID` attrs carry on the
|
|
21
|
+
* wire -- see src/assets/test.xml). In every shape used in this
|
|
22
|
+
* codebase the identifying segment is the part BEFORE the first '@' (or
|
|
23
|
+
* before '/' when there's no '@'); anything after that -- domain,
|
|
24
|
+
* resource -- is noise. Comparing raw strings with `===` fails whenever
|
|
25
|
+
* one side still carries that noise and the other doesn't. Normalizing
|
|
26
|
+
* both sides (strip resource, strip domain, lowercase) before comparing
|
|
27
|
+
* makes the check tolerant of that drift.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Strip a MUC resource (`room@host/resource` -> `room@host`) and then a
|
|
32
|
+
* JID domain (`local@host` -> `local`), lowercasing the result. Applies
|
|
33
|
+
* to both plain ids and full/partial JIDs so either shape normalizes to
|
|
34
|
+
* the same comparable value.
|
|
35
|
+
*/
|
|
36
|
+
const normalizeId = raw => {
|
|
37
|
+
const value = String(raw ?? '').trim();
|
|
38
|
+
if (!value) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
const withoutResource = value.split('/')[0];
|
|
42
|
+
const withoutDomain = withoutResource.includes('@') ? withoutResource.split('@')[0] : withoutResource;
|
|
43
|
+
return withoutDomain.toLowerCase();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Same precedence the rest of the app uses when it needs "who am I" as a
|
|
47
|
+
// single id: xmppUsername first, walletAddress as the fallback.
|
|
48
|
+
const resolveCurrentUserId = currentUser => {
|
|
49
|
+
if (typeof currentUser === 'string') {
|
|
50
|
+
return currentUser;
|
|
51
|
+
}
|
|
52
|
+
if (!currentUser) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
return currentUser.xmppUsername || currentUser.walletAddress || currentUser.id || '';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Robustly determine whether `message` was sent by `currentUser`. Never
|
|
60
|
+
* returns true from two blank/undefined ids, and tolerates bare-id vs.
|
|
61
|
+
* full-JID mismatches between the sender id and the current user id.
|
|
62
|
+
*/
|
|
63
|
+
const isOwnMessage = (message, currentUser) => {
|
|
64
|
+
const messageUserId = normalizeId(message?.user?.id);
|
|
65
|
+
if (!messageUserId) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
const currentUserId = normalizeId(resolveCurrentUserId(currentUser));
|
|
69
|
+
if (!currentUserId) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return messageUserId === currentUserId;
|
|
73
|
+
};
|
|
74
|
+
exports.isOwnMessage = isOwnMessage;
|
|
75
|
+
//# sourceMappingURL=isOwnMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeId","raw","value","String","trim","withoutResource","split","withoutDomain","includes","toLowerCase","resolveCurrentUserId","currentUser","xmppUsername","walletAddress","id","isOwnMessage","message","messageUserId","user","currentUserId","exports"],"sourceRoot":"../../../src","sources":["helpers/isOwnMessage.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAIC,GAAY,IAAa;EAC5C,MAAMC,KAAK,GAAGC,MAAM,CAACF,GAAG,IAAI,EAAE,CAAC,CAACG,IAAI,CAAC,CAAC;EACtC,IAAI,CAACF,KAAK,EAAE;IACV,OAAO,EAAE;EACX;EACA,MAAMG,eAAe,GAAGH,KAAK,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC3C,MAAMC,aAAa,GAAGF,eAAe,CAACG,QAAQ,CAAC,GAAG,CAAC,GAC/CH,eAAe,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAC7BD,eAAe;EACnB,OAAOE,aAAa,CAACE,WAAW,CAAC,CAAC;AACpC,CAAC;;AAED;AACA;AACA,MAAMC,oBAAoB,GAAIC,WAAkC,IAAa;EAC3E,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;IACnC,OAAOA,WAAW;EACpB;EACA,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,OACEA,WAAW,CAACC,YAAY,IAAID,WAAW,CAACE,aAAa,IAAIF,WAAW,CAACG,EAAE,IAAI,EAAE;AAEjF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAGA,CAC1BC,OAAkD,EAClDL,WAAkC,KACtB;EACZ,MAAMM,aAAa,GAAGjB,WAAW,CAACgB,OAAO,EAAEE,IAAI,EAAEJ,EAAE,CAAC;EACpD,IAAI,CAACG,aAAa,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,MAAME,aAAa,GAAGnB,WAAW,CAACU,oBAAoB,CAACC,WAAW,CAAC,CAAC;EACpE,IAAI,CAACQ,aAAa,EAAE;IAClB,OAAO,KAAK;EACd;EAEA,OAAOF,aAAa,KAAKE,aAAa;AACxC,CAAC;AAACC,OAAA,CAAAL,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -14,7 +14,17 @@ exports.getKeyboardVerticalOffset = getKeyboardVerticalOffset;
|
|
|
14
14
|
const getInputDockPaddingBottom = ({
|
|
15
15
|
platform,
|
|
16
16
|
bottomInset = 0,
|
|
17
|
-
keyboardVisible = false
|
|
18
|
-
|
|
17
|
+
keyboardVisible = false,
|
|
18
|
+
configuredPadding,
|
|
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
|
+
};
|
|
19
29
|
exports.getInputDockPaddingBottom = getInputDockPaddingBottom;
|
|
20
30
|
//# sourceMappingURL=keyboardLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"names":["ANDROID_INPUT_DOCK_GAP","exports","getKeyboardVerticalOffset","platform","configuredOffset","bottomInset","getInputDockPaddingBottom","keyboardVisible","configuredPadding","hostOwnsLayout"],"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;AAcrD,MAAMI,yBAAyB,GAAGA,CAAC;EACxCH,QAAQ;EACRE,WAAW,GAAG,CAAC;EACfE,eAAe,GAAG,KAAK;EACvBC,iBAAiB;EACjBC,cAAc,GAAG;AACG,CAAC,KAAa;EAClC,IAAI,OAAOD,iBAAiB,KAAK,QAAQ,EAAE;IACzC,OAAOA,iBAAiB;EAC1B;EACA,IAAIC,cAAc,EAAE;IAClB,OAAO,CAAC;EACV;EACA,OAAON,QAAQ,KAAK,KAAK,GAAGE,WAAW,GAAGL,sBAAsB;AAClE,CAAC;AAACC,OAAA,CAAAK,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -8,10 +8,32 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Optional palette for the colour-bearing nodes (links, code grounds, quote
|
|
13
|
+
* rule). Helpers can't use hooks; callers pass the resolved theme. Omitted →
|
|
14
|
+
* the historical hard-coded colours, so existing output is unchanged.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const MarkDown = (text, theme) => {
|
|
12
18
|
if (typeof text !== 'string') {
|
|
13
19
|
return [text];
|
|
14
20
|
}
|
|
21
|
+
|
|
22
|
+
// Colour overrides layered over the static StyleSheet below.
|
|
23
|
+
const themed = theme ? {
|
|
24
|
+
link: {
|
|
25
|
+
color: theme.primary
|
|
26
|
+
},
|
|
27
|
+
codeInline: {
|
|
28
|
+
backgroundColor: theme.surfaceSecondary
|
|
29
|
+
},
|
|
30
|
+
codeBlock: {
|
|
31
|
+
backgroundColor: theme.surfaceSecondary
|
|
32
|
+
},
|
|
33
|
+
quote: {
|
|
34
|
+
borderLeftColor: theme.border
|
|
35
|
+
}
|
|
36
|
+
} : undefined;
|
|
15
37
|
let key = 0;
|
|
16
38
|
const elements = [];
|
|
17
39
|
const lines = text.split('\n');
|
|
@@ -53,14 +75,14 @@ const MarkDown = text => {
|
|
|
53
75
|
}, `s-${key++}`));
|
|
54
76
|
} else if (/^`.*`$/.test(token)) {
|
|
55
77
|
output.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
56
|
-
style: styles.codeInline,
|
|
78
|
+
style: [styles.codeInline, themed?.codeInline],
|
|
57
79
|
children: token.slice(1, -1).trim()
|
|
58
80
|
}, `code-${key++}`));
|
|
59
81
|
} else if (/^https:\/\//.test(token)) {
|
|
60
82
|
output.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
61
83
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
62
84
|
onPress: () => _reactNative.Linking.openURL(token),
|
|
63
|
-
style: styles.link,
|
|
85
|
+
style: [styles.link, themed?.link],
|
|
64
86
|
children: token
|
|
65
87
|
})
|
|
66
88
|
}, `link-${key++}`));
|
|
@@ -122,7 +144,7 @@ const MarkDown = text => {
|
|
|
122
144
|
if (inCodeBlock && line.trim() === '```') {
|
|
123
145
|
inCodeBlock = false;
|
|
124
146
|
elements.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
125
|
-
style: styles.codeBlock,
|
|
147
|
+
style: [styles.codeBlock, themed?.codeBlock],
|
|
126
148
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
127
149
|
style: styles.codeBlockText,
|
|
128
150
|
children: codeBuffer.join('\n')
|
|
@@ -150,7 +172,7 @@ const MarkDown = text => {
|
|
|
150
172
|
}
|
|
151
173
|
if (line.startsWith('>')) {
|
|
152
174
|
elements.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
153
|
-
style: styles.quote,
|
|
175
|
+
style: [styles.quote, themed?.quote],
|
|
154
176
|
children: parseInline(line.replace(/^>\s*/, '')).map((el, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
155
177
|
children: el
|
|
156
178
|
}, idx))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","MarkDown","text","key","elements","lines","split","inCodeBlock","codeLanguage","codeBuffer","parseInline","input","output","regex","lastIndex","match","exec","index","push","slice","token","test","jsx","Text","style","styles","bold","children","italic","strike","codeInline","trim","onPress","Linking","openURL","link","length","parseList","startIndex","items","line","isOrdered","start","parseInt","i","currentLine","itemText","replace","jsxs","View","listItem","listMarker","listItemContent","map","el","idx","Fragment","ListTag","list","newIndex","startsWith","codeBlock","codeBlockText","join","level","content","headingStyle","h1","quote","break","paragraph","exports","StyleSheet","create","fontWeight","fontStyle","textDecorationLine","backgroundColor","paddingHorizontal","paddingVertical","borderRadius","fontFamily","fontSize","color","padding","marginVertical","marginTop","marginBottom","h2","h3","h4","h5","h6","borderLeftWidth","borderLeftColor","paddingLeft","flexDirection","marginRight","minWidth","flex","height"],"sourceRoot":"../../../src","sources":["helpers/markdownParser.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAiF,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1E,MAAMG,QAAQ,GAAIC,IAAY,IAA+B;EAClE,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAAC,OAAO,CAACA,IAAI,CAAC;EAAC;EAE7C,IAAIC,GAAG,GAAG,CAAC;EACX,MAAMC,QAAkC,GAAG,EAAE;EAC7C,MAAMC,KAAK,GAAGH,IAAI,CAACI,KAAK,CAAC,IAAI,CAAC;EAE9B,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,YAAY,GAAG,EAAE;EACrB,MAAMC,UAAoB,GAAG,EAAE;EAE/B,MAAMC,WAAW,GAAIC,KAAa,IAA+B;IAC/D,MAAMC,MAAgC,GAAG,EAAE;IAE3C,MAAMC,KAAK,GACT,kIAAkI;IAEpI,IAAIC,SAAS,GAAG,CAAC;IACjB,IAAIC,KAAK;IAET,OAAO,CAACA,KAAK,GAAGF,KAAK,CAACG,IAAI,CAACL,KAAK,CAAC,MAAM,IAAI,EAAE;MAC3C,IAAII,KAAK,CAACE,KAAK,GAAGH,SAAS,EAAE;QAC3BF,MAAM,CAACM,IAAI,CAACP,KAAK,CAACQ,KAAK,CAACL,SAAS,EAAEC,KA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EAAE,EAAE;IACFR,QAAQ,EAAE,EAAE;IACZR,UAAU,EAAE,MAAM;IAClBY,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDI,EAAE,EAAE;IACFT,QAAQ,EAAE,EAAE;IACZR,UAAU,EAAE,MAAM;IAClBY,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDK,EAAE,EAAE;IACFV,QAAQ,EAAE,EAAE;IACZR,UAAU,EAAE,MAAM;IAClBY,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE;EAChB,CAAC;EACDnB,KAAK,EAAE;IACLyB,eAAe,EAAE,CAAC;IAClBC,eAAe,EAAE,MAAM;IACvBC,WAAW,EAAE,EAAE;IACfV,cAAc,EAAE;EAClB,CAAC;EACD3B,IAAI,EAAE;IACJ2B,cAAc,EAAE,CAAC;IACjBU,WAAW,EAAE;EACf,CAAC;EACD7C,QAAQ,EAAE;IACR8C,aAAa,EAAE,KAAK;IACpBT,YAAY,EAAE;EAChB,CAAC;EACDpC,UAAU,EAAE;IACV8C,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACD9C,eAAe,EAAE;IACf+C,IAAI,EAAE;EACR,CAAC;EACD7B,SAAS,EAAE;IACTe,cAAc,EAAE;EAClB,CAAC;EACDhB,KAAK,EAAE;IACL+B,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","MarkDown","text","theme","themed","link","color","primary","codeInline","backgroundColor","surfaceSecondary","codeBlock","quote","borderLeftColor","border","undefined","key","elements","lines","split","inCodeBlock","codeLanguage","codeBuffer","parseInline","input","output","regex","lastIndex","match","exec","index","push","slice","token","test","jsx","Text","style","styles","bold","children","italic","strike","trim","onPress","Linking","openURL","length","parseList","startIndex","items","line","isOrdered","start","parseInt","i","currentLine","itemText","replace","jsxs","View","listItem","listMarker","listItemContent","map","el","idx","Fragment","ListTag","list","newIndex","startsWith","codeBlockText","join","level","content","headingStyle","h1","break","paragraph","exports","StyleSheet","create","fontWeight","fontStyle","textDecorationLine","paddingHorizontal","paddingVertical","borderRadius","fontFamily","fontSize","padding","marginVertical","marginTop","marginBottom","h2","h3","h4","h5","h6","borderLeftWidth","paddingLeft","flexDirection","marginRight","minWidth","flex","height"],"sourceRoot":"../../../src","sources":["helpers/markdownParser.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAiF,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjF;AACA;AACA;AACA;AACA;;AAMO,MAAMG,QAAQ,GAAGA,CACtBC,IAAY,EACZC,KAAqB,KACQ;EAC7B,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IAAC,OAAO,CAACA,IAAI,CAAC;EAAC;;EAE7C;EACA,MAAME,MAAM,GAAGD,KAAK,GAChB;IACEE,IAAI,EAAE;MAAEC,KAAK,EAAEH,KAAK,CAACI;IAAQ,CAAC;IAC9BC,UAAU,EAAE;MAAEC,eAAe,EAAEN,KAAK,CAACO;IAAiB,CAAC;IACvDC,SAAS,EAAE;MAAEF,eAAe,EAAEN,KAAK,CAACO;IAAiB,CAAC;IACtDE,KAAK,EAAE;MAAEC,eAAe,EAAEV,KAAK,CAACW;IAAO;EACzC,CAAC,GACDC,SAAS;EAEb,IAAIC,GAAG,GAAG,CAAC;EACX,MAAMC,QAAkC,GAAG,EAAE;EAC7C,MAAMC,KAAK,GAAGhB,IAAI,CAACiB,KAAK,CAAC,IAAI,CAAC;EAE9B,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,YAAY,GAAG,EAAE;EACrB,MAAMC,UAAoB,GAAG,EAAE;EA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AAe,EAAE;IACf0C,IAAI,EAAE;EACR,CAAC;EACD1B,SAAS,EAAE;IACTa,cAAc,EAAE;EAClB,CAAC;EACDd,KAAK,EAAE;IACL4B,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMediaLibrary = exports.__resetMediaLibraryCache = void 0;
|
|
7
|
+
let cached;
|
|
8
|
+
const getMediaLibrary = () => {
|
|
9
|
+
if (cached !== undefined) {
|
|
10
|
+
return cached;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const legacy = require('expo-media-library/legacy');
|
|
14
|
+
if (legacy?.getAssetsAsync) {
|
|
15
|
+
cached = legacy;
|
|
16
|
+
return cached;
|
|
17
|
+
}
|
|
18
|
+
} catch {}
|
|
19
|
+
try {
|
|
20
|
+
cached = require('expo-media-library') ?? null;
|
|
21
|
+
} catch {
|
|
22
|
+
cached = null;
|
|
23
|
+
}
|
|
24
|
+
return cached;
|
|
25
|
+
};
|
|
26
|
+
exports.getMediaLibrary = getMediaLibrary;
|
|
27
|
+
const __resetMediaLibraryCache = () => {
|
|
28
|
+
cached = undefined;
|
|
29
|
+
};
|
|
30
|
+
exports.__resetMediaLibraryCache = __resetMediaLibraryCache;
|
|
31
|
+
//# sourceMappingURL=mediaLibraryRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cached","getMediaLibrary","undefined","legacy","require","getAssetsAsync","exports","__resetMediaLibraryCache"],"sourceRoot":"../../../src","sources":["helpers/mediaLibraryRuntime.ts"],"mappings":";;;;;;AAAA,IAAIA,MAAuB;AAEpB,MAAMC,eAAe,GAAGA,CAAA,KAAkB;EAC/C,IAAID,MAAM,KAAKE,SAAS,EAAE;IAAC,OAAOF,MAAM;EAAC;EACzC,IAAI;IACF,MAAMG,MAAM,GAAGC,OAAO,CAAC,2BAA2B,CAAC;IAEnD,IAAID,MAAM,EAAEE,cAAc,EAAE;MAC1BL,MAAM,GAAGG,MAAM;MACf,OAAOH,MAAM;IACf;EACF,CAAC,CAAC,MAAM,CACR;EAEA,IAAI;IACFA,MAAM,GAAGI,OAAO,CAAC,oBAAoB,CAAC,IAAI,IAAI;EAChD,CAAC,CAAC,MAAM;IACNJ,MAAM,GAAG,IAAI;EACf;EACA,OAAOA,MAAM;AACf,CAAC;AAACM,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,wBAAwB,GAAGA,CAAA,KAAM;EAC5CP,MAAM,GAAGE,SAAS;AACpB,CAAC;AAACI,OAAA,CAAAC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.deriveDisplayFilename = deriveDisplayFilename;
|
|
7
6
|
exports.ensureFilenameHasExtension = ensureFilenameHasExtension;
|
|
8
7
|
exports.filenameFromUrl = filenameFromUrl;
|
|
9
8
|
exports.getExtensionForMime = getExtensionForMime;
|
|
@@ -238,17 +237,10 @@ function ensureFilenameHasExtension(fileName, mime) {
|
|
|
238
237
|
return `${base}${getExtensionForMime(mime)}`;
|
|
239
238
|
}
|
|
240
239
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
}
|
|
240
|
+
// NOTE: the "which name wins" decision (originalName vs the stored
|
|
241
|
+
// fileName vs the URL) lives in helpers/getDisplayFileName.ts - that is
|
|
242
|
+
// the single source of truth used across display, save, share and
|
|
243
|
+
// download call sites (bug #40: this used to be duplicated here with
|
|
244
|
+
// the priority backwards, so attachments showed/saved under the
|
|
245
|
+
// server's hash name instead of the sender's original one).
|
|
254
246
|
//# sourceMappingURL=mimeToExtension.js.map
|