@ethora/chat-component-rn 26.9.1 → 26.10.0
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 +30 -0
- package/README.md +19 -0
- package/lib/commonjs/assets/icons.js +2 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +22 -6
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/InputComponents/Search.js +38 -1
- package/lib/commonjs/components/InputComponents/Search.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ArchivedMessageCard.js +166 -0
- package/lib/commonjs/components/MainComponents/ArchivedMessageCard.js.map +1 -0
- package/lib/commonjs/components/MainComponents/ChatHeader.js +22 -5
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +56 -25
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +31 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +18 -3
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +739 -42
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageSearchButton.js +58 -0
- package/lib/commonjs/components/MainComponents/MessageSearchButton.js.map +1 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +15 -6
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +110 -1
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +14 -3
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BubbleHighlight.js +112 -0
- package/lib/commonjs/components/MessageBubble/BubbleHighlight.js.map +1 -0
- package/lib/commonjs/components/MessageBubble/Message.js +169 -125
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +98 -78
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/messageMenuLayout.js +50 -0
- package/lib/commonjs/components/MessageBubble/messageMenuLayout.js.map +1 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +73 -37
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageHitResults.js +253 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageHitResults.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js +488 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/openHit.js +51 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/openHit.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/resolveSender.js +47 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/resolveSender.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/searchFilters.js +83 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/searchFilters.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/snippet.js +61 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/snippet.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/useMessageSearch.js +136 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/useMessageSearch.js.map +1 -0
- package/lib/commonjs/components/Modals/PublicChatsModal/PublicChatsModal.js +306 -0
- package/lib/commonjs/components/Modals/PublicChatsModal/PublicChatsModal.js.map +1 -0
- package/lib/commonjs/components/Modals/PublicChatsModal/publicChatsLogic.js +36 -0
- package/lib/commonjs/components/Modals/PublicChatsModal/publicChatsLogic.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -1
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +13 -2
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/SwipeableRoomRow.js +38 -6
- package/lib/commonjs/components/RoomComponents/SwipeableRoomRow.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadHeader.js +3 -1
- package/lib/commonjs/components/Thread/ThreadHeader.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +90 -10
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/styled/AudioDecoderHost.js +338 -0
- package/lib/commonjs/components/styled/AudioDecoderHost.js.map +1 -0
- package/lib/commonjs/components/styled/AudioMessage.js +493 -420
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +31 -5
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/context/MessageNotificationContext.js +14 -4
- package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +41 -77
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/audioWaveform.js +165 -0
- package/lib/commonjs/helpers/audioWaveform.js.map +1 -0
- package/lib/commonjs/helpers/backgroundJoinSweep.js +36 -0
- package/lib/commonjs/helpers/backgroundJoinSweep.js.map +1 -0
- package/lib/commonjs/helpers/bubbleHighlight.js +44 -0
- package/lib/commonjs/helpers/bubbleHighlight.js.map +1 -0
- package/lib/commonjs/helpers/checkUniqueUsers.js +14 -12
- package/lib/commonjs/helpers/checkUniqueUsers.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js +5 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js +3 -1
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/commonjs/helpers/createRoomFromApi.js +40 -3
- package/lib/commonjs/helpers/createRoomFromApi.js.map +1 -1
- package/lib/commonjs/helpers/dedupeMembers.js +34 -0
- package/lib/commonjs/helpers/dedupeMembers.js.map +1 -0
- package/lib/commonjs/helpers/ethoraLogger.js +56 -0
- package/lib/commonjs/helpers/ethoraLogger.js.map +1 -0
- package/lib/commonjs/helpers/getUnnamedUsers.js +9 -4
- package/lib/commonjs/helpers/getUnnamedUsers.js.map +1 -1
- package/lib/commonjs/helpers/historyPreloadConfig.js +44 -0
- package/lib/commonjs/helpers/historyPreloadConfig.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +372 -137
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initRoomsPresence.js +17 -5
- package/lib/commonjs/helpers/initRoomsPresence.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +5 -0
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isLikelyMucJid.js +67 -0
- package/lib/commonjs/helpers/isLikelyMucJid.js.map +1 -0
- package/lib/commonjs/helpers/isMessageSearchEnabled.js +18 -0
- package/lib/commonjs/helpers/isMessageSearchEnabled.js.map +1 -0
- package/lib/commonjs/helpers/joiningRoom.js +14 -0
- package/lib/commonjs/helpers/joiningRoom.js.map +1 -0
- package/lib/commonjs/helpers/jumpThread.js +100 -0
- package/lib/commonjs/helpers/jumpThread.js.map +1 -0
- package/lib/commonjs/helpers/jumpToMessage.js +58 -0
- package/lib/commonjs/helpers/jumpToMessage.js.map +1 -0
- package/lib/commonjs/helpers/jumpWindow.js +187 -0
- package/lib/commonjs/helpers/jumpWindow.js.map +1 -0
- package/lib/commonjs/helpers/loadRoomHistory.js +75 -0
- package/lib/commonjs/helpers/loadRoomHistory.js.map +1 -0
- package/lib/commonjs/helpers/notificationPolicy.js +77 -0
- package/lib/commonjs/helpers/notificationPolicy.js.map +1 -0
- package/lib/commonjs/helpers/openRoomAtMessage.js +47 -0
- package/lib/commonjs/helpers/openRoomAtMessage.js.map +1 -0
- package/lib/commonjs/helpers/openThreadForJump.js +72 -0
- package/lib/commonjs/helpers/openThreadForJump.js.map +1 -0
- package/lib/commonjs/helpers/parseMessageReference.js +27 -8
- package/lib/commonjs/helpers/parseMessageReference.js.map +1 -1
- package/lib/commonjs/helpers/publicChatsEntry.js +17 -0
- package/lib/commonjs/helpers/publicChatsEntry.js.map +1 -0
- package/lib/commonjs/helpers/roomActivityScore.js +37 -0
- package/lib/commonjs/helpers/roomActivityScore.js.map +1 -0
- package/lib/commonjs/helpers/roomUserCount.js +36 -0
- package/lib/commonjs/helpers/roomUserCount.js.map +1 -0
- package/lib/commonjs/helpers/runConfiguredHistoryPreload.js +68 -0
- package/lib/commonjs/helpers/runConfiguredHistoryPreload.js.map +1 -0
- package/lib/commonjs/helpers/sessionAppId.js +24 -0
- package/lib/commonjs/helpers/sessionAppId.js.map +1 -0
- package/lib/commonjs/helpers/timestamp.js +43 -0
- package/lib/commonjs/helpers/timestamp.js.map +1 -0
- package/lib/commonjs/helpers/userResolver.js +517 -0
- package/lib/commonjs/helpers/userResolver.js.map +1 -0
- package/lib/commonjs/helpers/xmppIdShape.js +52 -0
- package/lib/commonjs/helpers/xmppIdShape.js.map +1 -0
- package/lib/commonjs/hooks/useChatWrapperInit.js +27 -5
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useHeapSender.js +54 -3
- package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
- package/lib/commonjs/hooks/useJumpToMessage.js +411 -0
- package/lib/commonjs/hooks/useJumpToMessage.js.map +1 -0
- package/lib/commonjs/hooks/useMessageLoaderQueue.js +32 -5
- package/lib/commonjs/hooks/useMessageLoaderQueue.js.map +1 -1
- package/lib/commonjs/hooks/useMessageQueue.js +13 -5
- package/lib/commonjs/hooks/useMessageQueue.js.map +1 -1
- package/lib/commonjs/hooks/useRoomDirectory.js +29 -0
- package/lib/commonjs/hooks/useRoomDirectory.js.map +1 -0
- package/lib/commonjs/hooks/useRoomInitialization.js +27 -5
- package/lib/commonjs/hooks/useRoomInitialization.js.map +1 -1
- package/lib/commonjs/hooks/useRoomMute.js +62 -0
- package/lib/commonjs/hooks/useRoomMute.js.map +1 -0
- package/lib/commonjs/hooks/useRoomState.js +3 -1
- package/lib/commonjs/hooks/useRoomState.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +13 -3
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +288 -6
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/networking/api-requests/messageSearch.api.js +87 -0
- package/lib/commonjs/networking/api-requests/messageSearch.api.js.map +1 -0
- package/lib/commonjs/networking/api-requests/publicChats.api.js +48 -0
- package/lib/commonjs/networking/api-requests/publicChats.api.js.map +1 -0
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +253 -4
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +48 -12
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/xmppToken.api.js +71 -0
- package/lib/commonjs/networking/api-requests/xmppToken.api.js.map +1 -0
- package/lib/commonjs/networking/ethoraEvents.js +227 -0
- package/lib/commonjs/networking/ethoraEvents.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +153 -16
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/allRoomPresences.xmpp.js +124 -3
- package/lib/commonjs/networking/xmpp/allRoomPresences.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js +319 -35
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +7 -0
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/historyCursor.js +101 -0
- package/lib/commonjs/networking/xmpp/historyCursor.js.map +1 -0
- package/lib/commonjs/networking/xmpp/mamQueryIds.js +17 -0
- package/lib/commonjs/networking/xmpp/mamQueryIds.js.map +1 -0
- package/lib/commonjs/networking/xmpp/mamRouter.js +24 -9
- package/lib/commonjs/networking/xmpp/mamRouter.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +70 -65
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/roomJoinSweep.js +389 -0
- package/lib/commonjs/networking/xmpp/roomJoinSweep.js.map +1 -0
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js +0 -1
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +0 -1
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +0 -1
- package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +269 -41
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/networking/xmppCredentials.js +80 -0
- package/lib/commonjs/networking/xmppCredentials.js.map +1 -0
- package/lib/commonjs/roomStore/Middleware/jumpThreadMiddleware.js +158 -0
- package/lib/commonjs/roomStore/Middleware/jumpThreadMiddleware.js.map +1 -0
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js +6 -0
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +45 -7
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +15 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +13 -3
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +48 -1
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +474 -60
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/safeKey.js +44 -0
- package/lib/commonjs/roomStore/safeKey.js.map +1 -0
- package/lib/commonjs/roomStore/usersSetCap.js +37 -0
- package/lib/commonjs/roomStore/usersSetCap.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/assets/icons.js +1 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +23 -7
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/InputComponents/Search.js +39 -2
- package/lib/module/components/InputComponents/Search.js.map +1 -1
- package/lib/module/components/MainComponents/ArchivedMessageCard.js +161 -0
- package/lib/module/components/MainComponents/ArchivedMessageCard.js.map +1 -0
- package/lib/module/components/MainComponents/ChatHeader.js +22 -5
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +57 -26
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +31 -1
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +18 -3
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +740 -42
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/MessageSearchButton.js +48 -0
- package/lib/module/components/MainComponents/MessageSearchButton.js.map +1 -0
- package/lib/module/components/MainComponents/ReduxWrapper.js +15 -7
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +111 -2
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +15 -4
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MessageBubble/BubbleHighlight.js +106 -0
- package/lib/module/components/MessageBubble/BubbleHighlight.js.map +1 -0
- package/lib/module/components/MessageBubble/Message.js +172 -127
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +98 -78
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/MessageBubble/messageMenuLayout.js +45 -0
- package/lib/module/components/MessageBubble/messageMenuLayout.js.map +1 -0
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +74 -38
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/MessageSearchModal/MessageHitResults.js +243 -0
- package/lib/module/components/Modals/MessageSearchModal/MessageHitResults.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js +482 -0
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/openHit.js +45 -0
- package/lib/module/components/Modals/MessageSearchModal/openHit.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/resolveSender.js +41 -0
- package/lib/module/components/Modals/MessageSearchModal/resolveSender.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/searchFilters.js +74 -0
- package/lib/module/components/Modals/MessageSearchModal/searchFilters.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/snippet.js +57 -0
- package/lib/module/components/Modals/MessageSearchModal/snippet.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/useMessageSearch.js +131 -0
- package/lib/module/components/Modals/MessageSearchModal/useMessageSearch.js.map +1 -0
- package/lib/module/components/Modals/PublicChatsModal/PublicChatsModal.js +300 -0
- package/lib/module/components/Modals/PublicChatsModal/PublicChatsModal.js.map +1 -0
- package/lib/module/components/Modals/PublicChatsModal/publicChatsLogic.js +30 -0
- package/lib/module/components/Modals/PublicChatsModal/publicChatsLogic.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -1
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +14 -3
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/SwipeableRoomRow.js +39 -7
- package/lib/module/components/RoomComponents/SwipeableRoomRow.js.map +1 -1
- package/lib/module/components/Thread/ThreadHeader.js +3 -1
- package/lib/module/components/Thread/ThreadHeader.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +89 -9
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/styled/AudioDecoderHost.js +332 -0
- package/lib/module/components/styled/AudioDecoderHost.js.map +1 -0
- package/lib/module/components/styled/AudioMessage.js +495 -422
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +32 -6
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/context/MessageNotificationContext.js +15 -5
- package/lib/module/context/MessageNotificationContext.js.map +1 -1
- package/lib/module/context/xmppProvider.js +42 -78
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/audioWaveform.js +153 -0
- package/lib/module/helpers/audioWaveform.js.map +1 -0
- package/lib/module/helpers/backgroundJoinSweep.js +30 -0
- package/lib/module/helpers/backgroundJoinSweep.js.map +1 -0
- package/lib/module/helpers/bubbleHighlight.js +38 -0
- package/lib/module/helpers/bubbleHighlight.js.map +1 -0
- package/lib/module/helpers/checkUniqueUsers.js +15 -13
- package/lib/module/helpers/checkUniqueUsers.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js +5 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_TYPES.js +3 -1
- package/lib/module/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/module/helpers/createRoomFromApi.js +37 -3
- package/lib/module/helpers/createRoomFromApi.js.map +1 -1
- package/lib/module/helpers/dedupeMembers.js +28 -0
- package/lib/module/helpers/dedupeMembers.js.map +1 -0
- package/lib/module/helpers/ethoraLogger.js +52 -0
- package/lib/module/helpers/ethoraLogger.js.map +1 -0
- package/lib/module/helpers/getUnnamedUsers.js +9 -4
- package/lib/module/helpers/getUnnamedUsers.js.map +1 -1
- package/lib/module/helpers/historyPreloadConfig.js +39 -0
- package/lib/module/helpers/historyPreloadConfig.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +368 -134
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initRoomsPresence.js +18 -5
- package/lib/module/helpers/initRoomsPresence.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +5 -0
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isLikelyMucJid.js +60 -0
- package/lib/module/helpers/isLikelyMucJid.js.map +1 -0
- package/lib/module/helpers/isMessageSearchEnabled.js +13 -0
- package/lib/module/helpers/isMessageSearchEnabled.js.map +1 -0
- package/lib/module/helpers/joiningRoom.js +9 -0
- package/lib/module/helpers/joiningRoom.js.map +1 -0
- package/lib/module/helpers/jumpThread.js +83 -0
- package/lib/module/helpers/jumpThread.js.map +1 -0
- package/lib/module/helpers/jumpToMessage.js +52 -0
- package/lib/module/helpers/jumpToMessage.js.map +1 -0
- package/lib/module/helpers/jumpWindow.js +177 -0
- package/lib/module/helpers/jumpWindow.js.map +1 -0
- package/lib/module/helpers/loadRoomHistory.js +69 -0
- package/lib/module/helpers/loadRoomHistory.js.map +1 -0
- package/lib/module/helpers/notificationPolicy.js +70 -0
- package/lib/module/helpers/notificationPolicy.js.map +1 -0
- package/lib/module/helpers/openRoomAtMessage.js +41 -0
- package/lib/module/helpers/openRoomAtMessage.js.map +1 -0
- package/lib/module/helpers/openThreadForJump.js +68 -0
- package/lib/module/helpers/openThreadForJump.js.map +1 -0
- package/lib/module/helpers/parseMessageReference.js +26 -6
- package/lib/module/helpers/parseMessageReference.js.map +1 -1
- package/lib/module/helpers/publicChatsEntry.js +12 -0
- package/lib/module/helpers/publicChatsEntry.js.map +1 -0
- package/lib/module/helpers/roomActivityScore.js +30 -0
- package/lib/module/helpers/roomActivityScore.js.map +1 -0
- package/lib/module/helpers/roomUserCount.js +29 -0
- package/lib/module/helpers/roomUserCount.js.map +1 -0
- package/lib/module/helpers/runConfiguredHistoryPreload.js +63 -0
- package/lib/module/helpers/runConfiguredHistoryPreload.js.map +1 -0
- package/lib/module/helpers/sessionAppId.js +20 -0
- package/lib/module/helpers/sessionAppId.js.map +1 -0
- package/lib/module/helpers/timestamp.js +37 -0
- package/lib/module/helpers/timestamp.js.map +1 -0
- package/lib/module/helpers/userResolver.js +503 -0
- package/lib/module/helpers/userResolver.js.map +1 -0
- package/lib/module/helpers/xmppIdShape.js +46 -0
- package/lib/module/helpers/xmppIdShape.js.map +1 -0
- package/lib/module/hooks/useChatWrapperInit.js +16 -5
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useHeapSender.js +54 -3
- package/lib/module/hooks/useHeapSender.js.map +1 -1
- package/lib/module/hooks/useJumpToMessage.js +389 -0
- package/lib/module/hooks/useJumpToMessage.js.map +1 -0
- package/lib/module/hooks/useMessageLoaderQueue.js +32 -5
- package/lib/module/hooks/useMessageLoaderQueue.js.map +1 -1
- package/lib/module/hooks/useMessageQueue.js +13 -5
- package/lib/module/hooks/useMessageQueue.js.map +1 -1
- package/lib/module/hooks/useRoomDirectory.js +24 -0
- package/lib/module/hooks/useRoomDirectory.js.map +1 -0
- package/lib/module/hooks/useRoomInitialization.js +29 -7
- package/lib/module/hooks/useRoomInitialization.js.map +1 -1
- package/lib/module/hooks/useRoomMute.js +58 -0
- package/lib/module/hooks/useRoomMute.js.map +1 -0
- package/lib/module/hooks/useRoomState.js +3 -1
- package/lib/module/hooks/useRoomState.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +13 -3
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +288 -6
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/networking/api-requests/messageSearch.api.js +81 -0
- package/lib/module/networking/api-requests/messageSearch.api.js.map +1 -0
- package/lib/module/networking/api-requests/publicChats.api.js +43 -0
- package/lib/module/networking/api-requests/publicChats.api.js.map +1 -0
- package/lib/module/networking/api-requests/roomMembers.api.js +248 -4
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +48 -12
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/xmppToken.api.js +66 -0
- package/lib/module/networking/api-requests/xmppToken.api.js.map +1 -0
- package/lib/module/networking/ethoraEvents.js +220 -0
- package/lib/module/networking/ethoraEvents.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +155 -18
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/allRoomPresences.xmpp.js +125 -3
- package/lib/module/networking/xmpp/allRoomPresences.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/getHistory.xmpp.js +318 -35
- package/lib/module/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js +7 -0
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/historyCursor.js +95 -0
- package/lib/module/networking/xmpp/historyCursor.js.map +1 -0
- package/lib/module/networking/xmpp/mamQueryIds.js +12 -0
- package/lib/module/networking/xmpp/mamQueryIds.js.map +1 -0
- package/lib/module/networking/xmpp/mamRouter.js +22 -8
- package/lib/module/networking/xmpp/mamRouter.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +68 -62
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/roomJoinSweep.js +385 -0
- package/lib/module/networking/xmpp/roomJoinSweep.js.map +1 -0
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js +0 -1
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +0 -1
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +0 -1
- package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +269 -41
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/networking/xmppCredentials.js +76 -0
- package/lib/module/networking/xmppCredentials.js.map +1 -0
- package/lib/module/roomStore/Middleware/jumpThreadMiddleware.js +153 -0
- package/lib/module/roomStore/Middleware/jumpThreadMiddleware.js.map +1 -0
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js +6 -0
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/module/roomStore/Middleware/unreadMidlleware.js +46 -7
- package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +13 -0
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +7 -3
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +46 -1
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +459 -58
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/roomStore/safeKey.js +37 -0
- package/lib/module/roomStore/safeKey.js.map +1 -0
- package/lib/module/roomStore/usersSetCap.js +32 -0
- package/lib/module/roomStore/usersSetCap.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +4 -0
- package/lib/typescript/assets/icons.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/ArchivedMessageCard.d.ts +12 -0
- package/lib/typescript/components/MainComponents/ArchivedMessageCard.d.ts.map +1 -0
- 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/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +22 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageSearchButton.d.ts +7 -0
- package/lib/typescript/components/MainComponents/MessageSearchButton.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/BubbleHighlight.d.ts +12 -0
- package/lib/typescript/components/MessageBubble/BubbleHighlight.d.ts.map +1 -0
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +5 -0
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/messageMenuLayout.d.ts +29 -0
- package/lib/typescript/components/MessageBubble/messageMenuLayout.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +2 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/MessageSearchModal/MessageHitResults.d.ts +44 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageHitResults.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts +12 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/openHit.d.ts +15 -0
- package/lib/typescript/components/Modals/MessageSearchModal/openHit.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/resolveSender.d.ts +34 -0
- package/lib/typescript/components/Modals/MessageSearchModal/resolveSender.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/searchFilters.d.ts +41 -0
- package/lib/typescript/components/Modals/MessageSearchModal/searchFilters.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/snippet.d.ts +15 -0
- package/lib/typescript/components/Modals/MessageSearchModal/snippet.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/useMessageSearch.d.ts +23 -0
- package/lib/typescript/components/Modals/MessageSearchModal/useMessageSearch.d.ts.map +1 -0
- package/lib/typescript/components/Modals/PublicChatsModal/PublicChatsModal.d.ts +16 -0
- package/lib/typescript/components/Modals/PublicChatsModal/PublicChatsModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/PublicChatsModal/publicChatsLogic.d.ts +14 -0
- package/lib/typescript/components/Modals/PublicChatsModal/publicChatsLogic.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/SwipeableRoomRow.d.ts +5 -1
- package/lib/typescript/components/RoomComponents/SwipeableRoomRow.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadHeader.d.ts.map +1 -1
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts +1 -0
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioDecoderHost.d.ts +39 -0
- package/lib/typescript/components/styled/AudioDecoderHost.d.ts.map +1 -0
- package/lib/typescript/components/styled/AudioMessage.d.ts +14 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.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/audioWaveform.d.ts +54 -0
- package/lib/typescript/helpers/audioWaveform.d.ts.map +1 -0
- package/lib/typescript/helpers/backgroundJoinSweep.d.ts +14 -0
- package/lib/typescript/helpers/backgroundJoinSweep.d.ts.map +1 -0
- package/lib/typescript/helpers/bubbleHighlight.d.ts +17 -0
- package/lib/typescript/helpers/bubbleHighlight.d.ts.map +1 -0
- package/lib/typescript/helpers/checkUniqueUsers.d.ts +2 -2
- package/lib/typescript/helpers/checkUniqueUsers.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_COMPONENTS.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts +2 -0
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts.map +1 -1
- package/lib/typescript/helpers/createRoomFromApi.d.ts +25 -0
- package/lib/typescript/helpers/createRoomFromApi.d.ts.map +1 -1
- package/lib/typescript/helpers/dedupeMembers.d.ts +11 -0
- package/lib/typescript/helpers/dedupeMembers.d.ts.map +1 -0
- package/lib/typescript/helpers/ethoraLogger.d.ts +13 -0
- package/lib/typescript/helpers/ethoraLogger.d.ts.map +1 -0
- package/lib/typescript/helpers/getUnnamedUsers.d.ts.map +1 -1
- package/lib/typescript/helpers/historyPreloadConfig.d.ts +26 -0
- package/lib/typescript/helpers/historyPreloadConfig.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts +8 -4
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initRoomsPresence.d.ts +7 -0
- package/lib/typescript/helpers/initRoomsPresence.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isLikelyMucJid.d.ts +19 -0
- package/lib/typescript/helpers/isLikelyMucJid.d.ts.map +1 -0
- package/lib/typescript/helpers/isMessageSearchEnabled.d.ts +12 -0
- package/lib/typescript/helpers/isMessageSearchEnabled.d.ts.map +1 -0
- package/lib/typescript/helpers/joiningRoom.d.ts +7 -0
- package/lib/typescript/helpers/joiningRoom.d.ts.map +1 -0
- package/lib/typescript/helpers/jumpThread.d.ts +48 -0
- package/lib/typescript/helpers/jumpThread.d.ts.map +1 -0
- package/lib/typescript/helpers/jumpToMessage.d.ts +26 -0
- package/lib/typescript/helpers/jumpToMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/jumpWindow.d.ts +74 -0
- package/lib/typescript/helpers/jumpWindow.d.ts.map +1 -0
- package/lib/typescript/helpers/loadRoomHistory.d.ts +34 -0
- package/lib/typescript/helpers/loadRoomHistory.d.ts.map +1 -0
- package/lib/typescript/helpers/notificationPolicy.d.ts +42 -0
- package/lib/typescript/helpers/notificationPolicy.d.ts.map +1 -0
- package/lib/typescript/helpers/openRoomAtMessage.d.ts +17 -0
- package/lib/typescript/helpers/openRoomAtMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/openThreadForJump.d.ts +27 -0
- package/lib/typescript/helpers/openThreadForJump.d.ts.map +1 -0
- package/lib/typescript/helpers/parseMessageReference.d.ts +18 -5
- package/lib/typescript/helpers/parseMessageReference.d.ts.map +1 -1
- package/lib/typescript/helpers/publicChatsEntry.d.ts +11 -0
- package/lib/typescript/helpers/publicChatsEntry.d.ts.map +1 -0
- package/lib/typescript/helpers/roomActivityScore.d.ts +5 -0
- package/lib/typescript/helpers/roomActivityScore.d.ts.map +1 -0
- package/lib/typescript/helpers/roomUserCount.d.ts +20 -0
- package/lib/typescript/helpers/roomUserCount.d.ts.map +1 -0
- package/lib/typescript/helpers/runConfiguredHistoryPreload.d.ts +21 -0
- package/lib/typescript/helpers/runConfiguredHistoryPreload.d.ts.map +1 -0
- package/lib/typescript/helpers/sessionAppId.d.ts +8 -0
- package/lib/typescript/helpers/sessionAppId.d.ts.map +1 -0
- package/lib/typescript/helpers/timestamp.d.ts +3 -0
- package/lib/typescript/helpers/timestamp.d.ts.map +1 -0
- package/lib/typescript/helpers/userResolver.d.ts +58 -0
- package/lib/typescript/helpers/userResolver.d.ts.map +1 -0
- package/lib/typescript/helpers/xmppIdShape.d.ts +10 -0
- package/lib/typescript/helpers/xmppIdShape.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatWrapperInit.d.ts +2 -0
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
- package/lib/typescript/hooks/useJumpToMessage.d.ts +116 -0
- package/lib/typescript/hooks/useJumpToMessage.d.ts.map +1 -0
- package/lib/typescript/hooks/useMessageLoaderQueue.d.ts.map +1 -1
- package/lib/typescript/hooks/useMessageQueue.d.ts.map +1 -1
- package/lib/typescript/hooks/useRoomDirectory.d.ts +12 -0
- package/lib/typescript/hooks/useRoomDirectory.d.ts.map +1 -0
- package/lib/typescript/hooks/useRoomInitialization.d.ts.map +1 -1
- package/lib/typescript/hooks/useRoomMute.d.ts +8 -0
- package/lib/typescript/hooks/useRoomMute.d.ts.map +1 -0
- package/lib/typescript/hooks/useRoomState.d.ts +1 -0
- package/lib/typescript/hooks/useRoomState.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/messageSearch.api.d.ts +57 -0
- package/lib/typescript/networking/api-requests/messageSearch.api.d.ts.map +1 -0
- package/lib/typescript/networking/api-requests/publicChats.api.d.ts +24 -0
- package/lib/typescript/networking/api-requests/publicChats.api.d.ts.map +1 -0
- package/lib/typescript/networking/api-requests/roomMembers.api.d.ts +19 -1
- package/lib/typescript/networking/api-requests/roomMembers.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/xmppToken.api.d.ts +2 -0
- package/lib/typescript/networking/api-requests/xmppToken.api.d.ts.map +1 -0
- package/lib/typescript/networking/ethoraEvents.d.ts +45 -0
- package/lib/typescript/networking/ethoraEvents.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/allRoomPresences.xmpp.d.ts +32 -1
- package/lib/typescript/networking/xmpp/allRoomPresences.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts +64 -0
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/historyCursor.d.ts +35 -0
- package/lib/typescript/networking/xmpp/historyCursor.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/mamQueryIds.d.ts +10 -0
- package/lib/typescript/networking/xmpp/mamQueryIds.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/mamRouter.d.ts +7 -0
- package/lib/typescript/networking/xmpp/mamRouter.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts +13 -2
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/roomJoinSweep.d.ts +82 -0
- package/lib/typescript/networking/xmpp/roomJoinSweep.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +90 -4
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/networking/xmppCredentials.d.ts +12 -0
- package/lib/typescript/networking/xmppCredentials.d.ts.map +1 -0
- package/lib/typescript/roomStore/Middleware/jumpThreadMiddleware.d.ts +3 -0
- package/lib/typescript/roomStore/Middleware/jumpThreadMiddleware.d.ts.map +1 -0
- package/lib/typescript/roomStore/Middleware/reactionsMiddleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +8 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts +2 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +8 -0
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +138 -2
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/safeKey.d.ts +13 -0
- package/lib/typescript/roomStore/safeKey.d.ts.map +1 -0
- package/lib/typescript/roomStore/usersSetCap.d.ts +16 -0
- package/lib/typescript/roomStore/usersSetCap.d.ts.map +1 -0
- package/lib/typescript/types/models/media.model.d.ts +2 -0
- package/lib/typescript/types/models/media.model.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +18 -5
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/models/xmpp.model.d.ts +8 -1
- package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +88 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons.tsx +13 -0
- package/src/components/Header/HeaderRoomList.tsx +21 -4
- package/src/components/InputComponents/Search.tsx +33 -0
- package/src/components/MainComponents/ArchivedMessageCard.tsx +139 -0
- package/src/components/MainComponents/ChatHeader.tsx +19 -3
- package/src/components/MainComponents/ChatRoom.tsx +60 -23
- package/src/components/MainComponents/ChatWrapper.tsx +23 -4
- package/src/components/MainComponents/MediaMessage.tsx +17 -0
- package/src/components/MainComponents/MessageList.tsx +823 -84
- package/src/components/MainComponents/MessageSearchButton.tsx +48 -0
- package/src/components/MainComponents/ReduxWrapper.tsx +16 -5
- package/src/components/MainComponents/RoomList.tsx +125 -0
- package/src/components/Menu/HeaderRoomListMenu.tsx +26 -2
- package/src/components/MessageBubble/BubbleHighlight.tsx +106 -0
- package/src/components/MessageBubble/Message.tsx +265 -177
- package/src/components/MessageBubble/MessageInteractions.tsx +109 -86
- package/src/components/MessageBubble/messageMenuLayout.ts +59 -0
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +92 -21
- package/src/components/Modals/MessageSearchModal/MessageHitResults.tsx +271 -0
- package/src/components/Modals/MessageSearchModal/MessageSearchModal.tsx +487 -0
- package/src/components/Modals/MessageSearchModal/openHit.ts +50 -0
- package/src/components/Modals/MessageSearchModal/resolveSender.ts +57 -0
- package/src/components/Modals/MessageSearchModal/searchFilters.ts +109 -0
- package/src/components/Modals/MessageSearchModal/snippet.ts +58 -0
- package/src/components/Modals/MessageSearchModal/useMessageSearch.ts +151 -0
- package/src/components/Modals/PublicChatsModal/PublicChatsModal.tsx +288 -0
- package/src/components/Modals/PublicChatsModal/publicChatsLogic.ts +36 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +8 -1
- package/src/components/RoomComponents/ChatRoomItem.tsx +16 -3
- package/src/components/RoomComponents/SwipeableRoomRow.tsx +39 -6
- package/src/components/Thread/ThreadHeader.tsx +3 -1
- package/src/components/Thread/ThreadWrapper.tsx +96 -10
- package/src/components/styled/AudioDecoderHost.tsx +351 -0
- package/src/components/styled/AudioMessage.tsx +482 -425
- package/src/components/styled/SendInput.tsx +42 -4
- package/src/context/MessageNotificationContext.tsx +19 -5
- package/src/context/xmppProvider.tsx +44 -91
- package/src/helpers/audioWaveform.ts +142 -0
- package/src/helpers/backgroundJoinSweep.ts +35 -0
- package/src/helpers/bubbleHighlight.ts +47 -0
- package/src/helpers/checkUniqueUsers.tsx +15 -17
- package/src/helpers/constants/MODAL_COMPONENTS.tsx +4 -0
- package/src/helpers/constants/MODAL_TYPES.ts +3 -0
- package/src/helpers/createRoomFromApi.tsx +45 -4
- package/src/helpers/dedupeMembers.ts +29 -0
- package/src/helpers/ethoraLogger.ts +50 -0
- package/src/helpers/getUnnamedUsers.ts +7 -4
- package/src/helpers/historyPreloadConfig.ts +68 -0
- package/src/helpers/historyPreloadScheduler.ts +437 -199
- package/src/helpers/initRoomsPresence.ts +20 -7
- package/src/helpers/insertMessageWithDelimiter.ts +3 -0
- package/src/helpers/isLikelyMucJid.ts +72 -0
- package/src/helpers/isMessageSearchEnabled.ts +18 -0
- package/src/helpers/joiningRoom.ts +13 -0
- package/src/helpers/jumpThread.ts +102 -0
- package/src/helpers/jumpToMessage.ts +57 -0
- package/src/helpers/jumpWindow.ts +212 -0
- package/src/helpers/loadRoomHistory.ts +83 -0
- package/src/helpers/notificationPolicy.ts +82 -0
- package/src/helpers/openRoomAtMessage.ts +38 -0
- package/src/helpers/openThreadForJump.ts +96 -0
- package/src/helpers/parseMessageReference.ts +37 -8
- package/src/helpers/publicChatsEntry.ts +15 -0
- package/src/helpers/roomActivityScore.ts +45 -0
- package/src/helpers/roomUserCount.ts +44 -0
- package/src/helpers/runConfiguredHistoryPreload.ts +76 -0
- package/src/helpers/sessionAppId.ts +17 -0
- package/src/helpers/timestamp.ts +44 -0
- package/src/helpers/userResolver.ts +542 -0
- package/src/helpers/xmppIdShape.ts +46 -0
- package/src/hooks/useChatWrapperInit.ts +22 -4
- package/src/hooks/useHeapSender.tsx +54 -3
- package/src/hooks/useJumpToMessage.ts +538 -0
- package/src/hooks/useMessageLoaderQueue.tsx +40 -4
- package/src/hooks/useMessageQueue.ts +9 -5
- package/src/hooks/useRoomDirectory.ts +39 -0
- package/src/hooks/useRoomInitialization.tsx +33 -7
- package/src/hooks/useRoomMute.ts +42 -0
- package/src/hooks/useRoomState.tsx +6 -0
- package/src/hooks/useSendMessage.tsx +14 -2
- package/src/i18n/strings.ts +282 -0
- package/src/networking/api-requests/messageSearch.api.ts +130 -0
- package/src/networking/api-requests/publicChats.api.ts +71 -0
- package/src/networking/api-requests/roomMembers.api.ts +263 -11
- package/src/networking/api-requests/rooms.api.ts +52 -12
- package/src/networking/api-requests/xmppToken.api.ts +62 -0
- package/src/networking/ethoraEvents.ts +262 -0
- package/src/networking/stanzaHandlers.ts +145 -19
- package/src/networking/xmpp/allRoomPresences.xmpp.ts +155 -5
- package/src/networking/xmpp/getHistory.xmpp.ts +433 -47
- package/src/networking/xmpp/handleStanzas.xmpp.ts +8 -0
- package/src/networking/xmpp/historyCursor.ts +124 -0
- package/src/networking/xmpp/mamQueryIds.ts +11 -0
- package/src/networking/xmpp/mamRouter.ts +24 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +91 -68
- package/src/networking/xmpp/roomJoinSweep.ts +412 -0
- package/src/networking/xmpp/sendMediaMessage.xmpp.ts +0 -1
- package/src/networking/xmpp/sendTextMessage.xmpp.ts +0 -1
- package/src/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.ts +0 -1
- package/src/networking/xmppClient.ts +323 -47
- package/src/networking/xmppCredentials.ts +87 -0
- package/src/roomStore/Middleware/jumpThreadMiddleware.ts +163 -0
- package/src/roomStore/Middleware/reactionsMiddleware.tsx +4 -0
- package/src/roomStore/Middleware/unreadMidlleware.tsx +59 -11
- package/src/roomStore/chatSettingsSlice.ts +11 -0
- package/src/roomStore/index.ts +10 -3
- package/src/roomStore/persistence.ts +54 -0
- package/src/roomStore/roomsSlice.ts +547 -65
- package/src/roomStore/safeKey.ts +49 -0
- package/src/roomStore/usersSetCap.ts +37 -0
- package/src/types/models/media.model.ts +4 -0
- package/src/types/models/room.model.ts +18 -5
- package/src/types/models/xmpp.model.ts +15 -1
- package/src/types/types.ts +93 -5
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","addRoomMessages","setReactions","applyMamReactions","
|
|
1
|
+
{"version":3,"names":["store","addRoomMessages","setReactions","applyMamReactions","replayArchivedReaction","reaction","fallbackRoomJID","dispatch","roomJID","messageId","from","reactions","emoji","data","latestReactionTimestamp","ts","meta","fromHistory","pending","Map","flush","query","deferred","messages","e","console","warn","apply","length","beginMamQuery","queryId","Promise","resolve","reject","set","inflight","closed","cancelMamQuery","get","delete","bareLower","jid","String","split","toLowerCase","queryOf","stanza","getChild","attrs","queryid","byId","undefined","room","values","settle","error","Error","settleIfDone","entry","entries","find","q","claimMamResult","collectMamReaction","push","collectMamMessage","message","Math","max","routeMamIq","is","id","type","__resetMamRouter","clear"],"sourceRoot":"../../../../src","sources":["networking/xmpp/mamRouter.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,eAAe,EAAEC,YAAY,QAAQ,4BAA4B;AAE1E,SAASC,iBAAiB,QAAgC,4BAA4B;AAatF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,QAA2B,EAC3BC,eAAe,GAAG,EAAE,KACjB;EACHN,KAAK,CAACO,QAAQ,CAAC;IACb,GAAGL,YAAY,CAAC;MACdM,OAAO,EAAEH,QAAQ,CAACG,OAAO,IAAIF,eAAe;MAC5CG,SAAS,EAAEJ,QAAQ,CAACI,SAAS;MAC7BC,IAAI,EAAEL,QAAQ,CAACK,IAAI;MACnBC,SAAS,EAAEN,QAAQ,CAACO,KAAK;MACzBC,IAAI,EAAER,QAA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MAAM,CAACR,MAAM,CAACE,KAAK,CAACuB,EAAE,EAAElD,KAAK,CAAC;EAAC;EAC1D,OAAO,IAAI;AACb,CAAC;;AAED;AACA,OAAO,MAAMoD,gBAAgB,GAAGA,CAAA,KAAMvD,OAAO,CAACwD,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,56 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { xml } from '@xmpp/client';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (!map) {
|
|
11
|
-
map = new Map();
|
|
12
|
-
joinedByClient.set(client, map);
|
|
13
|
-
const forget = () => joinedByClient.get(client)?.clear();
|
|
14
|
-
client.on('disconnect', forget);
|
|
15
|
-
client.on('offline', forget);
|
|
4
|
+
// A bare `local@domain.tld`. The conference prefix is NOT required here (a
|
|
5
|
+
// host may run its MUC service on a custom domain, xmppSettings.conference);
|
|
6
|
+
// callers that fan out over the room list filter with isLikelyMucJid first.
|
|
7
|
+
const isValidRoomJid = jid => {
|
|
8
|
+
if (typeof jid !== 'string') {
|
|
9
|
+
return false;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const presenceInRoom = (client, roomJID, delay = 0) => {
|
|
21
|
-
const joined = joinedRooms(client);
|
|
22
|
-
const existing = joined.get(roomJID);
|
|
23
|
-
if (existing) {
|
|
24
|
-
return existing;
|
|
11
|
+
const at = jid.indexOf('@');
|
|
12
|
+
if (at <= 0) {
|
|
13
|
+
return false;
|
|
25
14
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
// A failed join is not a join: let the next caller try again.
|
|
29
|
-
join.catch(() => {
|
|
30
|
-
if (joined.get(roomJID) === join) {
|
|
31
|
-
joined.delete(roomJID);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return join;
|
|
15
|
+
const domain = jid.slice(at + 1).split('/')[0];
|
|
16
|
+
return !!domain;
|
|
35
17
|
};
|
|
36
|
-
|
|
18
|
+
let presenceIdCounter = 0;
|
|
19
|
+
const nextPresenceId = () => `presenceInRoom-${Date.now().toString(36)}-${(++presenceIdCounter).toString(36)}`;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Sends the MUC join presence for `roomJID` and resolves with the room's
|
|
23
|
+
* answer. Rejects with `presence_error:<code>:<jid>` on an error presence,
|
|
24
|
+
* `presence_timeout:<jid>` when nothing answers within `timeoutMs`, and
|
|
25
|
+
* `presence_send_failed:<jid>:...` when the stanza could not be written.
|
|
26
|
+
*
|
|
27
|
+
* `delay` is an optional extra wait after the answer. It used to be a fixed
|
|
28
|
+
* 2 s: the join answer arrives BEFORE the server's replay of the room history
|
|
29
|
+
* (default up to 20 stanzas), and callers waited for that replay to settle.
|
|
30
|
+
* The join now asks for `historyStanzas` (default 0) so nothing is replayed
|
|
31
|
+
* (history comes from MAM), and the default settle delay is 0.
|
|
32
|
+
*/
|
|
33
|
+
export const presenceInRoom = async (client, roomJID, delay = 0, timeoutMs = 2000,
|
|
34
|
+
// How many of the room's recent messages the MUC service replays on join
|
|
35
|
+
// (XEP-0045 <history maxstanzas/>). Default 0: history comes from MAM only.
|
|
36
|
+
// Without the element the server replays its default (ejabberd: up to 20
|
|
37
|
+
// stanzas) for EVERY room joined: N rooms * 20 messages of wire traffic
|
|
38
|
+
// that MAM then fetches again.
|
|
39
|
+
historyStanzas = 0) => {
|
|
40
|
+
if (!isValidRoomJid(roomJID)) {
|
|
41
|
+
return Promise.reject(new Error(`presence_invalid_jid:${String(roomJID)}`));
|
|
42
|
+
}
|
|
37
43
|
let stanzaHandler;
|
|
38
|
-
const unsubscribe = () => client
|
|
44
|
+
const unsubscribe = () => client?.off?.('stanza', stanzaHandler);
|
|
39
45
|
const stanzaId = nextPresenceId();
|
|
40
|
-
|
|
41
|
-
// Avoid `new Promise(async (resolve, reject) => …)` — the async
|
|
42
|
-
// executor's own thrown errors / unhandled rejections inside it can
|
|
43
|
-
// escape the constructed promise depending on the order of catch
|
|
44
|
-
// attachment vs rejection. Use a regular Promise + a separate async
|
|
45
|
-
// wrapper that funnels every failure path through reject().
|
|
46
46
|
return new Promise((resolve, reject) => {
|
|
47
47
|
let settled = false;
|
|
48
|
+
// Cleared as soon as the promise settles by any other path, so the
|
|
49
|
+
// timeout timer doesn't linger after we already know the outcome.
|
|
50
|
+
let cancelTimeout = null;
|
|
48
51
|
const finish = (cb, value) => {
|
|
49
52
|
if (settled) {
|
|
50
53
|
return;
|
|
51
54
|
}
|
|
52
55
|
settled = true;
|
|
53
|
-
|
|
56
|
+
cancelTimeout?.();
|
|
57
|
+
if (!(delay > 0)) {
|
|
54
58
|
unsubscribe();
|
|
55
59
|
cb(value);
|
|
56
60
|
return;
|
|
@@ -62,6 +66,15 @@ const joinRoom = async (client, roomJID, delay) => {
|
|
|
62
66
|
};
|
|
63
67
|
stanzaHandler = stanza => {
|
|
64
68
|
if (stanza.is('presence') && stanza.attrs.id === stanzaId && stanza.attrs.from?.startsWith(roomJID)) {
|
|
69
|
+
if (stanza.attrs.type === 'error') {
|
|
70
|
+
const errEl = stanza.getChild('error');
|
|
71
|
+
const code = errEl && (errEl.getChild('forbidden') ? 'forbidden' : errEl.getChild('remote-server-not-found') ? 'remote-server-not-found' : errEl.getChild('not-allowed') ? 'not-allowed' : errEl.getChild('item-not-found') ? 'item-not-found' : errEl.attrs?.type || 'unknown') || 'unknown';
|
|
72
|
+
settled = true;
|
|
73
|
+
cancelTimeout?.();
|
|
74
|
+
unsubscribe();
|
|
75
|
+
reject(new Error(`presence_error:${code}:${roomJID}`));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
65
78
|
finish(resolve, stanza);
|
|
66
79
|
}
|
|
67
80
|
};
|
|
@@ -73,34 +86,27 @@ const joinRoom = async (client, roomJID, delay) => {
|
|
|
73
86
|
}, xml('x', {
|
|
74
87
|
xmlns: 'http://jabber.org/protocol/muc'
|
|
75
88
|
}, xml('history', {
|
|
76
|
-
maxstanzas:
|
|
89
|
+
maxstanzas: String(Number.isFinite(historyStanzas) && historyStanzas > 0 ? Math.floor(historyStanzas) : 0)
|
|
77
90
|
})));
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// failure → reject). Each chain attaches its rejection handler
|
|
82
|
-
// synchronously, so no race with the outer Promise's catch.
|
|
83
|
-
(async () => {
|
|
84
|
-
try {
|
|
85
|
-
await client.send(presence);
|
|
86
|
-
} catch (err) {
|
|
87
|
-
unsubscribe();
|
|
88
|
-
reject(err);
|
|
91
|
+
Promise.resolve(client.send(presence)).then(() => {
|
|
92
|
+
// The answer may already have arrived while send() was settling.
|
|
93
|
+
if (settled) {
|
|
89
94
|
return;
|
|
90
95
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// The room's reply schedules resolve() `delay` ms later (2000 by
|
|
95
|
-
// default) — the same length as this timeout, so the timeout used
|
|
96
|
-
// to win the race and reject a join that had actually succeeded
|
|
97
|
-
// (allRoomPresences "failed" with undefined on every bootstrap).
|
|
98
|
-
// Only a join that never got an answer is a failure.
|
|
99
|
-
if (!settled) {
|
|
100
|
-
reject(err);
|
|
96
|
+
const timer = setTimeout(() => {
|
|
97
|
+
if (settled) {
|
|
98
|
+
return;
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
settled = true;
|
|
101
|
+
unsubscribe();
|
|
102
|
+
reject(new Error(`presence_timeout:${roomJID}`));
|
|
103
|
+
}, timeoutMs);
|
|
104
|
+
cancelTimeout = () => clearTimeout(timer);
|
|
105
|
+
}).catch(err => {
|
|
106
|
+
unsubscribe();
|
|
107
|
+
settled = true;
|
|
108
|
+
reject(new Error(`presence_send_failed:${roomJID}:${err instanceof Error ? err.message : String(err)}`));
|
|
109
|
+
});
|
|
104
110
|
});
|
|
105
111
|
};
|
|
106
112
|
//# sourceMappingURL=presenceInRoom.xmpp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["xml","
|
|
1
|
+
{"version":3,"names":["xml","isValidRoomJid","jid","at","indexOf","domain","slice","split","presenceIdCounter","nextPresenceId","Date","now","toString","presenceInRoom","client","roomJID","delay","timeoutMs","historyStanzas","Promise","reject","Error","String","stanzaHandler","unsubscribe","off","stanzaId","resolve","settled","cancelTimeout","finish","cb","value","setTimeout","stanza","is","attrs","id","from","startsWith","type","errEl","getChild","code","on","presence","to","getLocal","xmlns","maxstanzas","Number","isFinite","Math","floor","send","then","timer","clearTimeout","catch","err","message"],"sourceRoot":"../../../../src","sources":["networking/xmpp/presenceInRoom.xmpp.ts"],"mappings":";;AAAA,SAAiBA,GAAG,QAAQ,cAAc;AAG1C;AACA;AACA;AACA,MAAMC,cAAc,GAAIC,GAAY,IAAoB;EACtD,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;IAAC,OAAO,KAAK;EAAC;EAC3C,MAAMC,EAAE,GAAGD,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC;EAC3B,IAAID,EAAE,IAAI,CAAC,EAAE;IAAC,OAAO,KAAK;EAAC;EAC3B,MAAME,MAAM,GAAGH,GAAG,CAACI,KAAK,CAACH,EAAE,GAAG,CAAC,CAAC,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC9C,OAAO,CAAC,CAACF,MAAM;AACjB,CAAC;AAED,IAAIG,iBAAiB,GAAG,CAAC;AACzB,MAAMC,cAAc,GAAGA,CAAA,KACrB,kBAAkBC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAEJ,iBAAiB,EAAEI,QAAQ,CAAC,EAAE,CAAC,EAAE;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAC5BC,MAAc,EACdC,OAAe,EACfC,KAAK,GAAG,CAAC,EACTC,SAA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AACT,QAAQ,CAAC,CAAC,CACnCU,IAAI,CAAC,MAAM;MACV;MACA,IAAI3B,OAAO,EAAE;QAAC;MAAO;MACrB,MAAM4B,KAAK,GAAGvB,UAAU,CAAC,MAAM;QAC7B,IAAIL,OAAO,EAAE;UAAC;QAAO;QACrBA,OAAO,GAAG,IAAI;QACdJ,WAAW,CAAC,CAAC;QACbJ,MAAM,CAAC,IAAIC,KAAK,CAAC,oBAAoBN,OAAO,EAAE,CAAC,CAAC;MAClD,CAAC,EAAEE,SAAS,CAAC;MACbY,aAAa,GAAGA,CAAA,KAAM4B,YAAY,CAACD,KAAK,CAAC;IAC3C,CAAC,CAAC,CACDE,KAAK,CAAEC,GAAG,IAAK;MACdnC,WAAW,CAAC,CAAC;MACbI,OAAO,GAAG,IAAI;MACdR,MAAM,CACJ,IAAIC,KAAK,CACP,wBAAwBN,OAAO,IAAI4C,GAAG,YAAYtC,KAAK,GAAGsC,GAAG,CAACC,OAAO,GAAGtC,MAAM,CAACqC,GAAG,CAAC,EACrF,CACF,CAAC;IACH,CAAC,CAAC;EACN,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { store } from '../../roomStore';
|
|
4
|
+
import { presenceInRoom } from './presenceInRoom.xmpp';
|
|
5
|
+
import { allRoomPresences } from './allRoomPresences.xmpp';
|
|
6
|
+
import { isLikelyMucJid } from '../../helpers/isLikelyMucJid';
|
|
7
|
+
import { getRoomLastActivityScore } from '../../helpers/roomActivityScore';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The slice of XmppClient the join manager needs. Keeping it an interface
|
|
11
|
+
* keeps this file free of an import cycle with xmppClient.ts.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
15
|
+
export const SWEEP_RETRY_DELAYS_MS = [2000, 5000, 10000];
|
|
16
|
+
const DEFAULT_JOIN_CONCURRENCY = 5;
|
|
17
|
+
const DEFAULT_FAILURE_BACKOFF_MS = 10000;
|
|
18
|
+
const formatError = error => error instanceof Error ? error.message : String(error);
|
|
19
|
+
const emptySummary = () => ({
|
|
20
|
+
total: 0,
|
|
21
|
+
success: 0,
|
|
22
|
+
failed: 0,
|
|
23
|
+
failedRooms: [],
|
|
24
|
+
sweptRooms: [],
|
|
25
|
+
failures: []
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Per-connection MUC join state and the background join sweep.
|
|
30
|
+
*
|
|
31
|
+
* Why it exists: the RN client used to join every room with a Promise.all
|
|
32
|
+
* and only then call the session ready, so the room list waited for the
|
|
33
|
+
* slowest of N joins and a join in flight when the socket dropped could
|
|
34
|
+
* poison the next connection. Here joins go through one dedup layer
|
|
35
|
+
* (ensureRoomPresence), the sweep is a bounded pool that runs in the
|
|
36
|
+
* background (active room first, then by recent activity), and every join
|
|
37
|
+
* remembers the connection epoch it started on: when the socket was
|
|
38
|
+
* replaced meanwhile its outcome is discarded (no joined mark, no backoff).
|
|
39
|
+
*
|
|
40
|
+
* `presencesReady` means the whole sweep finished, `priorityPresencesReady`
|
|
41
|
+
* that its first wave (active room + one pool width) settled.
|
|
42
|
+
*/
|
|
43
|
+
export class RoomJoinManager {
|
|
44
|
+
presencesReady = false;
|
|
45
|
+
priorityPresencesReady = false;
|
|
46
|
+
joinedRooms = new Set();
|
|
47
|
+
roomPresenceInFlight = new Map();
|
|
48
|
+
roomPresenceBlockedUntil = new Map();
|
|
49
|
+
sweepRetryTimer = null;
|
|
50
|
+
sweepRetryRunning = false;
|
|
51
|
+
sendAllPresencesInFlight = null;
|
|
52
|
+
constructor(host) {
|
|
53
|
+
this.host = host;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ---- config -------------------------------------------------------
|
|
57
|
+
qos() {
|
|
58
|
+
const own = this.host.getHistoryQoS() || {};
|
|
59
|
+
let fromConfig = {};
|
|
60
|
+
try {
|
|
61
|
+
fromConfig = store.getState()?.chatSettingStore?.config?.historyQoS || {};
|
|
62
|
+
} catch {
|
|
63
|
+
fromConfig = {};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
...fromConfig,
|
|
67
|
+
...own
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
get joinConcurrency() {
|
|
71
|
+
return Math.max(1, Math.floor(Number(this.qos().joinConcurrency) || DEFAULT_JOIN_CONCURRENCY));
|
|
72
|
+
}
|
|
73
|
+
get joinHistoryStanzas() {
|
|
74
|
+
return Math.max(0, Math.floor(Number(this.qos().joinHistoryStanzas) || 0));
|
|
75
|
+
}
|
|
76
|
+
get failureBackoffMs() {
|
|
77
|
+
return Math.max(0, Number(this.qos().presenceFailureBackoffMs || DEFAULT_FAILURE_BACKOFF_MS));
|
|
78
|
+
}
|
|
79
|
+
get epoch() {
|
|
80
|
+
return this.host.getConnectionEpoch();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// A room the sweep may fan out over: a conference-domain JID (or the
|
|
84
|
+
// server's own, possibly custom, conference domain).
|
|
85
|
+
isValidRoomJid(jid) {
|
|
86
|
+
if (isLikelyMucJid(jid)) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
if (typeof jid !== 'string') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const conference = this.host.getConference?.();
|
|
93
|
+
const at = jid.indexOf('@');
|
|
94
|
+
return !!conference && at > 0 && jid.slice(at + 1).split('/')[0] === conference;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// An explicit join of one room (a send, an open room, an invite) only
|
|
98
|
+
// needs a well-formed `local@domain`: the caller named the room.
|
|
99
|
+
isJoinableJid(jid) {
|
|
100
|
+
if (typeof jid !== 'string') {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const at = jid.indexOf('@');
|
|
104
|
+
return at > 0 && at < jid.length - 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ---- lifecycle ----------------------------------------------------
|
|
108
|
+
/** Called on every disconnect / reconnect / close: nothing carries over. */
|
|
109
|
+
reset() {
|
|
110
|
+
this.presencesReady = false;
|
|
111
|
+
this.priorityPresencesReady = false;
|
|
112
|
+
this.clearSweepRetry();
|
|
113
|
+
this.sendAllPresencesInFlight = null;
|
|
114
|
+
this.joinedRooms.clear();
|
|
115
|
+
this.roomPresenceInFlight.clear();
|
|
116
|
+
this.roomPresenceBlockedUntil.clear();
|
|
117
|
+
}
|
|
118
|
+
isJoined(roomJid) {
|
|
119
|
+
return this.joinedRooms.has(roomJid);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ---- one room -----------------------------------------------------
|
|
123
|
+
ensureRoomPresence = async (roomJID, options) => {
|
|
124
|
+
if (!roomJID) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
const source = options?.source || 'other';
|
|
128
|
+
if (!this.isJoinableJid(roomJID)) {
|
|
129
|
+
console.warn(`[XMPP] room_presence_skipped_invalid_jid jid=${String(roomJID)} source=${source}`);
|
|
130
|
+
// Block for a long time so repeated callers don't keep retrying.
|
|
131
|
+
this.roomPresenceBlockedUntil.set(roomJID, Date.now() + DAY_MS);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (this.joinedRooms.has(roomJID)) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
const blockedUntil = this.roomPresenceBlockedUntil.get(roomJID) || 0;
|
|
138
|
+
if (Date.now() < blockedUntil) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
const settleDelay = options?.settleDelay ?? 0;
|
|
142
|
+
const timeoutMs = options?.timeoutMs ?? 2000;
|
|
143
|
+
const waitForJoin = options?.waitForJoin ?? true;
|
|
144
|
+
const existing = this.roomPresenceInFlight.get(roomJID);
|
|
145
|
+
if (existing) {
|
|
146
|
+
if (!waitForJoin) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
// Piggyback on someone else's in-flight join but never wait past OUR
|
|
150
|
+
// OWN budget: that join may have been started with a longer timeout
|
|
151
|
+
// (the sweep uses 5 s, a send wants less).
|
|
152
|
+
const OWN_TIMEOUT = Symbol('ensureRoomPresence_own_timeout');
|
|
153
|
+
let timer;
|
|
154
|
+
const ownTimeout = new Promise(resolve => {
|
|
155
|
+
timer = setTimeout(() => resolve(OWN_TIMEOUT), timeoutMs);
|
|
156
|
+
});
|
|
157
|
+
const result = await Promise.race([existing, ownTimeout]);
|
|
158
|
+
if (timer) {
|
|
159
|
+
clearTimeout(timer);
|
|
160
|
+
}
|
|
161
|
+
return result === OWN_TIMEOUT ? false : result;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// A join that outlives its connection (socket dropped while it waited)
|
|
165
|
+
// must not write into the NEW connection's state: neither joined nor a
|
|
166
|
+
// failure backoff.
|
|
167
|
+
const joinEpoch = this.epoch;
|
|
168
|
+
const promise = (async () => {
|
|
169
|
+
// Online: go straight to the write (synchronously for the first
|
|
170
|
+
// caller), so a send queued right behind it stays ordered after it.
|
|
171
|
+
if (!this.host.isOnline?.()) {
|
|
172
|
+
await this.host.waitForOnline(Math.max(timeoutMs, 1000));
|
|
173
|
+
}
|
|
174
|
+
if (joinEpoch !== this.epoch) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
const client = this.host.getClient();
|
|
178
|
+
if (!client) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
await presenceInRoom(client, roomJID, settleDelay, timeoutMs, this.joinHistoryStanzas);
|
|
182
|
+
if (joinEpoch !== this.epoch) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
this.joinedRooms.add(roomJID);
|
|
186
|
+
this.roomPresenceBlockedUntil.delete(roomJID);
|
|
187
|
+
return true;
|
|
188
|
+
})().catch(error => {
|
|
189
|
+
if (joinEpoch !== this.epoch) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
const message = formatError(error);
|
|
193
|
+
// Permanent / long-lived failures: "you are not a member" or "this
|
|
194
|
+
// room does not exist". No point retrying for an hour.
|
|
195
|
+
const isHardFailure = message.includes('presence_error:forbidden') || message.includes('presence_error:not-allowed') || message.includes('presence_error:remote-server-not-found') || message.includes('presence_error:item-not-found') || message.includes('presence_invalid_jid');
|
|
196
|
+
if (isHardFailure) {
|
|
197
|
+
this.roomPresenceBlockedUntil.set(roomJID, Date.now() + 60 * 60 * 1000);
|
|
198
|
+
} else if (message.includes('presence_timeout') || message.includes('presence_send_failed') || message.includes('presence_error')) {
|
|
199
|
+
this.roomPresenceBlockedUntil.set(roomJID, Date.now() + this.failureBackoffMs);
|
|
200
|
+
}
|
|
201
|
+
console.warn(`[XMPP] room_presence_failed room=${roomJID} source=${source} error=${message}`);
|
|
202
|
+
return false;
|
|
203
|
+
}).finally(() => {
|
|
204
|
+
// The map was cleared on disconnect: only drop our own entry.
|
|
205
|
+
if (this.roomPresenceInFlight.get(roomJID) === promise) {
|
|
206
|
+
this.roomPresenceInFlight.delete(roomJID);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
this.roomPresenceInFlight.set(roomJID, promise);
|
|
210
|
+
if (waitForJoin) {
|
|
211
|
+
return promise;
|
|
212
|
+
}
|
|
213
|
+
return true;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// ---- the sweep ----------------------------------------------------
|
|
217
|
+
/**
|
|
218
|
+
* Start the background join sweep. Every caller shares one in-flight
|
|
219
|
+
* sweep; a finished sweep is only repeated when rooms appeared since.
|
|
220
|
+
* Never throws.
|
|
221
|
+
*/
|
|
222
|
+
async sendAllPresencesAndMarkReady() {
|
|
223
|
+
if (this.sendAllPresencesInFlight) {
|
|
224
|
+
return this.sendAllPresencesInFlight;
|
|
225
|
+
}
|
|
226
|
+
if (this.presencesReady && !this.hasUnjoinedRooms()) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const run = this.runAllPresencesSweep().finally(() => {
|
|
230
|
+
if (this.sendAllPresencesInFlight === run) {
|
|
231
|
+
this.sendAllPresencesInFlight = null;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
this.sendAllPresencesInFlight = run;
|
|
235
|
+
return run;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Store rooms this connection has not joined and is not backing off from.
|
|
239
|
+
hasUnjoinedRooms() {
|
|
240
|
+
const rooms = store.getState().rooms.rooms;
|
|
241
|
+
const now = Date.now();
|
|
242
|
+
return Object.keys(rooms || {}).some(jid => this.isValidRoomJid(jid) && !this.joinedRooms.has(jid) && now >= (this.roomPresenceBlockedUntil.get(jid) || 0));
|
|
243
|
+
}
|
|
244
|
+
async runAllPresencesSweep() {
|
|
245
|
+
const epoch = this.epoch;
|
|
246
|
+
this.presencesReady = false;
|
|
247
|
+
let summary = emptySummary();
|
|
248
|
+
try {
|
|
249
|
+
summary = await this.allRoomPresencesStanza(epoch);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
console.warn(`[XMPP] allRoomPresences fallback reason=${formatError(error)}`);
|
|
252
|
+
}
|
|
253
|
+
// The connection dropped mid-sweep: a newer connection owns the state.
|
|
254
|
+
if (epoch !== this.epoch) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
// Only rooms the sweep actually sent a presence for count as joined.
|
|
258
|
+
// Reading the store here would also mark rooms discovered DURING the
|
|
259
|
+
// sweep, and ensureRoomPresence would then short-circuit for them.
|
|
260
|
+
summary.sweptRooms.forEach(jid => {
|
|
261
|
+
if (!summary.failedRooms.includes(jid)) {
|
|
262
|
+
this.joinedRooms.add(jid);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
if (summary.failed > 0 && summary.failures?.length) {
|
|
266
|
+
const text = summary.failures.slice(0, 3).map(item => `${item.roomJid}:${item.reason}`).join(' | ');
|
|
267
|
+
console.warn(`[XMPP] allRoomPresences failures_top3=${text}`);
|
|
268
|
+
}
|
|
269
|
+
this.priorityPresencesReady = true;
|
|
270
|
+
this.presencesReady = true;
|
|
271
|
+
this.scheduleSweepRetry(epoch, 0);
|
|
272
|
+
}
|
|
273
|
+
clearSweepRetry() {
|
|
274
|
+
if (this.sweepRetryTimer) {
|
|
275
|
+
clearTimeout(this.sweepRetryTimer);
|
|
276
|
+
}
|
|
277
|
+
this.sweepRetryTimer = null;
|
|
278
|
+
this.sweepRetryRunning = false;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Rooms the connection has not joined that a retry can still help: not
|
|
282
|
+
// joined, not under a long (hard) block. Returns the soonest moment a retry
|
|
283
|
+
// is worthwhile (0 = now) or null when nothing is left.
|
|
284
|
+
nextSweepRetryAt() {
|
|
285
|
+
const rooms = store.getState().rooms?.rooms;
|
|
286
|
+
const now = Date.now();
|
|
287
|
+
let soonest = null;
|
|
288
|
+
Object.keys(rooms || {}).forEach(jid => {
|
|
289
|
+
if (!this.isValidRoomJid(jid) || this.joinedRooms.has(jid)) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const until = this.roomPresenceBlockedUntil.get(jid) || 0;
|
|
293
|
+
// Hard failures (1 h) and invalid JIDs (24 h) are not worth a retry.
|
|
294
|
+
if (until - now > Math.max(this.failureBackoffMs, 1000) * 2) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const at = Math.max(until, now);
|
|
298
|
+
if (soonest === null || at < soonest) {
|
|
299
|
+
soonest = at;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return soonest;
|
|
303
|
+
}
|
|
304
|
+
scheduleSweepRetry(epoch, round) {
|
|
305
|
+
if (epoch !== this.epoch) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (round >= SWEEP_RETRY_DELAYS_MS.length) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const at = this.nextSweepRetryAt();
|
|
312
|
+
if (at === null) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (this.sweepRetryTimer) {
|
|
316
|
+
clearTimeout(this.sweepRetryTimer);
|
|
317
|
+
}
|
|
318
|
+
const delay = Math.max(SWEEP_RETRY_DELAYS_MS[round], at - Date.now() + 100);
|
|
319
|
+
this.sweepRetryTimer = setTimeout(() => {
|
|
320
|
+
this.sweepRetryTimer = null;
|
|
321
|
+
this.runSweepRetry(epoch, round).catch(() => undefined);
|
|
322
|
+
}, delay);
|
|
323
|
+
}
|
|
324
|
+
async runSweepRetry(epoch, round) {
|
|
325
|
+
if (epoch !== this.epoch || !this.host.getClient()) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
// A fresh full sweep owns the pool right now: try again after it.
|
|
329
|
+
if (this.sweepRetryRunning || this.sendAllPresencesInFlight) {
|
|
330
|
+
this.scheduleSweepRetry(epoch, round);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (this.nextSweepRetryAt() === null) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
this.sweepRetryRunning = true;
|
|
337
|
+
try {
|
|
338
|
+
const summary = await this.allRoomPresencesStanza(epoch);
|
|
339
|
+
if (epoch !== this.epoch) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const failed = new Set(summary.failedRooms);
|
|
343
|
+
summary.sweptRooms.forEach(jid => {
|
|
344
|
+
if (!failed.has(jid)) {
|
|
345
|
+
this.joinedRooms.add(jid);
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
} catch (error) {
|
|
349
|
+
console.warn(`[XMPP] sweep_retry:error ${formatError(error)}`);
|
|
350
|
+
} finally {
|
|
351
|
+
this.sweepRetryRunning = false;
|
|
352
|
+
}
|
|
353
|
+
this.scheduleSweepRetry(epoch, round + 1);
|
|
354
|
+
}
|
|
355
|
+
async allRoomPresencesStanza(epoch = this.epoch) {
|
|
356
|
+
const client = this.host.getClient();
|
|
357
|
+
if (!client) {
|
|
358
|
+
return emptySummary();
|
|
359
|
+
}
|
|
360
|
+
try {
|
|
361
|
+
return await allRoomPresences(client, roomJid => this.ensureRoomPresence(roomJid, {
|
|
362
|
+
settleDelay: 0,
|
|
363
|
+
timeoutMs: 5000,
|
|
364
|
+
waitForJoin: true,
|
|
365
|
+
source: 'background'
|
|
366
|
+
}), {
|
|
367
|
+
concurrency: this.joinConcurrency,
|
|
368
|
+
isJoined: jid => this.joinedRooms.has(jid),
|
|
369
|
+
getActiveRoomJid: () => store.getState().rooms.activeRoomJID,
|
|
370
|
+
rank: jid => getRoomLastActivityScore(store.getState().rooms.rooms?.[jid]),
|
|
371
|
+
isCancelled: () => epoch !== this.epoch,
|
|
372
|
+
isRoomJid: jid => this.isValidRoomJid(jid),
|
|
373
|
+
onPriorityDone: () => {
|
|
374
|
+
if (epoch === this.epoch) {
|
|
375
|
+
this.priorityPresencesReady = true;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
} catch (error) {
|
|
380
|
+
console.warn(`[XMPP] allRoomPresencesStanza:error ${formatError(error)}`);
|
|
381
|
+
return emptySummary();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=roomJoinSweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["store","presenceInRoom","allRoomPresences","isLikelyMucJid","getRoomLastActivityScore","DAY_MS","SWEEP_RETRY_DELAYS_MS","DEFAULT_JOIN_CONCURRENCY","DEFAULT_FAILURE_BACKOFF_MS","formatError","error","Error","message","String","emptySummary","total","success","failed","failedRooms","sweptRooms","failures","RoomJoinManager","presencesReady","priorityPresencesReady","joinedRooms","Set","roomPresenceInFlight","Map","roomPresenceBlockedUntil","sweepRetryTimer","sweepRetryRunning","sendAllPresencesInFlight","constructor","host","qos","own","getHistoryQoS","fromConfig","getState","chatSettingStore","config","historyQoS","joinConcurrency","Math","max","floor","Number","joinHistoryStanzas","failureBackoffMs","presenceFailureBackoffMs","epoch","getConnectionEpoch","isValidRoomJid","jid","conference","getConference","at","indexOf","slice","split","isJoinableJid","length","reset","clearSweepRetry","clear","isJoined","roomJid","has","ensureRoomPresence","roomJID","options","source","console","warn","set","Date","now","blockedUntil","get","settleDelay","timeoutMs","waitForJoin","existing","OWN_TIMEOUT","Symbol","timer","ownTimeout","Promise","resolve","setTimeout","result","race","clearTimeout","joinEpoch","promise","isOnline","waitForOnline","client","getClient","add","delete","catch","isHardFailure","includes","finally","sendAllPresencesAndMarkReady","hasUnjoinedRooms","run","runAllPresencesSweep","rooms","Object","keys","some","summary","allRoomPresencesStanza","forEach","text","map","item","reason","join","scheduleSweepRetry","nextSweepRetryAt","soonest","until","round","delay","runSweepRetry","undefined","concurrency","getActiveRoomJid","activeRoomJID","rank","isCancelled","isRoomJid","onPriorityDone"],"sourceRoot":"../../../../src","sources":["networking/xmpp/roomJoinSweep.ts"],"mappings":";;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SACEC,gBAAgB,QAEX,yBAAyB;AAChC,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,wBAAwB,QAAQ,iCAAiC;;AAG1E;AACA;AACA;AACA;;AAyBA,MAAMC,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAClC,OAAO,MAAMC,qBAAqB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AACxD,MAAMC,wBAAwB,GAAG,CAAC;AAClC,MAAMC,0BAA0B,GAAG,KAAK;AAExC,MAAMC,WAAW,GAAIC,KAAc,IACjCA,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC;AAExD,MAAMI,YAAY,GAAGA,CAAA,MAA+B;EAClDC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,MAAM,EAAE,CAAC;EACTC,WAAW,EAAE,EAAE;EACfC,UAAU,EAAE,EAAE;EACdC,QAAQ,EAAE;AACZ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