@ethora/chat-component-rn 26.9.0 → 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 +34 -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 +53 -4
- 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 +54 -79
- 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 +318 -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 +54 -5
- 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 +54 -79
- 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 +318 -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 +2 -0
- 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 +90 -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 +50 -9
- 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 +56 -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 +312 -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 +95 -5
- package/src/version.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MILLISECONDS_LOWER_BOUND","MICROSECONDS_UPPER_BOUND","NANOS_UPPER_BOUND","normalizeTimestampValue","value","Number","isFinite","Math","floor","exports","getTimestampFromUnknown","Date","ts","getTime","trimmed","trim","test","parsedDate","numericChunk","match"],"sourceRoot":"../../../src","sources":["helpers/timestamp.ts"],"mappings":";;;;;;AAAA,MAAMA,wBAAwB,GAAG,IAAI;AACrC,MAAMC,wBAAwB,GAAG,IAAI;AACrC,MAAMC,iBAAiB,GAAG,IAAI;AAEvB,MAAMC,uBAAuB,GAAIC,KAAa,IAAa;EAChE,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,IAAIA,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC;EACnD,IAAIA,KAAK,GAAGJ,wBAAwB,EAAE,OAAOI,KAAK,GAAG,IAAI,CAAC,CAAC;EAC3D,IAAIA,KAAK,GAAGF,iBAAiB,EAAE,OAAOK,IAAI,CAACC,KAAK,CAACJ,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;EACrE,IAAIA,KAAK,GAAGH,wBAAwB,EAAE,OAAOM,IAAI,CAACC,KAAK,CAACJ,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;EACvE,OAAOA,KAAK,CAAC,CAAC;AAChB,CAAC;AAACK,OAAA,CAAAN,uBAAA,GAAAA,uBAAA;AAEK,MAAMO,uBAAuB,GAAIN,KAAc,IAAa;EACjE,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAO,CAAC;EAE3B,IAAIA,KAAK,YAAYO,IAAI,EAAE;IACzB,MAAMC,EAAE,GAAGR,KAAK,CAACS,OAAO,CAAC,CAAC;IAC1B,OAAOR,MAAM,CAACC,QAAQ,CAACM,EAAE,CAAC,IAAIA,EAAE,GAAG,CAAC,GAAGA,EAAE,GAAG,CAAC;EAC/C;EAEA,IAAI,OAAOR,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOD,uBAAuB,CAACC,KAAK,CAAC;EACvC;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMU,OAAO,GAAGV,KAAK,CAACW,IAAI,CAAC,CAAC;IAC5B,IAAI,CAACD,OAAO,EAAE,OAAO,CAAC;IAEtB,IAAI,OAAO,CAACE,IAAI,CAACF,OAAO,CAAC,EAAE;MACzB,OAAOX,uBAAuB,CAACE,MAAM,CAACS,OAAO,CAAC,CAAC;IACjD;IAEA,MAAMG,UAAU,GAAG,IAAIN,IAAI,CAACG,OAAO,CAAC,CAACD,OAAO,CAAC,CAAC;IAC9C,IAAIR,MAAM,CAACC,QAAQ,CAACW,UAAU,CAAC,IAAIA,UAAU,GAAG,CAAC,EAAE,OAAOA,UAAU;IAEpE,MAAMC,YAAY,GAAGJ,OAAO,CAACK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAClD,IAAID,YAAY,EAAE;MAChB,OAAOf,uBAAuB,CAACE,MAAM,CAACa,YAAY,CAAC,CAAC;IACtD;EACF;EAEA,OAAO,CAAC;AACV,CAAC;AAACT,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ensureRoomDirectory = ensureRoomDirectory;
|
|
7
|
+
exports.isUserNotFound = exports.getUserLookupStatus = exports.getRoomDirectoryState = exports.getRoomDirectoryMembers = void 0;
|
|
8
|
+
exports.refreshUser = refreshUser;
|
|
9
|
+
exports.requestSendersOf = requestSendersOf;
|
|
10
|
+
exports.requestUsers = requestUsers;
|
|
11
|
+
exports.resetUserResolver = resetUserResolver;
|
|
12
|
+
exports.subscribeUserResolver = void 0;
|
|
13
|
+
var _apiClient = _interopRequireDefault(require("../networking/apiClient"));
|
|
14
|
+
var _roomMembers = require("../networking/api-requests/roomMembers.api");
|
|
15
|
+
var _dedupeMembers = require("./dedupeMembers");
|
|
16
|
+
var _roomStore = require("../roomStore");
|
|
17
|
+
var _roomsSlice = require("../roomStore/roomsSlice");
|
|
18
|
+
var _chatSettingsSlice = require("../roomStore/chatSettingsSlice");
|
|
19
|
+
var _safeKey = require("../roomStore/safeKey");
|
|
20
|
+
var _xmppUsername = require("./xmppUsername");
|
|
21
|
+
var _xmppIdShape = require("./xmppIdShape");
|
|
22
|
+
var _sessionAppId = require("./sessionAppId");
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
// Lazy user resolution.
|
|
25
|
+
//
|
|
26
|
+
// GET /v1/chats/my returns at most 30 members of a big room (plus
|
|
27
|
+
// `usersCnt`), so senders of older messages are unknown to usersSet. The
|
|
28
|
+
// source of truth for a name is the backend user record, fetched here:
|
|
29
|
+
// - one user: GET /v1/apps/users/<appId_userId>, falling back to
|
|
30
|
+
// GET /v2/chats/users?xmppUsername=<appId_userId> when the backend does
|
|
31
|
+
// not take our token on v1 (see lookupUser in roomMembers.api.ts)
|
|
32
|
+
// - GET /v2/chats/users?chatName=<roomLocal>&limit=500 a room directory
|
|
33
|
+
// Results go into rooms.usersSet through mergeUsersSet (names render from
|
|
34
|
+
// usersSet at render time, so nothing else needs rewriting). Only display fields are kept: the
|
|
35
|
+
// endpoint also returns email and tags, which must never reach the
|
|
36
|
+
// persisted usersSet.
|
|
37
|
+
|
|
38
|
+
const DEBOUNCE_MS = 150;
|
|
39
|
+
const CONCURRENCY = 4;
|
|
40
|
+
const SINGLE_FETCH_LIMIT = 10;
|
|
41
|
+
const MAX_PENDING = 200;
|
|
42
|
+
const NOT_FOUND_TTL_MS = 10 * 60_000;
|
|
43
|
+
const BACKOFF_STEPS_MS = [5_000, 30_000];
|
|
44
|
+
const DIRECTORY_PAGE_LIMIT = 500;
|
|
45
|
+
const DIRECTORY_MAX_PAGES = 200;
|
|
46
|
+
const DIRECTORY_MAX_STALE_PAGES = 5;
|
|
47
|
+
const INSERT_BUFFER_MS = 100;
|
|
48
|
+
let generation = 0;
|
|
49
|
+
const pending = new Set();
|
|
50
|
+
const inflight = new Set();
|
|
51
|
+
const negative = new Map();
|
|
52
|
+
let debounceTimer = null;
|
|
53
|
+
let activeWorkers = 0;
|
|
54
|
+
const queue = [];
|
|
55
|
+
let insertBuffer = [];
|
|
56
|
+
const refreshTimers = new Map();
|
|
57
|
+
const refreshAgain = new Set();
|
|
58
|
+
// ids whose in-progress fetch was asked for by refreshUser
|
|
59
|
+
const refreshForced = new Set();
|
|
60
|
+
let insertTimer = null;
|
|
61
|
+
const dirState = new Map();
|
|
62
|
+
const dirInflight = new Map();
|
|
63
|
+
// A failed directory is not retried for a while: without this a dead
|
|
64
|
+
// endpoint turned every debounce pass into another directory request.
|
|
65
|
+
const DIRECTORY_RETRY_MS = 30_000;
|
|
66
|
+
const dirFailedAt = new Map();
|
|
67
|
+
const dirCoolingDown = jid => Date.now() - (dirFailedAt.get(jid) ?? -Infinity) < DIRECTORY_RETRY_MS;
|
|
68
|
+
// The directory members of each room in server order, grown page by page.
|
|
69
|
+
const dirMembers = new Map();
|
|
70
|
+
const listeners = new Set();
|
|
71
|
+
const notify = () => {
|
|
72
|
+
listeners.forEach(l => {
|
|
73
|
+
try {
|
|
74
|
+
l();
|
|
75
|
+
} catch {
|
|
76
|
+
// a broken subscriber must not stop the others
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** Re-render hook: called when a directory state or a negative cache entry changes. */
|
|
82
|
+
const subscribeUserResolver = listener => {
|
|
83
|
+
listeners.add(listener);
|
|
84
|
+
return () => {
|
|
85
|
+
listeners.delete(listener);
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
exports.subscribeUserResolver = subscribeUserResolver;
|
|
89
|
+
let sessionIdentity = '';
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The signed-in account is the session identity: when another account signs
|
|
93
|
+
* in, every cache and in-flight result of the previous one is dropped (a
|
|
94
|
+
* token refresh for the same account must not). No token (logout, or a
|
|
95
|
+
* transient rehydrate gap) just yields '' and does no work.
|
|
96
|
+
*/
|
|
97
|
+
const getToken = () => {
|
|
98
|
+
const u = _roomStore.store.getState().chatSettingStore?.user;
|
|
99
|
+
const token = u?.token || '';
|
|
100
|
+
const identity = String(u?.xmppUsername || u?._id || '');
|
|
101
|
+
if (token && identity && sessionIdentity && identity !== sessionIdentity) {
|
|
102
|
+
resetUserResolver();
|
|
103
|
+
}
|
|
104
|
+
if (token && identity) sessionIdentity = identity;
|
|
105
|
+
return token;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** `appId_userId@host/res`, `appId_userId`, or a doubled prefix -> `appId_userId`. */
|
|
109
|
+
const normalizeId = raw => {
|
|
110
|
+
if (typeof raw !== 'string') return '';
|
|
111
|
+
const local = (0, _xmppIdShape.toLocalPart)(raw.split('/')[0]).trim();
|
|
112
|
+
if (!local || local === 'undefined') return '';
|
|
113
|
+
return (0, _xmppUsername.normalizeXmppUsername)(local);
|
|
114
|
+
};
|
|
115
|
+
const isLookupable = id => {
|
|
116
|
+
if (!id || /\s/.test(id) || !(0, _safeKey.isSafeKey)(id)) return false;
|
|
117
|
+
// Only appId_userId shaped ids can exist on the backend.
|
|
118
|
+
if (!id.includes('_')) return false;
|
|
119
|
+
if (!(0, _safeKey.hasSafeIdSegments)(id)) return false;
|
|
120
|
+
const appId = (0, _sessionAppId.getSessionAppId)();
|
|
121
|
+
if (appId && (id === appId || id === `${appId}_${appId}`)) return false;
|
|
122
|
+
return true;
|
|
123
|
+
};
|
|
124
|
+
const sanitizeUser = (raw, fallbackId) => {
|
|
125
|
+
if (!raw || typeof raw !== 'object') return null;
|
|
126
|
+
const xmppUsername = normalizeId(raw.xmppUsername) || fallbackId || '';
|
|
127
|
+
if (!(0, _safeKey.isSafeKey)(xmppUsername)) return null;
|
|
128
|
+
const user = {
|
|
129
|
+
_id: String(raw._id ?? ''),
|
|
130
|
+
xmppUsername,
|
|
131
|
+
firstName: typeof raw.firstName === 'string' ? raw.firstName : '',
|
|
132
|
+
lastName: typeof raw.lastName === 'string' ? raw.lastName : ''
|
|
133
|
+
};
|
|
134
|
+
if (typeof raw.profileImage === 'string' && raw.profileImage) {
|
|
135
|
+
user.profileImage = raw.profileImage;
|
|
136
|
+
}
|
|
137
|
+
return user;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// One dispatch for the whole batch. Display fields are laid over whatever the
|
|
141
|
+
// entry already carries (role, jid, ...) so a lookup never strips what the
|
|
142
|
+
// REST member list put there. RN renders names from usersSet at render time,
|
|
143
|
+
// so no message rewrite is needed.
|
|
144
|
+
const insertIntoUsersSet = users => {
|
|
145
|
+
if (!users.length) return;
|
|
146
|
+
const existing = _roomStore.store.getState().rooms?.usersSet || {};
|
|
147
|
+
const members = {};
|
|
148
|
+
for (const u of users) {
|
|
149
|
+
if (!(0, _safeKey.isSafeKey)(u?.xmppUsername)) continue;
|
|
150
|
+
members[u.xmppUsername] = {
|
|
151
|
+
...(existing[u.xmppUsername] || {}),
|
|
152
|
+
...u
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (Object.keys(members).length) _roomStore.store.dispatch((0, _roomsSlice.mergeUsersSet)({
|
|
156
|
+
members
|
|
157
|
+
}));
|
|
158
|
+
};
|
|
159
|
+
const flushInserts = () => {
|
|
160
|
+
if (insertTimer) {
|
|
161
|
+
clearTimeout(insertTimer);
|
|
162
|
+
insertTimer = null;
|
|
163
|
+
}
|
|
164
|
+
if (!insertBuffer.length) return;
|
|
165
|
+
const batch = insertBuffer;
|
|
166
|
+
insertBuffer = [];
|
|
167
|
+
insertIntoUsersSet(batch);
|
|
168
|
+
};
|
|
169
|
+
const bufferInsert = users => {
|
|
170
|
+
if (!users.length) return;
|
|
171
|
+
insertBuffer.push(...users);
|
|
172
|
+
if (!insertTimer) insertTimer = setTimeout(flushInserts, INSERT_BUFFER_MS);
|
|
173
|
+
};
|
|
174
|
+
const markNegative = (id, kind) => {
|
|
175
|
+
const prev = negative.get(id);
|
|
176
|
+
const attempts = (prev?.kind === 'error' ? prev.attempts : 0) + 1;
|
|
177
|
+
const ttl = kind !== 'error' ? NOT_FOUND_TTL_MS : BACKOFF_STEPS_MS[Math.min(attempts - 1, BACKOFF_STEPS_MS.length - 1)];
|
|
178
|
+
negative.set(id, {
|
|
179
|
+
until: Date.now() + ttl,
|
|
180
|
+
kind,
|
|
181
|
+
attempts
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
const isNegative = id => {
|
|
185
|
+
const n = negative.get(id);
|
|
186
|
+
if (!n) return false;
|
|
187
|
+
if (n.until <= Date.now()) {
|
|
188
|
+
// keep an expired error entry so attempts keep escalating the backoff
|
|
189
|
+
if (n.kind !== 'error') negative.delete(id);
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return true;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* True for an id the backend answered 404 for: the user really is gone.
|
|
197
|
+
* (An id merely not resolved yet is NOT "not found".)
|
|
198
|
+
*/
|
|
199
|
+
const isUserNotFound = rawId => {
|
|
200
|
+
const n = negative.get(normalizeId(rawId));
|
|
201
|
+
return Boolean(n && n.kind === 'notfound' && n.until > Date.now());
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Where a sender's lookup stands, for the display chain:
|
|
206
|
+
* - resolved: in usersSet
|
|
207
|
+
* - pending: queued, in flight, or not requested yet (a bubble just mounted)
|
|
208
|
+
* - notfound / forbidden: the backend answered, nothing to show from it
|
|
209
|
+
* - failed: the last attempt errored (backoff), or the lookup is exhausted
|
|
210
|
+
* - unavailable: this id can never be looked up (plain handle) or there is
|
|
211
|
+
* no session token, so nothing is coming
|
|
212
|
+
*/
|
|
213
|
+
exports.isUserNotFound = isUserNotFound;
|
|
214
|
+
const getUserLookupStatus = rawId => {
|
|
215
|
+
const id = normalizeId(rawId);
|
|
216
|
+
if (!id) return 'unavailable';
|
|
217
|
+
if (_roomStore.store.getState().rooms?.usersSet?.[id]) return 'resolved';
|
|
218
|
+
const n = negative.get(id);
|
|
219
|
+
// an answer recorded a moment ago wins over the in-flight bookkeeping that
|
|
220
|
+
// is cleared right after it
|
|
221
|
+
if (n && isNegative(id)) return n.kind === 'error' ? 'failed' : n.kind;
|
|
222
|
+
if (pending.has(id) || inflight.has(id) || queue.includes(id)) {
|
|
223
|
+
return 'pending';
|
|
224
|
+
}
|
|
225
|
+
if (n && n.kind === 'error') return 'failed';
|
|
226
|
+
if (!isLookupable(id) || !getToken()) return 'unavailable';
|
|
227
|
+
return 'pending';
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// A refreshed profile that is the signed-in user's own also updates the
|
|
231
|
+
// session user (chatSettingStore.user), which feeds the own-profile UI.
|
|
232
|
+
// Only the display fields, and only when something actually changed.
|
|
233
|
+
exports.getUserLookupStatus = getUserLookupStatus;
|
|
234
|
+
const applyToSessionUser = (id, fresh) => {
|
|
235
|
+
const me = _roomStore.store.getState().chatSettingStore?.user;
|
|
236
|
+
if (!me || normalizeId(me.xmppUsername) !== id) return;
|
|
237
|
+
const updates = {};
|
|
238
|
+
if (fresh.firstName !== undefined && fresh.firstName !== me.firstName) {
|
|
239
|
+
updates.firstName = fresh.firstName;
|
|
240
|
+
}
|
|
241
|
+
if (fresh.lastName !== undefined && fresh.lastName !== me.lastName) {
|
|
242
|
+
updates.lastName = fresh.lastName;
|
|
243
|
+
}
|
|
244
|
+
if (fresh.profileImage && fresh.profileImage !== me.profileImage) {
|
|
245
|
+
updates.profileImage = fresh.profileImage;
|
|
246
|
+
}
|
|
247
|
+
if (Object.keys(updates).length) _roomStore.store.dispatch((0, _chatSettingsSlice.updateUser)({
|
|
248
|
+
updates
|
|
249
|
+
}));
|
|
250
|
+
};
|
|
251
|
+
const fetchOne = async (id, gen) => {
|
|
252
|
+
const token = getToken();
|
|
253
|
+
if (!token) return;
|
|
254
|
+
const outcome = await (0, _roomMembers.lookupUser)(id, token);
|
|
255
|
+
if (gen !== generation) return;
|
|
256
|
+
if (outcome.status === 'ok') {
|
|
257
|
+
const user = sanitizeUser(outcome.user, id);
|
|
258
|
+
if (user) {
|
|
259
|
+
negative.delete(id);
|
|
260
|
+
bufferInsert([user]);
|
|
261
|
+
if (refreshForced.delete(id)) applyToSessionUser(id, user);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
markNegative(id, 'notfound');
|
|
265
|
+
} else {
|
|
266
|
+
markNegative(id, outcome.status);
|
|
267
|
+
}
|
|
268
|
+
notify();
|
|
269
|
+
};
|
|
270
|
+
const pump = gen => {
|
|
271
|
+
while (activeWorkers < CONCURRENCY && queue.length) {
|
|
272
|
+
const id = queue.shift();
|
|
273
|
+
activeWorkers++;
|
|
274
|
+
inflight.add(id);
|
|
275
|
+
fetchOne(id, gen).finally(() => {
|
|
276
|
+
if (gen !== generation) return;
|
|
277
|
+
inflight.delete(id);
|
|
278
|
+
activeWorkers--;
|
|
279
|
+
// a refresh asked for while this fetch was running: its answer may
|
|
280
|
+
// predate the change, so fetch once more
|
|
281
|
+
if (refreshAgain.delete(id) && !queue.includes(id)) queue.push(id);
|
|
282
|
+
if (queue.length) pump(gen);else if (activeWorkers === 0) flushInserts();
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const knownUsers = () => _roomStore.store.getState().rooms?.usersSet || {};
|
|
287
|
+
|
|
288
|
+
/** The room, if any, whose unknown senders among `ids` justify one directory fetch. */
|
|
289
|
+
const pickDirectoryRoom = ids => {
|
|
290
|
+
const idSet = new Set(ids);
|
|
291
|
+
const rooms = _roomStore.store.getState().rooms?.rooms || {};
|
|
292
|
+
let best = null;
|
|
293
|
+
let bestCount = SINGLE_FETCH_LIMIT;
|
|
294
|
+
for (const [jid, room] of Object.entries(rooms)) {
|
|
295
|
+
const cnt = Number(room?.usersCnt || 0);
|
|
296
|
+
const have = Array.isArray(room?.members) ? room.members.length : 0;
|
|
297
|
+
if (!(have < cnt) || dirState.get(jid) === 'done' || dirCoolingDown(jid)) {
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
const seen = new Set();
|
|
301
|
+
for (const m of room.messages || []) {
|
|
302
|
+
const uid = normalizeId(m?.user?.id);
|
|
303
|
+
if (uid && idSet.has(uid)) seen.add(uid);
|
|
304
|
+
}
|
|
305
|
+
if (seen.size > bestCount) {
|
|
306
|
+
best = jid;
|
|
307
|
+
bestCount = seen.size;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return best;
|
|
311
|
+
};
|
|
312
|
+
const flush = () => {
|
|
313
|
+
debounceTimer = null;
|
|
314
|
+
const gen = generation;
|
|
315
|
+
const users = knownUsers();
|
|
316
|
+
const ids = [...pending].filter(id => !users[id] && !inflight.has(id) && !isNegative(id));
|
|
317
|
+
pending.clear();
|
|
318
|
+
if (!ids.length) return;
|
|
319
|
+
if (ids.length > SINGLE_FETCH_LIMIT) {
|
|
320
|
+
const roomJid = pickDirectoryRoom(ids);
|
|
321
|
+
if (roomJid) {
|
|
322
|
+
ensureRoomDirectory(roomJid).then(() => {
|
|
323
|
+
if (gen !== generation) return;
|
|
324
|
+
// whoever the directory did not contain (left the room) still gets
|
|
325
|
+
// the per-user lookup
|
|
326
|
+
requestUsers(ids);
|
|
327
|
+
});
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
for (const id of ids) if (!queue.includes(id)) queue.push(id);
|
|
332
|
+
pump(gen);
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Ask for the profiles of these senders. Cheap to call from anywhere (a
|
|
337
|
+
* bubble mounting, a history batch parse): known, in-flight and recently
|
|
338
|
+
* failed ids are dropped, the rest are debounced into one pass.
|
|
339
|
+
*/
|
|
340
|
+
function requestUsers(ids) {
|
|
341
|
+
if (!Array.isArray(ids) || !ids.length) return;
|
|
342
|
+
if (!getToken()) return;
|
|
343
|
+
const users = knownUsers();
|
|
344
|
+
let added = false;
|
|
345
|
+
for (const raw of ids) {
|
|
346
|
+
const id = normalizeId(raw);
|
|
347
|
+
if (!isLookupable(id)) continue;
|
|
348
|
+
if (users[id] || inflight.has(id) || pending.has(id) || isNegative(id)) {
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
pending.add(id);
|
|
352
|
+
added = true;
|
|
353
|
+
if (pending.size > MAX_PENDING) {
|
|
354
|
+
// drop the oldest
|
|
355
|
+
const oldest = pending.values().next().value;
|
|
356
|
+
pending.delete(oldest);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (!added) return;
|
|
360
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
361
|
+
debounceTimer = setTimeout(flush, DEBOUNCE_MS);
|
|
362
|
+
}
|
|
363
|
+
const REFRESH_DEBOUNCE_MS = 500;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Re-fetch one user's profile even though it is already in usersSet, because
|
|
367
|
+
* the server said it changed (ethora-event user-profile-updated). Bypasses
|
|
368
|
+
* the cache and forgets a negative-cache entry, but shares everything else
|
|
369
|
+
* with requestUsers: the same route chain (lookupUser), the same worker
|
|
370
|
+
* queue and concurrency cap, one request at a time per user. Calls for the
|
|
371
|
+
* same user within REFRESH_DEBOUNCE_MS coalesce into one fetch. The answer
|
|
372
|
+
* goes through mergeUsersSet (display fields only), so existing bubbles are
|
|
373
|
+
* re-named. Never throws.
|
|
374
|
+
*/
|
|
375
|
+
function refreshUser(rawId) {
|
|
376
|
+
const id = normalizeId(rawId);
|
|
377
|
+
if (!isLookupable(id) || !getToken()) return;
|
|
378
|
+
const prior = refreshTimers.get(id);
|
|
379
|
+
if (prior) clearTimeout(prior);
|
|
380
|
+
const gen = generation;
|
|
381
|
+
refreshTimers.set(id, setTimeout(() => {
|
|
382
|
+
refreshTimers.delete(id);
|
|
383
|
+
if (gen !== generation) return;
|
|
384
|
+
negative.delete(id);
|
|
385
|
+
refreshForced.add(id);
|
|
386
|
+
if (inflight.has(id)) {
|
|
387
|
+
refreshAgain.add(id);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (!queue.includes(id)) queue.push(id);
|
|
391
|
+
pump(gen);
|
|
392
|
+
}, REFRESH_DEBOUNCE_MS));
|
|
393
|
+
}
|
|
394
|
+
const EMPTY_DIRECTORY = [];
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Members loaded so far by ensureRoomDirectory for this room (a new array
|
|
398
|
+
* identity after every page, a stable empty array before any).
|
|
399
|
+
*/
|
|
400
|
+
const getRoomDirectoryMembers = roomJID => dirMembers.get(roomJID) || EMPTY_DIRECTORY;
|
|
401
|
+
|
|
402
|
+
/** requestUsers for the senders of a batch of messages (history page, jump window). */
|
|
403
|
+
exports.getRoomDirectoryMembers = getRoomDirectoryMembers;
|
|
404
|
+
function requestSendersOf(messages) {
|
|
405
|
+
if (!messages?.length) return;
|
|
406
|
+
const ids = new Set();
|
|
407
|
+
for (const m of messages) {
|
|
408
|
+
const id = m?.user?.id;
|
|
409
|
+
if (id) ids.add(id);
|
|
410
|
+
}
|
|
411
|
+
if (ids.size) requestUsers([...ids]);
|
|
412
|
+
}
|
|
413
|
+
const getRoomDirectoryState = roomJID => dirState.get(roomJID) || 'idle';
|
|
414
|
+
exports.getRoomDirectoryState = getRoomDirectoryState;
|
|
415
|
+
const setDirState = (roomJID, state) => {
|
|
416
|
+
if (dirState.get(roomJID) === state) return;
|
|
417
|
+
dirState.set(roomJID, state);
|
|
418
|
+
notify();
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Loads every member of one room into usersSet, once. Pages are not
|
|
423
|
+
* guaranteed to be full, so it stops on an empty page or offset >= total,
|
|
424
|
+
* never on `items.length < limit`.
|
|
425
|
+
*/
|
|
426
|
+
function ensureRoomDirectory(roomJID) {
|
|
427
|
+
if (!roomJID || typeof roomJID !== 'string') return Promise.resolve();
|
|
428
|
+
if (dirState.get(roomJID) === 'done') return Promise.resolve();
|
|
429
|
+
const running = dirInflight.get(roomJID);
|
|
430
|
+
if (running) return running;
|
|
431
|
+
if (dirCoolingDown(roomJID)) return Promise.resolve();
|
|
432
|
+
const token = getToken();
|
|
433
|
+
const chatName = (0, _xmppIdShape.toLocalPart)(roomJID);
|
|
434
|
+
if (!token || !chatName) return Promise.resolve();
|
|
435
|
+
const gen = generation;
|
|
436
|
+
setDirState(roomJID, 'loading');
|
|
437
|
+
const job = (async () => {
|
|
438
|
+
let offset = 0;
|
|
439
|
+
let total = Infinity;
|
|
440
|
+
let stale = 0;
|
|
441
|
+
try {
|
|
442
|
+
for (let page = 0; page < DIRECTORY_MAX_PAGES; page++) {
|
|
443
|
+
const res = await _apiClient.default.get('/v2/chats/users', {
|
|
444
|
+
params: {
|
|
445
|
+
chatName,
|
|
446
|
+
limit: DIRECTORY_PAGE_LIMIT,
|
|
447
|
+
offset
|
|
448
|
+
},
|
|
449
|
+
headers: {
|
|
450
|
+
Authorization: token
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
if (gen !== generation) return;
|
|
454
|
+
const data = res?.data || {};
|
|
455
|
+
const items = Array.isArray(data.items) ? data.items : Array.isArray(data.results) ? data.results : [];
|
|
456
|
+
if (!items.length) break;
|
|
457
|
+
const batch = items.map(item => sanitizeUser(item)).filter(u => Boolean(u));
|
|
458
|
+
// The backend can repeat the same user across pages (total counts the
|
|
459
|
+
// repeats), so merge by identity: first occurrence wins.
|
|
460
|
+
const before = dirMembers.get(roomJID) || EMPTY_DIRECTORY;
|
|
461
|
+
const merged = (0, _dedupeMembers.dedupeMembers)([...before, ...batch]);
|
|
462
|
+
const added = merged.length - before.length;
|
|
463
|
+
if (added > 0) {
|
|
464
|
+
insertIntoUsersSet(batch);
|
|
465
|
+
dirMembers.set(roomJID, merged);
|
|
466
|
+
notify();
|
|
467
|
+
}
|
|
468
|
+
offset += items.length;
|
|
469
|
+
// Pages made only of repeats are normal at the tail (the real
|
|
470
|
+
// 435/11/3/1 shape), but a run of them means the server ignores
|
|
471
|
+
// offset: stop instead of walking to the page cap.
|
|
472
|
+
stale = added > 0 ? 0 : stale + 1;
|
|
473
|
+
if (stale >= DIRECTORY_MAX_STALE_PAGES) break;
|
|
474
|
+
const t = Number(data.total ?? data.pagination?.total);
|
|
475
|
+
if (Number.isFinite(t)) total = t;
|
|
476
|
+
if (offset >= total) break;
|
|
477
|
+
}
|
|
478
|
+
if (gen === generation) setDirState(roomJID, 'done');
|
|
479
|
+
} catch {
|
|
480
|
+
if (gen === generation) {
|
|
481
|
+
dirFailedAt.set(roomJID, Date.now());
|
|
482
|
+
setDirState(roomJID, 'error');
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
})().finally(() => {
|
|
486
|
+
if (dirInflight.get(roomJID) === job) dirInflight.delete(roomJID);
|
|
487
|
+
});
|
|
488
|
+
dirInflight.set(roomJID, job);
|
|
489
|
+
return job;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/** For tests and logout: drops every cache, timer and in-flight result. */
|
|
493
|
+
function resetUserResolver() {
|
|
494
|
+
generation++;
|
|
495
|
+
sessionIdentity = '';
|
|
496
|
+
pending.clear();
|
|
497
|
+
inflight.clear();
|
|
498
|
+
negative.clear();
|
|
499
|
+
(0, _roomMembers.resetUserLookupRoute)();
|
|
500
|
+
queue.length = 0;
|
|
501
|
+
activeWorkers = 0;
|
|
502
|
+
insertBuffer = [];
|
|
503
|
+
refreshTimers.forEach(t => clearTimeout(t));
|
|
504
|
+
refreshTimers.clear();
|
|
505
|
+
refreshAgain.clear();
|
|
506
|
+
refreshForced.clear();
|
|
507
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
508
|
+
debounceTimer = null;
|
|
509
|
+
if (insertTimer) clearTimeout(insertTimer);
|
|
510
|
+
insertTimer = null;
|
|
511
|
+
dirState.clear();
|
|
512
|
+
dirInflight.clear();
|
|
513
|
+
dirFailedAt.clear();
|
|
514
|
+
dirMembers.clear();
|
|
515
|
+
notify();
|
|
516
|
+
}
|
|
517
|
+
//# sourceMappingURL=userResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_apiClient","_interopRequireDefault","require","_roomMembers","_dedupeMembers","_roomStore","_roomsSlice","_chatSettingsSlice","_safeKey","_xmppUsername","_xmppIdShape","_sessionAppId","e","__esModule","default","DEBOUNCE_MS","CONCURRENCY","SINGLE_FETCH_LIMIT","MAX_PENDING","NOT_FOUND_TTL_MS","BACKOFF_STEPS_MS","DIRECTORY_PAGE_LIMIT","DIRECTORY_MAX_PAGES","DIRECTORY_MAX_STALE_PAGES","INSERT_BUFFER_MS","generation","pending","Set","inflight","negative","Map","debounceTimer","activeWorkers","queue","insertBuffer","refreshTimers","refreshAgain","refreshForced","insertTimer","dirState","dirInflight","DIRECTORY_RETRY_MS","dirFailedAt","dirCoolingDown","jid","Date","now","get","Infinity","dirMembers","listeners","notify","forEach","l","subscribeUserResolver","listener","add","delete","exports","sessionIdentity","getToken","u","store","getState","chatSettingStore","user","token","identity","String","xmppUsername","_id","resetUserResolver","normalizeId","raw","local","toLocalPart","split","trim","normalizeXmppUsername","isLookupable","id","test","isSafeKey","includes","hasSafeIdSegments","appId","getSessionAppId","sanitizeUser","fallbackId","firstName","lastName","profileImage","insertIntoUsersSet","users","length","existing","rooms","usersSet","members","Object","keys","dispatch","mergeUsersSet","flushInserts","clearTimeout","batch","bufferInsert","push","setTimeout","markNegative","kind","prev","attempts","ttl","Math","min","set","until","isNegative","n","isUserNotFound","rawId","Boolean","getUserLookupStatus","has","applyToSessionUser","fresh","me","updates","undefined","updateUser","fetchOne","gen","outcome","lookupUser","status","pump","shift","finally","knownUsers","pickDirectoryRoom","ids","idSet","best","bestCount","room","entries","cnt","Number","usersCnt","have","Array","isArray","seen","m","messages","uid","size","flush","filter","clear","roomJid","ensureRoomDirectory","then","requestUsers","added","oldest","values","next","value","REFRESH_DEBOUNCE_MS","refreshUser","prior","EMPTY_DIRECTORY","getRoomDirectoryMembers","roomJID","requestSendersOf","getRoomDirectoryState","setDirState","state","Promise","resolve","running","chatName","job","offset","total","stale","page","res","http","params","limit","headers","Authorization","data","items","results","map","item","before","merged","dedupeMembers","t","pagination","isFinite","resetUserLookupRoute"],"sourceRoot":"../../../src","sources":["helpers/userResolver.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAAiD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMG,WAAW,GAAG,GAAG;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,kBAAkB,GAAG,EAAE;AAC7B,MAAMC,WAAW,GAAG,GAAG;AACvB,MAAMC,gBAAgB,GAAG,EAAE,GAAG,MAAM;AACpC,MAAMC,gBAAgB,GAA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AK,CAAC6D,MAAM,GAAG,CAAC;EAChB9D,aAAa,GAAG,CAAC;EACjBE,YAAY,GAAG,EAAE;EACjBC,aAAa,CAACiB,OAAO,CAAEuJ,CAAC,IAAKnG,YAAY,CAACmG,CAAC,CAAC,CAAC;EAC7CxK,aAAa,CAAC6H,KAAK,CAAC,CAAC;EACrB5H,YAAY,CAAC4H,KAAK,CAAC,CAAC;EACpB3H,aAAa,CAAC2H,KAAK,CAAC,CAAC;EACrB,IAAIjI,aAAa,EAAEyE,YAAY,CAACzE,aAAa,CAAC;EAC9CA,aAAa,GAAG,IAAI;EACpB,IAAIO,WAAW,EAAEkE,YAAY,CAAClE,WAAW,CAAC;EAC1CA,WAAW,GAAG,IAAI;EAClBC,QAAQ,CAACyH,KAAK,CAAC,CAAC;EAChBxH,WAAW,CAACwH,KAAK,CAAC,CAAC;EACnBtH,WAAW,CAACsH,KAAK,CAAC,CAAC;EACnB/G,UAAU,CAAC+G,KAAK,CAAC,CAAC;EAClB7G,MAAM,CAAC,CAAC;AACV","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toLocalPart = exports.isOpaqueXmppUserId = void 0;
|
|
7
|
+
// Pure string-shape helpers for xmpp local ids/JIDs - no dependency on the
|
|
8
|
+
// redux store. Kept separate from xmppUsername.ts (which imports `store`
|
|
9
|
+
// for normalizeXmppUsername/isSameXmppUsername) so this file can be safely
|
|
10
|
+
// imported from the redux reducer graph itself (roomsSlice.ts,
|
|
11
|
+
// createUserNameFromSetUser.ts): those are pulled in by roomStore/index.ts
|
|
12
|
+
// to build the root reducer, and importing anything that in turn imports
|
|
13
|
+
// `store` from roomStore/index.ts there creates a circular dependency back
|
|
14
|
+
// into the module that is still assembling the store.
|
|
15
|
+
|
|
16
|
+
// Strips a value that the local part of an XMPP JID may carry, leaving
|
|
17
|
+
// just the bare resource (anything before `@`). XMPP allows resources
|
|
18
|
+
// with `@` only in escaped form so the simple split is enough here.
|
|
19
|
+
const toLocalPart = value => {
|
|
20
|
+
if (!value) return '';
|
|
21
|
+
return String(value).split('@')[0];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// A 24-character hex string is a Mongo ObjectId - the shape of both the
|
|
25
|
+
// appId and the userId that make up an Ethora xmpp username.
|
|
26
|
+
exports.toLocalPart = toLocalPart;
|
|
27
|
+
const HEX24 = '[0-9a-fA-F]{24}';
|
|
28
|
+
// `<appId>_<userId>` (the normal shape) or a bare id on its own (seen on
|
|
29
|
+
// system/local entries that never went through the appId_userId join).
|
|
30
|
+
// Anchored end to end so a human handle that merely contains 24 hex chars
|
|
31
|
+
// somewhere (unlikely, but not impossible) is never caught by accident.
|
|
32
|
+
const UUID = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
|
|
33
|
+
// `<appId>_<uuid>` or `<appId>_<hex24>`, optionally followed by further
|
|
34
|
+
// `_<token>` segments (appId is hex24 on most deployments, any alphanumeric
|
|
35
|
+
// token on others). A bare id, or a two-segment mongo id, is the original
|
|
36
|
+
// shape.
|
|
37
|
+
const OPAQUE_XMPP_USER_ID_RE = new RegExp(`^(?:${HEX24}(?:_${HEX24})?|[A-Za-z0-9]+_(?:${HEX24}|${UUID})(?:_[0-9A-Za-z-]+)*)$`);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* True when `value` (a full JID or already-bare local part) is a
|
|
41
|
+
* machine-generated Ethora id rather than anything a human would recognize
|
|
42
|
+
* as their own name - `<24 hex>_<24 hex>`, `<appId>_<uuid>` or a bare 24-hex
|
|
43
|
+
* id. Kept narrow on purpose: a handle a person actually picked is never
|
|
44
|
+
* this shape, so it is never mistaken for one.
|
|
45
|
+
*/
|
|
46
|
+
const isOpaqueXmppUserId = value => {
|
|
47
|
+
const local = toLocalPart(value || '').trim();
|
|
48
|
+
if (!local) return false;
|
|
49
|
+
return OPAQUE_XMPP_USER_ID_RE.test(local);
|
|
50
|
+
};
|
|
51
|
+
exports.isOpaqueXmppUserId = isOpaqueXmppUserId;
|
|
52
|
+
//# sourceMappingURL=xmppIdShape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toLocalPart","value","String","split","exports","HEX24","UUID","OPAQUE_XMPP_USER_ID_RE","RegExp","isOpaqueXmppUserId","local","trim","test"],"sourceRoot":"../../../src","sources":["helpers/xmppIdShape.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,WAAW,GAAIC,KAAc,IAAa;EACrD,IAAI,CAACA,KAAK,EAAE,OAAO,EAAE;EACrB,OAAOC,MAAM,CAACD,KAAK,CAAC,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;;AAED;AACA;AAAAC,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AACA,MAAMK,KAAK,GAAG,iBAAiB;AAC/B;AACA;AACA;AACA;AACA,MAAMC,IAAI,GACR,6EAA6E;AAC/E;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,IAAIC,MAAM,CACvC,OAAOH,KAAK,OAAOA,KAAK,sBAAsBA,KAAK,IAAIC,IAAI,wBAC7D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,kBAAkB,GAAIR,KAAgC,IAAc;EAC/E,MAAMS,KAAK,GAAGV,WAAW,CAACC,KAAK,IAAI,EAAE,CAAC,CAACU,IAAI,CAAC,CAAC;EAC7C,IAAI,CAACD,KAAK,EAAE,OAAO,KAAK;EACxB,OAAOH,sBAAsB,CAACK,IAAI,CAACF,KAAK,CAAC;AAC3C,CAAC;AAACN,OAAA,CAAAK,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|