@ethora/chat-component-rn 26.8.1 → 26.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +43 -10
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +29 -8
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +150 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +34 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +29 -9
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +5 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +13 -5
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +322 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +546 -203
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +69 -27
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -106
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +563 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +2 -1
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +37 -9
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -11
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +14 -4
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +119 -61
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +184 -59
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -1
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/commonjs/helpers/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js +188 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +14 -8
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +51 -9
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isOwnMessage.js +75 -0
- package/lib/commonjs/helpers/isOwnMessage.js.map +1 -0
- package/lib/commonjs/helpers/keyboardLayout.js +12 -2
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +6 -14
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/msgSortableMs.js +37 -0
- package/lib/commonjs/helpers/msgSortableMs.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +122 -0
- package/lib/commonjs/helpers/persistCrypto.js.map +1 -0
- package/lib/commonjs/helpers/pickImageAsset.js +68 -0
- package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
- package/lib/commonjs/helpers/pushPayload.js +71 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -0
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +130 -17
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/secureFileUrl.js +101 -0
- package/lib/commonjs/helpers/secureFileUrl.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +83 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js +59 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/commonjs/helpers/secureUserStorage.js +75 -0
- package/lib/commonjs/helpers/secureUserStorage.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +45 -12
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +30 -10
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useFileToken.js +10 -0
- package/lib/commonjs/hooks/useFileToken.js.map +1 -0
- package/lib/commonjs/hooks/useLogout.js +23 -7
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +8 -11
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +50 -14
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +145 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +44 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +134 -60
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +68 -9
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +62 -112
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +332 -0
- package/lib/commonjs/networking/authRefresh.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +41 -28
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +124 -8
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +26 -7
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +35 -2
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +226 -23
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +151 -38
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +15 -13
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +29 -8
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +9 -3
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +152 -16
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +35 -14
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +30 -10
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +5 -1
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +13 -5
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +207 -35
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +313 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +549 -207
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +70 -28
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -108
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +555 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +2 -1
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +37 -9
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +81 -12
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +14 -4
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +120 -62
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +184 -60
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -1
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/module/helpers/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getServerReadTimestamp.js +181 -0
- package/lib/module/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +14 -8
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +52 -9
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isOwnMessage.js +70 -0
- package/lib/module/helpers/isOwnMessage.js.map +1 -0
- package/lib/module/helpers/keyboardLayout.js +12 -2
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +6 -13
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/msgSortableMs.js +32 -0
- package/lib/module/helpers/msgSortableMs.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +115 -0
- package/lib/module/helpers/persistCrypto.js.map +1 -0
- package/lib/module/helpers/pickImageAsset.js +63 -0
- package/lib/module/helpers/pickImageAsset.js.map +1 -0
- package/lib/module/helpers/pushPayload.js +63 -0
- package/lib/module/helpers/pushPayload.js.map +1 -0
- package/lib/module/helpers/resolveInitBeforeLoadUser.js +130 -16
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/secureFileUrl.js +91 -0
- package/lib/module/helpers/secureFileUrl.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +75 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -0
- package/lib/module/helpers/secureStoreRuntime.js +52 -0
- package/lib/module/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/module/helpers/secureUserStorage.js +72 -0
- package/lib/module/helpers/secureUserStorage.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +46 -13
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +30 -10
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useFileToken.js +5 -0
- package/lib/module/hooks/useFileToken.js.map +1 -0
- package/lib/module/hooks/useLogout.js +23 -7
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +8 -11
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +52 -16
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +145 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +14 -2
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +131 -59
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +64 -7
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +61 -113
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/authRefresh.js +321 -0
- package/lib/module/networking/authRefresh.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +41 -28
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +124 -8
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +26 -7
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +37 -4
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +223 -22
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +139 -34
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +15 -13
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/icons.d.ts +16 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LoginWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +10 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +7 -0
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +4 -2
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +14 -0
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +8 -0
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +108 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +36 -0
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts +5 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +0 -15
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +2 -0
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +13 -0
- package/lib/typescript/helpers/persistCrypto.d.ts.map +1 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
- package/lib/typescript/helpers/pushPayload.d.ts +7 -0
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -0
- package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +7 -0
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +13 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +29 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts +23 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +4 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useFileToken.d.ts +2 -0
- package/lib/typescript/hooks/useFileToken.d.ts.map +1 -0
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +9 -2
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts +12 -6
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +95 -0
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +10 -2
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +14 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +16 -0
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +18 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +43 -3
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +50 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +41 -28
- package/src/assets/icons.tsx +48 -9
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +29 -7
- package/src/components/MainComponents/ChatHeader.tsx +9 -3
- package/src/components/MainComponents/ChatRoom.tsx +161 -15
- package/src/components/MainComponents/ChatWrapper.tsx +36 -20
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +26 -8
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +23 -4
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RoomList.tsx +236 -39
- package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +333 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +600 -282
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +79 -38
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -119
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +624 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +28 -4
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +18 -3
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +2 -1
- package/src/components/styled/MessageImage.tsx +53 -7
- package/src/components/styled/SendInput.tsx +83 -12
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/xmppProvider.tsx +216 -57
- package/src/helpers/createMessageFromXml.ts +20 -1
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getServerReadTimestamp.ts +197 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/initXmppRooms.tsx +14 -10
- package/src/helpers/insertMessageWithDelimiter.ts +55 -19
- package/src/helpers/isOwnMessage.ts +90 -0
- package/src/helpers/keyboardLayout.ts +23 -2
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/persistCrypto.ts +127 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/resolveInitBeforeLoadUser.ts +125 -18
- package/src/helpers/secureFileUrl.ts +103 -0
- package/src/helpers/secureKeyValue.ts +80 -0
- package/src/helpers/secureStoreRuntime.ts +62 -0
- package/src/helpers/secureUserStorage.ts +80 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatRoomFocus.ts +49 -9
- package/src/hooks/useChatWrapperInit.ts +30 -10
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +29 -9
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +145 -37
- package/src/main.ts +26 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +79 -7
- package/src/networking/apiClient.ts +68 -123
- package/src/networking/authRefresh.ts +451 -0
- package/src/networking/stanzaHandlers.ts +44 -28
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +71 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +141 -9
- package/src/roomStore/chatSettingsSlice.ts +34 -10
- package/src/roomStore/index.ts +40 -4
- package/src/roomStore/persistence.ts +234 -24
- package/src/roomStore/roomsSlice.ts +161 -29
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/types.ts +72 -5
- package/src/version.ts +1 -1
|
@@ -2,6 +2,7 @@ import { createAsyncThunk, createSlice, PayloadAction, type Slice } from '@redux
|
|
|
2
2
|
import type { WritableDraft } from 'immer';
|
|
3
3
|
import { EditAction, HistoryPreloadState, IMessage, IRoom } from '../types/types';
|
|
4
4
|
import { insertMessageWithDelimiter } from '../helpers/insertMessageWithDelimiter';
|
|
5
|
+
import { msgSortableMs } from '../helpers/msgSortableMs';
|
|
5
6
|
import type XmppClient from '../networking/xmppClient';
|
|
6
7
|
|
|
7
8
|
// Per-room runtime message cap. Mirrors the persistence layer's
|
|
@@ -13,7 +14,7 @@ import type XmppClient from '../networking/xmppClient';
|
|
|
13
14
|
// older history added via unshift/splice is exempt, so the user can
|
|
14
15
|
// page backward arbitrarily far without instantly losing what they
|
|
15
16
|
// just fetched. After cap eviction we drop from the head (oldest).
|
|
16
|
-
const RUNTIME_MESSAGE_LIMIT = 100;
|
|
17
|
+
export const RUNTIME_MESSAGE_LIMIT = 100;
|
|
17
18
|
|
|
18
19
|
// Body strings the server uses for call signaling broadcasts (call-token,
|
|
19
20
|
// call-state ringing/ended, etc). These should never reach the chat
|
|
@@ -142,7 +143,6 @@ function mergeHistoryIntoCache(
|
|
|
142
143
|
const ex = stripCallSignals(existing);
|
|
143
144
|
const fe = stripCallSignals(fetched);
|
|
144
145
|
|
|
145
|
-
const pending = ex.filter((m) => m?.pending);
|
|
146
146
|
const realExisting = ex.filter(
|
|
147
147
|
(m) => m && !m.pending && m.id !== 'delimiter-new'
|
|
148
148
|
);
|
|
@@ -151,6 +151,29 @@ function mergeHistoryIntoCache(
|
|
|
151
151
|
// Nothing usable came back → keep the cache exactly as it was.
|
|
152
152
|
if (realFetched.length === 0) {return ex;}
|
|
153
153
|
|
|
154
|
+
// Optimistic sends are preserved across a history merge - EXCEPT the
|
|
155
|
+
// ones the fetched page proves the server already has. That happens
|
|
156
|
+
// whenever a send reached the server but its echo did not reach us
|
|
157
|
+
// before the process died: the optimistic bubble is restored from disk
|
|
158
|
+
// still `pending: true` (and, since bug #39, flagged failed at boot),
|
|
159
|
+
// while MAM hands back the very same message under its ARCHIVE id.
|
|
160
|
+
// Keying only on `id` never matched those two, so the room ended up
|
|
161
|
+
// showing the message twice - once for real and once as a bubble stuck
|
|
162
|
+
// on "sending…"/"Failed" that nothing could ever clear. The archived
|
|
163
|
+
// copy carries our original stanza id as `xmppId` (getDataFromXml), so
|
|
164
|
+
// match on that too and drop the local ghost.
|
|
165
|
+
const fetchedKeys = new Set<string>();
|
|
166
|
+
for (const m of realFetched) {
|
|
167
|
+
if (m?.id != null) {fetchedKeys.add(String(m.id));}
|
|
168
|
+
if ((m as any)?.xmppId) {fetchedKeys.add(String((m as any).xmppId));}
|
|
169
|
+
}
|
|
170
|
+
const pending = ex.filter(
|
|
171
|
+
(m) =>
|
|
172
|
+
m?.pending &&
|
|
173
|
+
!fetchedKeys.has(String(m.id)) &&
|
|
174
|
+
!(m.xmppId && fetchedKeys.has(String(m.xmppId)))
|
|
175
|
+
);
|
|
176
|
+
|
|
154
177
|
const byMs = (a: IMessage, b: IMessage) =>
|
|
155
178
|
msgSortableMs(a) - msgSortableMs(b);
|
|
156
179
|
const capTail = (arr: IMessage[]) =>
|
|
@@ -214,6 +237,33 @@ export interface RoomMessagesState {
|
|
|
214
237
|
// — see `applyPrivateStoreMarkers`. Re-fetched every init/reconnect,
|
|
215
238
|
// so it is intentionally NOT persisted.
|
|
216
239
|
privateStoreMarkers: Record<string, number>;
|
|
240
|
+
// The single source of truth for "read up to here, but the user
|
|
241
|
+
// hasn't reached the bottom yet" (`{ roomJID: boundaryMs }`).
|
|
242
|
+
// Set by MessageList (via ChatRoom's `onReadBoundaryChange`) the
|
|
243
|
+
// moment the user first scrolls away from the bottom, to the
|
|
244
|
+
// msgSortableMs of the newest message they'd actually seen. Every
|
|
245
|
+
// path that stamps a read marker for a room the user is leaving
|
|
246
|
+
// (ChatRoom unmount, xmppProvider's AppState background handler and
|
|
247
|
+
// `isVisible=false` handler, the live `advance()` effect, and
|
|
248
|
+
// `useChatRoomFocus`'s `leaveRoom`) must consult this instead of
|
|
249
|
+
// unconditionally stamping "the newest acked message" - otherwise
|
|
250
|
+
// leaving a room while scrolled up marks messages the user never
|
|
251
|
+
// reached as read (customer #42, a regression of #33 reintroduced by
|
|
252
|
+
// #38's server-timestamp marker). See `getReadMarkerTimestamp` in
|
|
253
|
+
// helpers/getServerReadTimestamp.ts.
|
|
254
|
+
//
|
|
255
|
+
// Cleared when the boundary no longer applies: the user scrolls back
|
|
256
|
+
// to the bottom, the visible room changes, or the room is truly left
|
|
257
|
+
// (ChatRoom unmounts, or a tab-navigator focus hook releases the
|
|
258
|
+
// room). NOT cleared merely because the app backgrounds or a host's
|
|
259
|
+
// `isVisible` flips false - MessageList typically stays mounted
|
|
260
|
+
// through those, so its own scroll-tracking ref (the only thing that
|
|
261
|
+
// could re-derive this value) is still intact and the boundary must
|
|
262
|
+
// stay in sync with it. Deliberately NOT persisted (this key isn't
|
|
263
|
+
// read by `persistence.ts`, which only ever picks `rooms` back out of
|
|
264
|
+
// this slice) - it's meaningless across a process restart, where
|
|
265
|
+
// MessageList always mounts fresh at the bottom.
|
|
266
|
+
readBoundaries: Record<string, number>;
|
|
217
267
|
}
|
|
218
268
|
|
|
219
269
|
const initialState: RoomMessagesState = {
|
|
@@ -230,6 +280,7 @@ const initialState: RoomMessagesState = {
|
|
|
230
280
|
},
|
|
231
281
|
pendingNotificationJid: null,
|
|
232
282
|
privateStoreMarkers: {},
|
|
283
|
+
readBoundaries: {},
|
|
233
284
|
};
|
|
234
285
|
|
|
235
286
|
const isValidRoomJid = (jid: unknown): jid is string => {
|
|
@@ -317,6 +368,8 @@ const reducers = {
|
|
|
317
368
|
: [];
|
|
318
369
|
state.rooms[roomData.jid] = {
|
|
319
370
|
...roomData,
|
|
371
|
+
icon: roomData.icon !== undefined ? roomData.icon : existing?.icon,
|
|
372
|
+
roomBg: roomData.roomBg !== undefined ? roomData.roomBg : existing?.roomBg,
|
|
320
373
|
messages:
|
|
321
374
|
existingMessages.length > 0 ? existingMessages : incomingMessages,
|
|
322
375
|
lastViewedTimestamp: lastViewed,
|
|
@@ -494,7 +547,7 @@ const reducers = {
|
|
|
494
547
|
state.visibleRoomJID === roomJID
|
|
495
548
|
? null
|
|
496
549
|
: lastViewedValue
|
|
497
|
-
?
|
|
550
|
+
? lastViewedValue
|
|
498
551
|
: null;
|
|
499
552
|
|
|
500
553
|
insertMessageWithDelimiter(roomMessages, message, lastViewedTimestamp);
|
|
@@ -512,6 +565,7 @@ const reducers = {
|
|
|
512
565
|
state.rooms = {};
|
|
513
566
|
state.visibleRoomJID = null;
|
|
514
567
|
state.privateStoreMarkers = {};
|
|
568
|
+
state.readBoundaries = {};
|
|
515
569
|
state.isUnreadSyncing = false;
|
|
516
570
|
},
|
|
517
571
|
setComposing(
|
|
@@ -578,7 +632,19 @@ const reducers = {
|
|
|
578
632
|
*
|
|
579
633
|
* Monotonic: a marker only ever moves a baseline FORWARD, so a stale
|
|
580
634
|
* server value can't resurrect already-read messages and a more-recent
|
|
581
|
-
* local read (tab blur stamping
|
|
635
|
+
* local read (tab blur stamping the server read timestamp) always wins.
|
|
636
|
+
*
|
|
637
|
+
* Bug #38 self-heal: forward-only is correct for a SANE existing
|
|
638
|
+
* value, but a device whose clock was ahead may have already stamped
|
|
639
|
+
* a marker in the future (either persisted locally from a previous
|
|
640
|
+
* session, or fetched from the server before this fix existed). To
|
|
641
|
+
* "only ever move forward" from a corrupt future value is to never
|
|
642
|
+
* move at all - the room would stay stuck at `unreadMessages: 0`
|
|
643
|
+
* forever. When the room is loaded, detect a marker that sits well
|
|
644
|
+
* past the newest message we actually know it has and waive the
|
|
645
|
+
* forward-only check for that one comparison, so the incoming
|
|
646
|
+
* (already-clamped, see xmppClient.getChatsPrivateStoreRequestStanza)
|
|
647
|
+
* value can correct it even though it's numerically smaller.
|
|
582
648
|
*/
|
|
583
649
|
applyPrivateStoreMarkers: (
|
|
584
650
|
state: WritableDraft<RoomMessagesState>,
|
|
@@ -590,20 +656,72 @@ const reducers = {
|
|
|
590
656
|
for (const jid of Object.keys(markers)) {
|
|
591
657
|
const ts = Number(markers[jid]);
|
|
592
658
|
if (!jid || !Number.isFinite(ts) || ts <= 0) {continue;}
|
|
659
|
+
|
|
660
|
+
const room = state.rooms[jid];
|
|
661
|
+
const newestKnownMs = room ? newestAckedMessageMs(room.messages) : 0;
|
|
662
|
+
// Mirrors isCorruptFutureReadMarker in helpers/getServerReadTimestamp.ts
|
|
663
|
+
// (duplicated to avoid a roomStore <-> helpers import cycle):
|
|
664
|
+
// BOTH signals are required. "Further ahead than the newest
|
|
665
|
+
// message this room has locally" happens all the time on a room
|
|
666
|
+
// whose history hasn't synced yet, and healing on that alone
|
|
667
|
+
// would drop a legitimate marker another device wrote after
|
|
668
|
+
// reading newer messages. A real read marker can never be ahead
|
|
669
|
+
// of real time, so that second signal is what distinguishes a
|
|
670
|
+
// stale cache from a wrong clock.
|
|
671
|
+
const nowMs = Date.now();
|
|
672
|
+
const looksCorrupt = (existing: number) =>
|
|
673
|
+
newestKnownMs > 0 &&
|
|
674
|
+
existing > newestKnownMs + FUTURE_MARKER_TOLERANCE_MS &&
|
|
675
|
+
existing > nowMs + FUTURE_MARKER_TOLERANCE_MS;
|
|
676
|
+
|
|
593
677
|
// Remember the marker so rooms that load LATER (via addRoom)
|
|
594
678
|
// inherit it even though they don't exist in the store yet.
|
|
595
|
-
|
|
679
|
+
const cachedMarker = state.privateStoreMarkers[jid] || 0;
|
|
680
|
+
if (ts > cachedMarker || looksCorrupt(cachedMarker)) {
|
|
596
681
|
state.privateStoreMarkers[jid] = ts;
|
|
597
682
|
}
|
|
598
683
|
// Upgrade an already-loaded room's baseline + recompute its badge.
|
|
599
|
-
//
|
|
600
|
-
|
|
601
|
-
if (room && ts > (room.lastViewedTimestamp || 0)) {
|
|
684
|
+
// Forward-only, unless the room's CURRENT baseline is itself the
|
|
685
|
+
// corrupt value being corrected.
|
|
686
|
+
if (room && (ts > (room.lastViewedTimestamp || 0) || looksCorrupt(room.lastViewedTimestamp || 0))) {
|
|
602
687
|
room.lastViewedTimestamp = ts;
|
|
603
688
|
room.unreadMessages = countNewerMessages(room.messages, ts);
|
|
604
689
|
}
|
|
605
690
|
}
|
|
606
691
|
},
|
|
692
|
+
/**
|
|
693
|
+
* Set (or clear) the "read up to here, but not further" boundary for
|
|
694
|
+
* a room - see `readBoundaries` on `RoomMessagesState` for the full
|
|
695
|
+
* contract. `ts` is the msgSortableMs of the newest message the user
|
|
696
|
+
* actually reached before scrolling away from the bottom; `null`/`0`
|
|
697
|
+
* clears it (the user is at the bottom, or nothing was reached yet).
|
|
698
|
+
*/
|
|
699
|
+
setReadBoundary: (
|
|
700
|
+
state: WritableDraft<RoomMessagesState>,
|
|
701
|
+
action: PayloadAction<{ jid: string; ts: number | null }>
|
|
702
|
+
) => {
|
|
703
|
+
const { jid, ts } = action.payload;
|
|
704
|
+
if (!jid) {return;}
|
|
705
|
+
if (!state.readBoundaries) {state.readBoundaries = {};}
|
|
706
|
+
if (typeof ts === 'number' && Number.isFinite(ts) && ts > 0) {
|
|
707
|
+
state.readBoundaries[jid] = ts;
|
|
708
|
+
} else {
|
|
709
|
+
delete state.readBoundaries[jid];
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
/**
|
|
713
|
+
* Release a room's read boundary once it has been consumed by a
|
|
714
|
+
* genuine "leave" (ChatRoom unmount, or a tab-navigator focus hook
|
|
715
|
+
* switching to a different room) - see `readBoundaries` for why the
|
|
716
|
+
* background/`isVisible=false` paths deliberately do NOT call this.
|
|
717
|
+
*/
|
|
718
|
+
clearReadBoundary: (
|
|
719
|
+
state: WritableDraft<RoomMessagesState>,
|
|
720
|
+
action: PayloadAction<{ jid: string }>
|
|
721
|
+
) => {
|
|
722
|
+
const { jid } = action.payload;
|
|
723
|
+
if (jid && state.readBoundaries) {delete state.readBoundaries[jid];}
|
|
724
|
+
},
|
|
607
725
|
setRoomRole: (
|
|
608
726
|
state: WritableDraft<RoomMessagesState>,
|
|
609
727
|
action: PayloadAction<{ chatJID: string; role: string }>
|
|
@@ -697,6 +815,7 @@ const reducers = {
|
|
|
697
815
|
state.isLoading = false;
|
|
698
816
|
state.isUnreadSyncing = false;
|
|
699
817
|
state.privateStoreMarkers = {};
|
|
818
|
+
state.readBoundaries = {};
|
|
700
819
|
},
|
|
701
820
|
setActiveMessage: (
|
|
702
821
|
state: WritableDraft<RoomMessagesState>,
|
|
@@ -818,27 +937,13 @@ export const roomsStore: Slice<RoomMessagesState, typeof reducers, 'roomMessages
|
|
|
818
937
|
reducers,
|
|
819
938
|
});
|
|
820
939
|
|
|
821
|
-
//
|
|
822
|
-
//
|
|
823
|
-
//
|
|
824
|
-
//
|
|
825
|
-
//
|
|
826
|
-
//
|
|
827
|
-
|
|
828
|
-
// user's own messages (parity with unreadMiddleware's isOwnMessage
|
|
829
|
-
// filter — without this, the reducer and the middleware disagree about
|
|
830
|
-
// the count and we get a flicker as the badge gets written twice with
|
|
831
|
-
// different values on every message).
|
|
832
|
-
export const msgSortableMs = (msg: any): number => {
|
|
833
|
-
const id = String(msg?.id || '');
|
|
834
|
-
const m = /^(\d{13})/.exec(id);
|
|
835
|
-
if (m) {return Number(m[1]);}
|
|
836
|
-
if (msg?.date) {
|
|
837
|
-
const t = new Date(msg.date as any).getTime();
|
|
838
|
-
if (Number.isFinite(t)) {return t;}
|
|
839
|
-
}
|
|
840
|
-
return 0;
|
|
841
|
-
};
|
|
940
|
+
// Re-exported for backward compatibility - every existing call site
|
|
941
|
+
// imports `msgSortableMs` from here. The implementation now lives in
|
|
942
|
+
// helpers/msgSortableMs.ts (imported above), so insertMessageWithDelimiter.ts
|
|
943
|
+
// (which this file itself imports) can use the SAME ordering source
|
|
944
|
+
// without a roomStore <-> helpers import cycle. See that file for the
|
|
945
|
+
// full rationale (server id vs. client `date`).
|
|
946
|
+
export { msgSortableMs };
|
|
842
947
|
|
|
843
948
|
const norm = (s: any): string => {
|
|
844
949
|
if (s == null) {return '';}
|
|
@@ -870,6 +975,31 @@ const isOwn = (
|
|
|
870
975
|
return false;
|
|
871
976
|
};
|
|
872
977
|
|
|
978
|
+
// Bug #38 tolerance: a stored read marker more than this far past the
|
|
979
|
+
// newest message a room actually has is not "the user is a little
|
|
980
|
+
// ahead" - it's a leftover from a device whose clock was wrong when it
|
|
981
|
+
// stamped the marker. Kept in sync with (but duplicated from, to avoid
|
|
982
|
+
// a roomStore ↔ helpers import cycle) FUTURE_READ_MARKER_TOLERANCE_MS
|
|
983
|
+
// in helpers/getServerReadTimestamp.ts.
|
|
984
|
+
const FUTURE_MARKER_TOLERANCE_MS = 5 * 60 * 1000;
|
|
985
|
+
|
|
986
|
+
// Newest message in `messages` this room actually has proof the server
|
|
987
|
+
// accepted - used only to sanity-check an already-stored read marker
|
|
988
|
+
// against reality (see applyPrivateStoreMarkers's self-heal). Excludes
|
|
989
|
+
// pending/optimistic sends via the `pending` flag alone: unlike
|
|
990
|
+
// getServerReadTimestamp, this runs inside a reducer and can't reach
|
|
991
|
+
// across to the roomHeapSlice slice, but `pending` already identifies
|
|
992
|
+
// every optimistic send that matters for this comparison.
|
|
993
|
+
const newestAckedMessageMs = (messages: IMessage[] | undefined): number => {
|
|
994
|
+
let newest = 0;
|
|
995
|
+
for (const m of messages || []) {
|
|
996
|
+
if (!m || m.id === 'delimiter-new' || m.pending) {continue;}
|
|
997
|
+
const ms = msgSortableMs(m);
|
|
998
|
+
if (ms > newest) {newest = ms;}
|
|
999
|
+
}
|
|
1000
|
+
return newest;
|
|
1001
|
+
};
|
|
1002
|
+
|
|
873
1003
|
const countNewerMessages = (
|
|
874
1004
|
messages: IMessage[],
|
|
875
1005
|
timestamp: number,
|
|
@@ -900,6 +1030,8 @@ export const {
|
|
|
900
1030
|
setUnreadSyncing,
|
|
901
1031
|
setLastViewedTimestamp,
|
|
902
1032
|
applyPrivateStoreMarkers,
|
|
1033
|
+
setReadBoundary,
|
|
1034
|
+
clearReadBoundary,
|
|
903
1035
|
setRoomNoMessages,
|
|
904
1036
|
setCurrentRoom,
|
|
905
1037
|
setVisibleRoom,
|
|
@@ -81,7 +81,9 @@ export class PushSubscriptionService {
|
|
|
81
81
|
this.subscribedRooms.add(roomJID);
|
|
82
82
|
await this.saveSubscribedRoomsToStorage();
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
if (!result) {
|
|
85
|
+
console.warn('[PushService] MucSub subscribe refused for', roomJID);
|
|
86
|
+
}
|
|
85
87
|
return result;
|
|
86
88
|
} catch (error) {
|
|
87
89
|
console.error(`[PushService] Failed to subscribe to room ${roomJID}:`, error);
|
|
@@ -92,30 +94,33 @@ export class PushSubscriptionService {
|
|
|
92
94
|
async subscribeToRooms(
|
|
93
95
|
client: Client,
|
|
94
96
|
roomJIDs: string[],
|
|
95
|
-
userNick?: string
|
|
97
|
+
userNick?: string,
|
|
98
|
+
concurrency = 8
|
|
96
99
|
): Promise<void> {
|
|
97
100
|
let successful = 0;
|
|
98
101
|
let failed = 0;
|
|
99
102
|
|
|
100
|
-
|
|
103
|
+
await this.loadSubscribedRoomsFromStorage();
|
|
104
|
+
const pending = roomJIDs.filter((jid) => !this.subscribedRooms.has(jid));
|
|
105
|
+
if (!pending.length) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
101
108
|
|
|
102
|
-
for (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
for (let i = 0; i < pending.length; i += concurrency) {
|
|
110
|
+
const batch = pending.slice(i, i + concurrency);
|
|
111
|
+
const results = await Promise.allSettled(
|
|
112
|
+
batch.map((roomJID) => this.subscribeToRoom(client, roomJID, userNick))
|
|
113
|
+
);
|
|
114
|
+
for (const r of results) {
|
|
115
|
+
if (r.status === 'fulfilled' && r.value) {
|
|
107
116
|
successful++;
|
|
108
117
|
} else {
|
|
109
118
|
failed++;
|
|
110
119
|
}
|
|
111
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
112
|
-
} catch (error) {
|
|
113
|
-
failed++;
|
|
114
|
-
console.error(`Failed to subscribe to room ${roomJID}:`, error);
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
console.log(`
|
|
123
|
+
console.log(`[PushService] MucSub: ${successful} rooms subscribed, ${failed} failed`);
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
async reset(): Promise<void> {
|
package/src/types/types.ts
CHANGED
|
@@ -105,6 +105,7 @@ export interface User {
|
|
|
105
105
|
];
|
|
106
106
|
appId: string;
|
|
107
107
|
xmppPassword: string;
|
|
108
|
+
fileToken?: string;
|
|
108
109
|
|
|
109
110
|
homeScreen?: string;
|
|
110
111
|
registrationChannelType?: string;
|
|
@@ -150,6 +151,7 @@ export interface xmppSettingsInterface {
|
|
|
150
151
|
disableLastRead?: boolean;
|
|
151
152
|
xmppPingOnSendEnabled?: boolean;
|
|
152
153
|
historyQoS?: HistoryQoSConfig;
|
|
154
|
+
keepAliveInBackground?: boolean;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
export interface InAppNotificationConfig {
|
|
@@ -309,13 +311,16 @@ export interface TypographyConfig {
|
|
|
309
311
|
};
|
|
310
312
|
/** Attach (photo/document picker) bottom sheet. */
|
|
311
313
|
attachSheet?: {
|
|
312
|
-
/** "
|
|
314
|
+
/** "Photos & Videos" section header. Default 17 / "700". */
|
|
313
315
|
title?: ChatTextStyle;
|
|
314
|
-
/**
|
|
316
|
+
/** "View Library" link next to the section header. Default 15 / "500". */
|
|
317
|
+
viewLibrary?: ChatTextStyle;
|
|
318
|
+
/** Row labels ("Upload a File"). Default 16 / "500". */
|
|
315
319
|
rowLabel?: ChatTextStyle;
|
|
316
|
-
/**
|
|
320
|
+
/** @deprecated Rows no longer render a hint line. */
|
|
317
321
|
rowHint?: ChatTextStyle;
|
|
318
|
-
/** Cancel button
|
|
322
|
+
/** @deprecated The sheet has no Cancel button — it closes by tapping
|
|
323
|
+
* the backdrop, dragging it down, or the hardware back gesture. */
|
|
319
324
|
cancelButton?: ChatTextStyle;
|
|
320
325
|
};
|
|
321
326
|
|
|
@@ -393,6 +398,16 @@ export interface IConfig {
|
|
|
393
398
|
* value takes effect.
|
|
394
399
|
*/
|
|
395
400
|
height?: number;
|
|
401
|
+
/**
|
|
402
|
+
* Extend the header cards (room list + chat) under the status bar:
|
|
403
|
+
* each pads its top by the safe-area inset and paints it white, so
|
|
404
|
+
* the card and the status-bar band are one surface. Use this instead
|
|
405
|
+
* of wrapping `<Chat>` in a top-edge SafeAreaView: a host-side white
|
|
406
|
+
* band above the card shows a hairline seam where the card's
|
|
407
|
+
* shadow/elevation starts. Off by default (hosts that already pad the
|
|
408
|
+
* top keep their layout).
|
|
409
|
+
*/
|
|
410
|
+
safeAreaTop?: boolean;
|
|
396
411
|
};
|
|
397
412
|
disableHeader?: boolean;
|
|
398
413
|
disableMedia?: boolean;
|
|
@@ -421,7 +436,7 @@ export interface IConfig {
|
|
|
421
436
|
hideMemberSendMessageAction?: boolean; // hides only "Message"
|
|
422
437
|
hideMemberCopyIdAction?: boolean; // hides only "Copy User Id"
|
|
423
438
|
chatHeaderAdditional?: { enabled: boolean; element: any };
|
|
424
|
-
headerMenu?: () => void;
|
|
439
|
+
headerMenu?: (() => void) | boolean;
|
|
425
440
|
headerChatMenu?: () => void;
|
|
426
441
|
chatHeaderSettings?: {
|
|
427
442
|
hide?: boolean;
|
|
@@ -453,11 +468,41 @@ export interface IConfig {
|
|
|
453
468
|
loginFunction: () => Promise<User | null>;
|
|
454
469
|
};
|
|
455
470
|
defaultLogin?: boolean;
|
|
471
|
+
logout?: {
|
|
472
|
+
enabled: boolean;
|
|
473
|
+
label?: string;
|
|
474
|
+
confirm?:
|
|
475
|
+
| boolean
|
|
476
|
+
| {
|
|
477
|
+
title?: string;
|
|
478
|
+
message?: string;
|
|
479
|
+
confirmText?: string;
|
|
480
|
+
cancelText?: string;
|
|
481
|
+
};
|
|
482
|
+
onBeforeLogout?: () => Promise<boolean | void> | boolean | void;
|
|
483
|
+
onAfterLogout?: () => Promise<void> | void;
|
|
484
|
+
};
|
|
456
485
|
refreshTokens?: {
|
|
457
486
|
enabled: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* Host-owned rotation. When set, the SDK calls this INSTEAD of
|
|
489
|
+
* `/users/login/refresh` — always, including during bootstrap — and
|
|
490
|
+
* never rotates the Ethora refresh token itself. Serialised through
|
|
491
|
+
* the same lock as the built-in path.
|
|
492
|
+
*
|
|
493
|
+
* Return `refreshToken` whenever the host's flow actually rotates an
|
|
494
|
+
* Ethora refresh token: the backend now treats a re-presented one as
|
|
495
|
+
* theft, so omitting it leaves a burned token in storage that ends
|
|
496
|
+
* the session the next time it is used. It stays optional because
|
|
497
|
+
* some hosts re-mint an access token from a different authority
|
|
498
|
+
* (SuperTokens, an owner-session endpoint) and hold no Ethora
|
|
499
|
+
* refresh token at all.
|
|
500
|
+
*/
|
|
458
501
|
refreshFunction?: () => Promise<{
|
|
459
502
|
accessToken: string;
|
|
460
503
|
refreshToken?: string;
|
|
504
|
+
fileToken?: string;
|
|
505
|
+
xmppPassword?: string;
|
|
461
506
|
} | null>;
|
|
462
507
|
};
|
|
463
508
|
|
|
@@ -540,6 +585,28 @@ export interface IConfig {
|
|
|
540
585
|
// `disableKeyboardAvoidingView` is set. Needs on-device tuning of any
|
|
541
586
|
// `keyboardVerticalOffset`.
|
|
542
587
|
keyboardStickyInput?: boolean;
|
|
588
|
+
// Bottom padding applied to the input dock (the composer's outer
|
|
589
|
+
// wrapper), on both iOS and Android. When a number is provided (0 is
|
|
590
|
+
// allowed) it is used verbatim on both platforms, overriding the
|
|
591
|
+
// built-in default below.
|
|
592
|
+
//
|
|
593
|
+
// Left unset, the default is:
|
|
594
|
+
// - 0 when `disableKeyboardAvoidingView` is set, since the host owns
|
|
595
|
+
// layout entirely and typically already places the chat above its
|
|
596
|
+
// own chrome (e.g. a tab bar) - the built-in padding would just add
|
|
597
|
+
// an extra gap between the composer and that chrome.
|
|
598
|
+
// - otherwise unchanged: the iOS safe-area bottom inset, or a fixed
|
|
599
|
+
// 12dp gap on Android (`ANDROID_INPUT_DOCK_GAP`).
|
|
600
|
+
// Customer-reported #44.
|
|
601
|
+
inputDockPaddingBottom?: number;
|
|
602
|
+
// The message list's FlatList uses keyboardDismissMode="interactive" by
|
|
603
|
+
// default, so a drag can be used to pull the keyboard closed. Because
|
|
604
|
+
// the list is `inverted`, an ordinary scroll gesture through history can
|
|
605
|
+
// also be read as a dismiss drag, closing the keyboard mid-scroll. Set
|
|
606
|
+
// this to keep the keyboard open regardless of how the list is scrolled
|
|
607
|
+
// — dismissal then only happens when the user deliberately closes it
|
|
608
|
+
// (tapping outside, back button, etc). Customer-reported #36.
|
|
609
|
+
keepKeyboardOpenOnScroll?: boolean;
|
|
543
610
|
|
|
544
611
|
// ----- interactions / messages -----
|
|
545
612
|
disableInteractions?: boolean;
|
package/src/version.ts
CHANGED