@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,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.recoverXmppCredentials = recoverXmppCredentials;
|
|
7
|
+
var _roomStore = require("../roomStore");
|
|
8
|
+
var _authRefresh = require("./authRefresh");
|
|
9
|
+
var _xmppToken = require("./api-requests/xmppToken.api");
|
|
10
|
+
var _resolveInitBeforeLoadUser = require("../helpers/resolveInitBeforeLoadUser");
|
|
11
|
+
var _devLogger = require("../utils/devLogger");
|
|
12
|
+
/**
|
|
13
|
+
* Credentials the XMPP client reconnects with after a SASL
|
|
14
|
+
* `not-authorized`. Order: session rotation (when enabled), the dedicated
|
|
15
|
+
* xmpp-token endpoint, the full re-mint chain, then the stored value.
|
|
16
|
+
* Never throws.
|
|
17
|
+
*/
|
|
18
|
+
async function recoverXmppCredentials(config) {
|
|
19
|
+
// 1. Make sure the REST tokens are fresh before re-minting XMPP
|
|
20
|
+
// creds. This used to call `config.refreshTokens.refreshFunction`
|
|
21
|
+
// directly and then fall into step 2, which refreshes again -
|
|
22
|
+
// two rotations back to back, which the new backend scheme
|
|
23
|
+
// reads as a race at best and token reuse at worst. One call to
|
|
24
|
+
// the shared rotation point covers both the consumer-supplied
|
|
25
|
+
// function and the built-in endpoint.
|
|
26
|
+
if (config?.refreshTokens?.enabled) {
|
|
27
|
+
const rotated = await (0, _authRefresh.refreshAuthTokensQuietly)({
|
|
28
|
+
force: true
|
|
29
|
+
});
|
|
30
|
+
if (rotated?.xmppPassword) {
|
|
31
|
+
const rotatedUser = _roomStore.store.getState().chatSettingStore.user;
|
|
32
|
+
return {
|
|
33
|
+
username: rotatedUser?.xmppUsername || rotatedUser?.defaultWallet?.walletAddress || '',
|
|
34
|
+
password: rotated.xmppPassword
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 2. Ask the endpoint built for exactly this: a fresh XMPP
|
|
40
|
+
// credential without touching the REST session. The store's own
|
|
41
|
+
// copy is the credential that just failed, so re-reading it is a
|
|
42
|
+
// no-op retry. Single-flight, never throws, writes the store.
|
|
43
|
+
const minted = await (0, _xmppToken.fetchFreshXmppPassword)();
|
|
44
|
+
if (minted) {
|
|
45
|
+
const u = _roomStore.store.getState().chatSettingStore.user;
|
|
46
|
+
return {
|
|
47
|
+
username: u?.xmppUsername || u?.defaultWallet?.walletAddress || '',
|
|
48
|
+
password: minted
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 3. Re-mint XMPP creds via the right priority chain for the
|
|
53
|
+
// current auth mode. This call ALWAYS hydrates (unlike
|
|
54
|
+
// `resolveInitBeforeLoadUser` which short-circuits when a
|
|
55
|
+
// cached user already has xmppCredentials).
|
|
56
|
+
const fresh = await (0, _resolveInitBeforeLoadUser.refreshUserCredentialsForXmpp)(config).catch(err => {
|
|
57
|
+
(0, _devLogger.pushLog)('warn', 'XMPP creds refresh: full chain failed', err);
|
|
58
|
+
return null;
|
|
59
|
+
});
|
|
60
|
+
if (fresh) {
|
|
61
|
+
(0, _resolveInitBeforeLoadUser.applyResolvedUserToStore)(fresh);
|
|
62
|
+
return {
|
|
63
|
+
username: fresh.xmppUsername || fresh.defaultWallet?.walletAddress || '',
|
|
64
|
+
password: fresh.xmppPassword || ''
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 4. Last-resort: return the cached creds so reconnect() can
|
|
69
|
+
// still attempt a connection. If the original failure was
|
|
70
|
+
// a stale JWT this will fail again and the user has to
|
|
71
|
+
// re-mount the chat - but at least we don't break the
|
|
72
|
+
// transient-network-blip case where the cached creds are
|
|
73
|
+
// still valid.
|
|
74
|
+
const u = _roomStore.store.getState().chatSettingStore.user;
|
|
75
|
+
return {
|
|
76
|
+
username: u?.xmppUsername || u?.defaultWallet?.walletAddress || '',
|
|
77
|
+
password: u?.xmppPassword || ''
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=xmppCredentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_roomStore","require","_authRefresh","_xmppToken","_resolveInitBeforeLoadUser","_devLogger","recoverXmppCredentials","config","refreshTokens","enabled","rotated","refreshAuthTokensQuietly","force","xmppPassword","rotatedUser","store","getState","chatSettingStore","user","username","xmppUsername","defaultWallet","walletAddress","password","minted","fetchFreshXmppPassword","u","fresh","refreshUserCredentialsForXmpp","catch","err","devPushLog","applyResolvedUserToStore"],"sourceRoot":"../../../src","sources":["networking/xmppCredentials.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,0BAAA,GAAAH,OAAA;AAIA,IAAAI,UAAA,GAAAJ,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeK,sBAAsBA,CAC1CC,MAAgB,EACiC;EACjD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAIA,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE;IAClC,MAAMC,OAAO,GAAG,MAAM,IAAAC,qCAAwB,EAAC;MAAEC,KAAK,EAAE;IAAK,CAAC,CAAC;IAE/D,IAAIF,OAAO,EAAEG,YAAY,EAAE;MACzB,MAAMC,WAAW,GAAGC,gBAAK,CAACC,QAAQ,CAAC,CAAC,CAACC,gBAAgB,CAACC,IAAI;MAC1D,OAAO;QACLC,Q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
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.jumpThreadMiddleware = void 0;
|
|
7
|
+
var _jumpThread = require("../../helpers/jumpThread");
|
|
8
|
+
const find = (messages, id) => (messages ?? []).find(message => String(message.id) === id);
|
|
9
|
+
const mergeUnique = (a, b) => {
|
|
10
|
+
const seen = new Set(a.map(message => String(message.id)));
|
|
11
|
+
return [...a, ...b.filter(message => !seen.has(String(message.id)))];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Keeps the thread panel's parent (helpers/jumpThread) in step with the
|
|
16
|
+
* actions that open and close threads, without the room slice knowing about
|
|
17
|
+
* jump windows:
|
|
18
|
+
* - closing a thread, leaving the room or logging out forgets it;
|
|
19
|
+
* - opening a thread on a message that exists only in a jump window (the
|
|
20
|
+
* live-list flag has nothing to flag) records that message and the replies
|
|
21
|
+
* seen with it, so the panel can open;
|
|
22
|
+
* - clearing the window while the panel shows a window-only parent: if the
|
|
23
|
+
* parent has meanwhile reached the live list, the ordinary flag takes over;
|
|
24
|
+
* otherwise the panel keeps the copy it already has.
|
|
25
|
+
* - a jump request while a thread panel is open: the panel replaces the main
|
|
26
|
+
* list, so no main-list instance exists to take the jump. Unless the target
|
|
27
|
+
* is a reply of the open parent (the thread's own list serves it), the
|
|
28
|
+
* thread is closed so the main list mounts; a reply of another parent is
|
|
29
|
+
* then resolved by the normal flow, which opens that parent's thread;
|
|
30
|
+
* - a request nobody owns is dropped shortly after its TTL, without the
|
|
31
|
+
* "archived" card when the message is in the live list.
|
|
32
|
+
*/
|
|
33
|
+
// Slack after the TTL so an owner that is merely polling finishes first.
|
|
34
|
+
const ORPHAN_GRACE_MS = 5000;
|
|
35
|
+
const jumpThreadMiddleware = storeAPI => next => action => {
|
|
36
|
+
const result = next(action);
|
|
37
|
+
const type = action?.type;
|
|
38
|
+
if (type === 'roomMessages/setCloseActiveMessage' || type === 'roomMessages/setCurrentRoom' || type === 'roomMessages/setLogoutState' ||
|
|
39
|
+
// The settings slice is named 'chat', so its logout is 'chat/logout'.
|
|
40
|
+
type === 'chat/logout') {
|
|
41
|
+
(0, _jumpThread.clearJumpThread)();
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
if (type === 'roomMessages/requestJumpToMessage') {
|
|
45
|
+
const state = storeAPI.getState().rooms;
|
|
46
|
+
const jump = state.pendingJump;
|
|
47
|
+
if (!jump) {
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
const roomJID = jump.roomJID;
|
|
51
|
+
const live = state.rooms?.[roomJID]?.messages ?? [];
|
|
52
|
+
const window = state.jumpWindow;
|
|
53
|
+
const pool = mergeUnique(live, window && window.roomJID === roomJID ? window.messages : []);
|
|
54
|
+
const open = pool.find(message => message.activeMessage);
|
|
55
|
+
if (open) {
|
|
56
|
+
const content = {
|
|
57
|
+
createdAt: jump.createdAt,
|
|
58
|
+
body: jump.body
|
|
59
|
+
};
|
|
60
|
+
const index = (0, _jumpThread.findMessageIndex)(pool, jump.ids, content);
|
|
61
|
+
const sameParent = index >= 0 && (0, _jumpThread.replyParentId)(pool[index]) === String(open.id);
|
|
62
|
+
if (sameParent) {
|
|
63
|
+
// The open thread serves this jump: make it the owner (a thread
|
|
64
|
+
// opened by hand owns nothing, so the jump would stay pending).
|
|
65
|
+
const held = (0, _jumpThread.getJumpThread)();
|
|
66
|
+
const base = held && held.parentId === String(open.id) ? held : null;
|
|
67
|
+
(0, _jumpThread.setJumpThread)({
|
|
68
|
+
roomJID,
|
|
69
|
+
parentId: String(open.id),
|
|
70
|
+
at: jump.at,
|
|
71
|
+
parent: base?.parent ?? null,
|
|
72
|
+
replies: mergeUnique(base?.replies ?? [], [pool[index]])
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
storeAPI.dispatch({
|
|
76
|
+
type: 'roomMessages/setCloseActiveMessage',
|
|
77
|
+
payload: {
|
|
78
|
+
chatJID: roomJID
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const at = jump.at;
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
const now = storeAPI.getState().rooms;
|
|
86
|
+
const still = now.pendingJump;
|
|
87
|
+
if (!still || still.at !== at) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
storeAPI.dispatch({
|
|
91
|
+
type: 'roomMessages/clearPendingJump'
|
|
92
|
+
});
|
|
93
|
+
const inLive = (0, _jumpThread.findMessageIndex)(now.rooms?.[still.roomJID]?.messages ?? [], still.ids, {
|
|
94
|
+
createdAt: still.createdAt,
|
|
95
|
+
body: still.body
|
|
96
|
+
}) >= 0;
|
|
97
|
+
if (!inLive && still.preview) {
|
|
98
|
+
storeAPI.dispatch({
|
|
99
|
+
type: 'roomMessages/showArchivedMessage',
|
|
100
|
+
payload: still.preview
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, _jumpThread.JUMP_TTL_MS + ORPHAN_GRACE_MS);
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
if (type === 'roomMessages/setActiveMessage') {
|
|
107
|
+
const {
|
|
108
|
+
id,
|
|
109
|
+
chatJID
|
|
110
|
+
} = action.payload ?? {};
|
|
111
|
+
const held = (0, _jumpThread.getJumpThread)();
|
|
112
|
+
// A thread this jump just opened and flagged: nothing to do.
|
|
113
|
+
if (held && held.parentId === id && held.roomJID === chatJID) {
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
(0, _jumpThread.clearJumpThread)();
|
|
117
|
+
const rooms = storeAPI.getState().rooms;
|
|
118
|
+
if (find(rooms.rooms?.[chatJID]?.messages, id)) {
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
const window = rooms.jumpWindow;
|
|
122
|
+
const parent = window && window.roomJID === chatJID ? find(window.messages, id) : undefined;
|
|
123
|
+
if (parent) {
|
|
124
|
+
(0, _jumpThread.setJumpThread)({
|
|
125
|
+
roomJID: chatJID,
|
|
126
|
+
parentId: id,
|
|
127
|
+
at: null,
|
|
128
|
+
parent,
|
|
129
|
+
replies: window.messages.filter(message => (0, _jumpThread.replyParentId)(message) === id)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
if (type === 'roomMessages/clearJumpWindow') {
|
|
135
|
+
const held = (0, _jumpThread.getJumpThread)();
|
|
136
|
+
if (!held?.parent) {
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
const live = find(storeAPI.getState().rooms.rooms?.[held.roomJID]?.messages, held.parentId);
|
|
140
|
+
if (live) {
|
|
141
|
+
const {
|
|
142
|
+
roomJID,
|
|
143
|
+
parentId
|
|
144
|
+
} = held;
|
|
145
|
+
(0, _jumpThread.clearJumpThread)();
|
|
146
|
+
storeAPI.dispatch({
|
|
147
|
+
type: 'roomMessages/setActiveMessage',
|
|
148
|
+
payload: {
|
|
149
|
+
id: parentId,
|
|
150
|
+
chatJID: roomJID
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
};
|
|
157
|
+
exports.jumpThreadMiddleware = jumpThreadMiddleware;
|
|
158
|
+
//# sourceMappingURL=jumpThreadMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_jumpThread","require","find","messages","id","message","String","mergeUnique","a","b","seen","Set","map","filter","has","ORPHAN_GRACE_MS","jumpThreadMiddleware","storeAPI","next","action","result","type","clearJumpThread","state","getState","rooms","jump","pendingJump","roomJID","live","window","jumpWindow","pool","open","activeMessage","content","createdAt","body","index","findMessageIndex","ids","sameParent","replyParentId","held","getJumpThread","base","parentId","setJumpThread","at","parent","replies","dispatch","payload","chatJID","setTimeout","now","still","inLive","preview","JUMP_TTL_MS","undefined","exports"],"sourceRoot":"../../../../src","sources":["roomStore/Midd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,MAAMS,IAAI,GAAG3B,IAAI,CACfe,QAAQ,CAACO,QAAQ,CAAC,CAAC,CAACC,KAAK,CAACA,KAAK,GAAGkB,IAAI,CAACf,OAAO,CAAC,EAAEzB,QAAQ,EACzDwC,IAAI,CAACG,QACP,CAAC;IACD,IAAIjB,IAAI,EAAE;MACR,MAAM;QAAED,OAAO;QAAEkB;MAAS,CAAC,GAAGH,IAAI;MAClC,IAAArB,2BAAe,EAAC,CAAC;MACjBL,QAAQ,CAACkC,QAAQ,CAAC;QAChB9B,IAAI,EAAE,+BAA+B;QACrC+B,OAAO,EAAE;UAAEhD,EAAE,EAAE0C,QAAQ;UAAEO,OAAO,EAAEzB;QAAQ;MAC5C,CAAC,CAAC;IACJ;EACF;EACA,OAAOR,MAAM;AACf,CAAC;AAACyC,OAAA,CAAA7C,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -23,6 +23,12 @@ const reactionsMiddleware = storeAPI => next => action => {
|
|
|
23
23
|
return next(action);
|
|
24
24
|
}
|
|
25
25
|
const result = next(action);
|
|
26
|
+
// Reactions replayed from the archive update the target message only. The
|
|
27
|
+
// room preview showing an emoji is for LIVE reactions; a history replay
|
|
28
|
+
// would otherwise replace the latest real message with the emoji.
|
|
29
|
+
if (action.meta?.fromHistory) {
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
26
32
|
try {
|
|
27
33
|
const payload = action.payload || {};
|
|
28
34
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_roomsSlice","require","reactionsMiddleware","storeAPI","next","action","type","payload","console","error","result","roomJID","reactions","latestReactionTimestamp","data","room","getState","rooms","ts","Number","roomTs","lastMessageTimestamp","Array","isArray","name","senderFirstName","senderLastName","trim","dispatch","updateRoom","jid","updates","lastMessage","id","body","emoji","user","date","Date","Math","floor","toISOString","messages","last","i","length","m","isDeleted","undefined","e","warn","exports"],"sourceRoot":"../../../../src","sources":["roomStore/Middleware/reactionsMiddleware.tsx"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAA+B,GACzCC,QAAQ,IAAMC,IAAI,IAAMC,MAAW,IAAK;EACvC,IAAIA,MAAM,EAAEC,IAAI,KAAK,2BAA2B,EAAE;IAChD,OAAOF,IAAI,CAACC,MAAM,CAAC;EACrB;EACA,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,OAAOF,MAAM,CAACE,OAAO,KAAK,QAAQ,EAAE;IACzDC,OAAO,CAACC,KAAK,CAAC,0CAA0C,EAAEJ,MAAM,CAAC;IACjE,OAAOD,IAAI,CAACC,MAAM,CAAC;EACrB;EACA,MAAMK,MAAM,GAAGN,IAAI,CAACC,MAAM,CAAC;EAC3B,IAAI;IACF,
|
|
1
|
+
{"version":3,"names":["_roomsSlice","require","reactionsMiddleware","storeAPI","next","action","type","payload","console","error","result","meta","fromHistory","roomJID","reactions","latestReactionTimestamp","data","room","getState","rooms","ts","Number","roomTs","lastMessageTimestamp","Array","isArray","name","senderFirstName","senderLastName","trim","dispatch","updateRoom","jid","updates","lastMessage","id","body","emoji","user","date","Date","Math","floor","toISOString","messages","last","i","length","m","isDeleted","undefined","e","warn","exports"],"sourceRoot":"../../../../src","sources":["roomStore/Middleware/reactionsMiddleware.tsx"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAA+B,GACzCC,QAAQ,IAAMC,IAAI,IAAMC,MAAW,IAAK;EACvC,IAAIA,MAAM,EAAEC,IAAI,KAAK,2BAA2B,EAAE;IAChD,OAAOF,IAAI,CAACC,MAAM,CAAC;EACrB;EACA,IAAI,CAACA,MAAM,CAACE,OAAO,IAAI,OAAOF,MAAM,CAACE,OAAO,KAAK,QAAQ,EAAE;IACzDC,OAAO,CAACC,KAAK,CAAC,0CAA0C,EAAEJ,MAAM,CAAC;IACjE,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AC;YACnBwB,IAAI,EAAE;cAAEH,EAAE,EAAE,SAASf,EAAE,EAAE;cAAEM;YAAK,CAAC;YACjCa,IAAI,EAAE,IAAIC,IAAI,CAACC,IAAI,CAACC,KAAK,CAACtB,EAAE,GAAG,IAAI,CAAC,CAAC,CAACuB,WAAW,CAAC;UACpD;QACF;MACF,CAAC,CACH,CAAC;MACD,OAAOjC,MAAM;IACf;;IAEA;IACA;IACA,IAAI,CAAEO,IAAI,CAACiB,WAAW,EAAUG,KAAK,EAAE;MAAC,OAAO3B,MAAM;IAAC;IACtD,MAAMkC,QAAoB,GAAG3B,IAAI,CAAC2B,QAAQ,IAAI,EAAE;IAChD,IAAIC,IAA0B;IAC9B,KAAK,IAAIC,CAAC,GAAGF,QAAQ,CAACG,MAAM,GAAG,CAAC,EAAED,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;MAC7C,MAAME,CAAC,GAAGJ,QAAQ,CAACE,CAAC,CAAC;MACrB,IAAIE,CAAC,IAAIA,CAAC,CAACb,EAAE,KAAK,eAAe,IAAI,CAACa,CAAC,CAACC,SAAS,EAAE;QACjDJ,IAAI,GAAGG,CAAC;QACR;MACF;IACF;IACA7C,QAAQ,CAAC2B,QAAQ,CACf,IAAAC,sBAAU,EAAC;MACTC,GAAG,EAAEnB,OAAO;MACZoB,OAAO,EAAE;QAAEC,WAAW,EAAGW,IAAI,IAAYK;MAAU;IACrD,CAAC,CACH,CAAC;EACH,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV;IACA3C,OAAO,CAAC4C,IAAI,CAAC,4CAA4C,EAAED,CAAC,CAAC;EAC/D;EACA,OAAOzC,MAAM;AACf,CAAC;AAAC2C,OAAA,CAAAnD,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.unreadMiddleware = void 0;
|
|
7
7
|
var _roomsSlice = require("../roomsSlice");
|
|
8
|
+
var _timestamp = require("../../helpers/timestamp");
|
|
8
9
|
// Per-room cache so we only recompute when something that affects the
|
|
9
10
|
// count actually changed. The fingerprint is `<messages.length>|<lastViewed>`
|
|
10
11
|
// — switching just the lastViewedTimestamp (e.g. user re-opens a room)
|
|
@@ -63,7 +64,10 @@ const TRIGGER_ACTIONS = new Set(['roomMessages/addRoomMessage', 'roomMessages/ad
|
|
|
63
64
|
// Hydrating server-side read markers can move several rooms' baselines
|
|
64
65
|
// at once; recompute so the badges reflect the freshly-applied markers
|
|
65
66
|
// (with own-message filtering this middleware adds on top).
|
|
66
|
-
'roomMessages/applyPrivateStoreMarkers', 'roomMessages/setCurrentRoom', 'roomMessages/setVisibleRoom', 'roomMessages/clearVisibleRoom', 'roomMessages/addRoom',
|
|
67
|
+
'roomMessages/applyPrivateStoreMarkers', 'roomMessages/setCurrentRoom', 'roomMessages/setVisibleRoom', 'roomMessages/clearVisibleRoom', 'roomMessages/addRoom',
|
|
68
|
+
// A /chats/my refresh can bring a fresh server-reported unread count
|
|
69
|
+
// (apiUnreadCount) that has to reach the badge without any local history.
|
|
70
|
+
'roomMessages/addRoomFromApi', 'roomMessages/updateRoom',
|
|
67
71
|
// The history preload scheduler merges fetched pages via this action on
|
|
68
72
|
// re-entry; recompute so unread reflects messages that arrived while the
|
|
69
73
|
// app was away (the per-room fingerprint cache below skips no-op batches,
|
|
@@ -150,17 +154,24 @@ const unreadMiddleware = storeAPI => next => action => {
|
|
|
150
154
|
}
|
|
151
155
|
continue;
|
|
152
156
|
}
|
|
157
|
+
// Server-reported unread (GET /v1/chats/my `unreadCount`): lets a room
|
|
158
|
+
// with no baseline and no loaded history still show a badge.
|
|
159
|
+
const apiUnread = typeof room.apiUnreadCount === 'number' && room.apiUnreadCount > 0 ? room.apiUnreadCount : undefined;
|
|
153
160
|
// No reference point (undefined / null / 0): after logout→login,
|
|
154
161
|
// hydrated rooms come back without lastViewedTimestamp, and treating
|
|
155
|
-
// that as 0 made every history message count as unread.
|
|
156
|
-
|
|
162
|
+
// that as 0 made every history message count as unread. Only the API
|
|
163
|
+
// count can speak for such a room.
|
|
164
|
+
if (!(room.lastViewedTimestamp > 0) && apiUnread === undefined) {
|
|
157
165
|
continue;
|
|
158
166
|
}
|
|
159
167
|
const msgs = room.messages;
|
|
160
168
|
const currentMessagesLength = msgs?.length || 0;
|
|
161
169
|
const firstId = currentMessagesLength ? String(msgs[0]?.id ?? '') : '';
|
|
162
170
|
const lastId = currentMessagesLength ? String(msgs[currentMessagesLength - 1]?.id ?? '') : '';
|
|
163
|
-
const fingerprint = `${currentMessagesLength}|${room.lastViewedTimestamp || 0}|${firstId}|${lastId}
|
|
171
|
+
const fingerprint = `${currentMessagesLength}|${room.lastViewedTimestamp || 0}|${firstId}|${lastId}|${room.apiUnreadCount ?? ''}|${room.apiUnreadSeededAt ?? ''}|${room.lastMessage?.date ?? ''}${
|
|
172
|
+
// Another reducer can reset the displayed count under an unchanged
|
|
173
|
+
// fingerprint; with a server count in play, recompute then too.
|
|
174
|
+
apiUnread !== undefined ? `|${room.unreadMessages ?? ''}` : ''}`;
|
|
164
175
|
if (triggerCache[jid] === fingerprint) {
|
|
165
176
|
continue;
|
|
166
177
|
}
|
|
@@ -172,10 +183,37 @@ const unreadMiddleware = storeAPI => next => action => {
|
|
|
172
183
|
// own messages so MAM-replayed sends on re-login don't bump
|
|
173
184
|
// the user's own badge.
|
|
174
185
|
const since = room.lastViewedTimestamp || 0;
|
|
186
|
+
const isCountable = msg => msg.id !== 'delimiter-new' && !msg.pending && String(msg?.isSystemMessage || '') !== 'true' && !isOwnMessage(msg, selfXmpp, selfWallet);
|
|
187
|
+
// Without a baseline (only reachable here via the API count) nothing
|
|
188
|
+
// can be counted locally: the whole history would read as unread.
|
|
175
189
|
let unreadMessagesCount = 0;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
190
|
+
if (since > 0) {
|
|
191
|
+
for (const msg of msgs || []) {
|
|
192
|
+
if (isCountable(msg) && (0, _roomsSlice.msgSortableMs)(msg) > since) {
|
|
193
|
+
unreadMessagesCount += 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Server-reported unread as a floor while history is not (fully)
|
|
199
|
+
// loaded. No double counting: messages newer than the seed time are
|
|
200
|
+
// counted on top of the API number (they arrived after the server
|
|
201
|
+
// computed it); older loaded ones are NOT added (the API number
|
|
202
|
+
// already covers them) and the result is max(local, api + newer).
|
|
203
|
+
// Once the user has read past the API's last message the API number
|
|
204
|
+
// is stale and ignored.
|
|
205
|
+
if (apiUnread !== undefined) {
|
|
206
|
+
const seededAt = (0, _timestamp.getTimestampFromUnknown)(room.apiUnreadSeededAt);
|
|
207
|
+
const apiLastTs = (0, _timestamp.getTimestampFromUnknown)(room.lastMessage?.date);
|
|
208
|
+
const readPastApi = since > 0 && apiLastTs > 0 && since >= apiLastTs;
|
|
209
|
+
if (!readPastApi) {
|
|
210
|
+
let newerThanSeed = 0;
|
|
211
|
+
for (const msg of msgs || []) {
|
|
212
|
+
if (isCountable(msg) && (0, _roomsSlice.msgSortableMs)(msg) > seededAt && (0, _roomsSlice.msgSortableMs)(msg) > since) {
|
|
213
|
+
newerThanSeed += 1;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
unreadMessagesCount = Math.max(unreadMessagesCount, apiUnread + newerThanSeed);
|
|
179
217
|
}
|
|
180
218
|
}
|
|
181
219
|
if (room.unreadMessages !== unreadMessagesCount) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_roomsSlice","require","triggerCache","norm","s","v","String","toLowerCase","split","replace","isOwnMessage","msg","selfXmpp","selfWallet","candidates","user","id","userJID","xmppUsername","filter","Boolean","length","self","Set","c","has","TRIGGER_ACTIONS","touchedRooms","action","p","payload","type","roomJID","chatJID","roomData","jid","Array","isArray","rooms","map","r","keys","Object","updates","relevant","some","k","unreadMiddleware","storeAPI","next","console","error","result","state","getState","visibleRoomJID","selfUser","chatSettingStore","walletAddress","touched","jids","counts","room","unreadMessages","lastViewedTimestamp","msgs","messages","currentMessagesLength","firstId","lastId","fingerprint","since","
|
|
1
|
+
{"version":3,"names":["_roomsSlice","require","_timestamp","triggerCache","norm","s","v","String","toLowerCase","split","replace","isOwnMessage","msg","selfXmpp","selfWallet","candidates","user","id","userJID","xmppUsername","filter","Boolean","length","self","Set","c","has","TRIGGER_ACTIONS","touchedRooms","action","p","payload","type","roomJID","chatJID","roomData","jid","Array","isArray","rooms","map","r","keys","Object","updates","relevant","some","k","unreadMiddleware","storeAPI","next","console","error","result","state","getState","visibleRoomJID","selfUser","chatSettingStore","walletAddress","touched","jids","counts","room","unreadMessages","apiUnread","apiUnreadCount","undefined","lastViewedTimestamp","msgs","messages","currentMessagesLength","firstId","lastId","fingerprint","apiUnreadSeededAt","lastMessage","date","since","isCountable","pending","isSystemMessage","unreadMessagesCount","msgSortableMs","seededAt","getTimestampFromUnknown","apiLastTs","readPastApi","newerThanSeed","Math","max","dispatch","setUnreadCounts","exports"],"sourceRoot":"../../../../src","sources":["roomStore/Middleware/unreadMidlleware.tsx"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIE,YAAuC,GAAG,CAAC,CAAC;;AAEhD;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAIC,CAAM,IAAa;EAC/B,IAAIA,CAAC,IAAI,IAAI,EAAE;IAAC,OAAO,EAAE;EAAC;EAC1B,IAAIC,CAAC,GAAGC,MAAM,CAACF,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC;EAC/BF,CAAC,GAAGA,CAAC,CAACG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACrBH,CAAC,GAAGA,CAAC,CAACG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACrB,OAAOH,C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I,IAAI,EAAE,EAAE;UAC5B,IACEU,WAAW,CAACnE,GAAG,CAAC,IAChB,IAAAuE,yBAAa,EAACvE,GAAG,CAAC,GAAGwE,QAAQ,IAC7B,IAAAD,yBAAa,EAACvE,GAAG,CAAC,GAAGkE,KAAK,EAC1B;YACAU,aAAa,IAAI,CAAC;UACpB;QACF;QACAN,mBAAmB,GAAGO,IAAI,CAACC,GAAG,CAC5BR,mBAAmB,EACnBjB,SAAS,GAAGuB,aACd,CAAC;MACH;IACF;IAEA,IAAIzB,IAAI,CAACC,cAAc,KAAKkB,mBAAmB,EAAE;MAC/CpB,MAAM,CAAC1B,GAAG,CAAC,GAAG8C,mBAAmB;IACnC;EACF;;EAEA;EACA;EACA,IAAIvC,MAAM,CAACD,IAAI,CAACoB,MAAM,CAAC,CAACxC,MAAM,GAAG,CAAC,EAAE;IAClC2B,QAAQ,CAAC0C,QAAQ,CAAC,IAAAC,2BAAe,EAAC9B,MAAM,CAAC,CAAC;EAC5C;EAEA,OAAOT,MAAM;AACf,CAAC;AAACwC,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.updateUser = exports.unpackAndTransform = exports.setUser = exports.setUiLocale = exports.setTranslateMode = exports.setThemePreference = exports.setStoreClient = exports.setSelectedUser = exports.setPushEnabled = exports.setLangSource = exports.setDeleteModal = exports.setConnectionState = exports.setConfig = exports.setActiveModal = exports.setActiveFile = exports.refreshTokens = exports.logout = exports.default = exports.chatSlice = void 0;
|
|
6
|
+
exports.updateUser = exports.unpackAndTransform = exports.setXmppPassword = exports.setUser = exports.setUiLocale = exports.setTranslateMode = exports.setThemePreference = exports.setStoreClient = exports.setSelectedUser = exports.setPushEnabled = exports.setLangSource = exports.setDeleteModal = exports.setConnectionState = exports.setConfig = exports.setActiveModal = exports.setActiveFile = exports.refreshTokens = exports.logout = exports.default = exports.chatSlice = void 0;
|
|
7
7
|
var _toolkit = require("@reduxjs/toolkit");
|
|
8
8
|
var _secureUserStorage = require("../helpers/secureUserStorage");
|
|
9
9
|
var _theme = require("../theme/theme");
|
|
@@ -160,6 +160,18 @@ const reducers = {
|
|
|
160
160
|
state.user.fileToken = action.payload.fileToken;
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
+
/**
|
|
164
|
+
* Just the XMPP credential, for POST /v1/users/xmpp-token. refreshTokens
|
|
165
|
+
* above needs a whole token pair, and minting only an XMPP password must
|
|
166
|
+
* not touch the REST session. Like refreshTokens, persistence belongs to
|
|
167
|
+
* the caller, which can await it.
|
|
168
|
+
*/
|
|
169
|
+
setXmppPassword: (state, action) => {
|
|
170
|
+
if (!action.payload) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
state.user.xmppPassword = action.payload;
|
|
174
|
+
},
|
|
163
175
|
logout: state => {
|
|
164
176
|
state.user = unpackAndTransform();
|
|
165
177
|
state.config = undefined;
|
|
@@ -190,6 +202,7 @@ const {
|
|
|
190
202
|
setUser,
|
|
191
203
|
setConfig,
|
|
192
204
|
refreshTokens,
|
|
205
|
+
setXmppPassword,
|
|
193
206
|
logout,
|
|
194
207
|
setActiveModal,
|
|
195
208
|
setDeleteModal,
|
|
@@ -217,6 +230,7 @@ exports.setSelectedUser = setSelectedUser;
|
|
|
217
230
|
exports.setDeleteModal = setDeleteModal;
|
|
218
231
|
exports.setActiveModal = setActiveModal;
|
|
219
232
|
exports.logout = logout;
|
|
233
|
+
exports.setXmppPassword = setXmppPassword;
|
|
220
234
|
exports.refreshTokens = refreshTokens;
|
|
221
235
|
exports.setConfig = setConfig;
|
|
222
236
|
exports.setUser = setUser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_toolkit","require","_secureUserStorage","_theme","unpackAndTransform","input","description","token","profileImage","_id","walletAddress","defaultWallet","xmppPassword","fileToken","refreshToken","firstName","lastName","email","username","appId","homeScreen","registrationChannelType","updatedAt","authMethod","resetPasswordExpires","resetPasswordToken","xmppUsername","roles","tags","__v","isProfileOpen","isAssetsOpen","isAgreeWithTerms","exports","initialState","user","deleteModal","isDeleteModal","roomJid","messageId","config","colors","primary","secondary","reducers","setUser","state","action","payload","secureUserStorage","set","updateUser","updates","setThemePreference","themePreference","applyThemePreference","setPushEnabled","pushEnabled","setConfig","setActiveModal","activeModal","setActiveFile","activeFile","setDeleteModal","setStoreClient","client","setSelectedUser","selectedUser","refreshTokens","logout","undefined","langSource","translateMode","remove","setLangSource","setTranslateMode","setUiLocale","uiLocale","setConnectionState","connection","chatSlice","createSlice","name","actions","_default","default","reducer"],"sourceRoot":"../../../src","sources":["roomStore/chatSettingsSlice.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAaA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AA4CO,MAAMG,kBAAkB,GAAIC,KAAY,IAAW;EACxD,OAAO;IACL;IACA;IACAC,WAAW,EAAED,KAAK,EAAEC,WAAW,IAAI,EAAE;IACrCC,KAAK,EAAEF,KAAK,EAAEE,KAAK,IAAI,EAAE;IACzBC,YAAY,EAAEH,KAAK,EAAEG,YAAY,IAAI,EAAE;IACvCC,GAAG,EAAEJ,KAAK,EAAEI,GAAG,IAAI,EAAE;IACrBC,aAAa,EAAEL,KAAK,EAAEM,aAAa,EAAED,aAAa,IAAI,EAAE;IACxDE,YAAY,EAAEP,KAAK,EAAEO,YAAY,IAAI,EAAE;IACvCC,SAAS,EAAER,KAAK,EAAEQ,SAAS,IAAI,EAAE;IACjCC,YAAY,EAAET,KAAK,EAAES,YAAY,IAAI,EAAE;IACvCC,SAAS,EAAEV,KAAK,EAAEU,SAAS,IAAI,EAAE;IACjCC,QAAQ,EAAEX,KAAK,EAAEW,QAAQ,IAAI,EAAE;IAC/BL,aAAa,EAAE;MACbD,aAAa,EAAEL,KAAK,EAAEM,aA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AA+B,EAC/BC,MAKE,KACC;IACHD,KAAK,CAACX,IAAI,CAACrB,YAAY,GAAGiC,MAAM,CAACC,OAAO,CAAClC,YAAY;IACrDgC,KAAK,CAACX,IAAI,CAAC5B,KAAK,GAAGwC,MAAM,CAACC,OAAO,CAACzC,KAAK;IAEvC,IAAIwC,MAAM,CAACC,OAAO,CAACpC,YAAY,EAAE;MAC/BkC,KAAK,CAACX,IAAI,CAACvB,YAAY,GAAGmC,MAAM,CAACC,OAAO,CAACpC,YAAY;IACvD;IAEA,IAAImC,MAAM,CAACC,OAAO,CAACnC,SAAS,EAAE;MAC5BiC,KAAK,CAACX,IAAI,CAACtB,SAAS,GAAGkC,MAAM,CAACC,OAAO,CAACnC,SAAS;IACjD;EACF,CAAC;
|
|
1
|
+
{"version":3,"names":["_toolkit","require","_secureUserStorage","_theme","unpackAndTransform","input","description","token","profileImage","_id","walletAddress","defaultWallet","xmppPassword","fileToken","refreshToken","firstName","lastName","email","username","appId","homeScreen","registrationChannelType","updatedAt","authMethod","resetPasswordExpires","resetPasswordToken","xmppUsername","roles","tags","__v","isProfileOpen","isAssetsOpen","isAgreeWithTerms","exports","initialState","user","deleteModal","isDeleteModal","roomJid","messageId","config","colors","primary","secondary","reducers","setUser","state","action","payload","secureUserStorage","set","updateUser","updates","setThemePreference","themePreference","applyThemePreference","setPushEnabled","pushEnabled","setConfig","setActiveModal","activeModal","setActiveFile","activeFile","setDeleteModal","setStoreClient","client","setSelectedUser","selectedUser","refreshTokens","setXmppPassword","logout","undefined","langSource","translateMode","remove","setLangSource","setTranslateMode","setUiLocale","uiLocale","setConnectionState","connection","chatSlice","createSlice","name","actions","_default","default","reducer"],"sourceRoot":"../../../src","sources":["roomStore/chatSettingsSlice.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAaA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AA4CO,MAAMG,kBAAkB,GAAIC,KAAY,IAAW;E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EAClBG,cAAc;EACdqB,WAAW;EACXE;AACF,CAAC,GAAGE,SAAS,CAACG,OAAO;AAACnD,OAAA,CAAA8C,kBAAA,GAAAA,kBAAA;AAAA9C,OAAA,CAAA4C,WAAA,GAAAA,WAAA;AAAA5C,OAAA,CAAAuB,cAAA,GAAAA,cAAA;AAAAvB,OAAA,CAAAoB,kBAAA,GAAAA,kBAAA;AAAApB,OAAA,CAAA2C,gBAAA,GAAAA,gBAAA;AAAA3C,OAAA,CAAA0C,aAAA,GAAAA,aAAA;AAAA1C,OAAA,CAAA+B,cAAA,GAAAA,cAAA;AAAA/B,OAAA,CAAA4B,aAAA,GAAAA,aAAA;AAAA5B,OAAA,CAAAkB,UAAA,GAAAA,UAAA;AAAAlB,OAAA,CAAAiC,eAAA,GAAAA,eAAA;AAAAjC,OAAA,CAAA8B,cAAA,GAAAA,cAAA;AAAA9B,OAAA,CAAA0B,cAAA,GAAAA,cAAA;AAAA1B,OAAA,CAAAqC,MAAA,GAAAA,MAAA;AAAArC,OAAA,CAAAoC,eAAA,GAAAA,eAAA;AAAApC,OAAA,CAAAmC,aAAA,GAAAA,aAAA;AAAAnC,OAAA,CAAAyB,SAAA,GAAAA,SAAA;AAAAzB,OAAA,CAAAY,OAAA,GAAAA,OAAA;AAAA,IAAAwC,QAAA,GAAApD,OAAA,CAAAqD,OAAA,GAEPL,SAAS,CAACM,OAAO","ignoreList":[]}
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.persistorReady = exports.getActiveRoom = void 0;
|
|
7
|
+
Object.defineProperty(exports, "resetSessionRoomState", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _persistence.resetSessionRoomState;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.store = void 0;
|
|
7
14
|
var _toolkit = require("@reduxjs/toolkit");
|
|
8
15
|
var _chatSettingsSlice = _interopRequireWildcard(require("./chatSettingsSlice"));
|
|
9
16
|
var _roomsSlice = _interopRequireWildcard(require("./roomsSlice"));
|
|
@@ -13,6 +20,7 @@ var _unreadMidlleware = require("./Middleware/unreadMidlleware");
|
|
|
13
20
|
var _logoutMiddleware = require("./Middleware/logoutMiddleware");
|
|
14
21
|
var _newMessageMidlleware = require("./Middleware/newMessageMidlleware");
|
|
15
22
|
var _reactionsMiddleware = require("./Middleware/reactionsMiddleware");
|
|
23
|
+
var _jumpThreadMiddleware = require("./Middleware/jumpThreadMiddleware");
|
|
16
24
|
var _perfMiddleware = require("./Middleware/perfMiddleware");
|
|
17
25
|
var _persistence = require("./persistence");
|
|
18
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -38,7 +46,7 @@ const createChatStore = () => (0, _toolkit.configureStore)({
|
|
|
38
46
|
serializableCheck: false,
|
|
39
47
|
immutableCheck: false
|
|
40
48
|
});
|
|
41
|
-
const chain = [_unreadMidlleware.unreadMiddleware, _newMessageMidlleware.newMessageMidlleware, _reactionsMiddleware.reactionsMiddleware, _logoutMiddleware.logoutMiddleware, _persistence.persistenceMiddleware];
|
|
49
|
+
const chain = [_unreadMidlleware.unreadMiddleware, _newMessageMidlleware.newMessageMidlleware, _reactionsMiddleware.reactionsMiddleware, _jumpThreadMiddleware.jumpThreadMiddleware, _logoutMiddleware.logoutMiddleware, _persistence.persistenceMiddleware];
|
|
42
50
|
return (0, _perfMiddleware.isPerfProfilingEnabled)() ? base.concat(_perfMiddleware.perfMiddleware, ...chain) : base.concat(...chain);
|
|
43
51
|
}
|
|
44
52
|
});
|
|
@@ -62,7 +70,9 @@ const persistorReady = exports.persistorReady = globalScope.__CHAT_PERSISTOR_REA
|
|
|
62
70
|
store.dispatch((0, _chatSettingsSlice.setUser)(chat.user));
|
|
63
71
|
}
|
|
64
72
|
if (rooms?.rooms) {
|
|
65
|
-
|
|
73
|
+
// Per-session state (preload progress, the API unread snapshot) must
|
|
74
|
+
// not outlive the session that produced it.
|
|
75
|
+
const restored = Object.values((0, _persistence.resetSessionRoomState)(rooms.rooms)).filter(room => !!room && !!room.jid);
|
|
66
76
|
if (restored.length) {
|
|
67
77
|
store.dispatch((0, _roomsSlice.addRooms)({
|
|
68
78
|
rooms: restored
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_toolkit","require","_chatSettingsSlice","_interopRequireWildcard","_roomsSlice","_roomHeapSlice","_callSlice","_interopRequireDefault","_unreadMidlleware","_logoutMiddleware","_newMessageMidlleware","_reactionsMiddleware","_perfMiddleware","_persistence","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","rootReducer","combineReducers","chatSettingStore","chatSettingsReducer","rooms","roomsSlice","roomHeapSlice","reducer","callReducer","createChatStore","configureStore","middleware","getDefaultMiddleware","base","serializableCheck","immutableCheck","chain","unreadMiddleware","newMessageMidlleware","reactionsMiddleware","logoutMiddleware","persistenceMiddleware","isPerfProfilingEnabled","concat","perfMiddleware","globalScope","globalThis","store","exports","__CHAT_STORE__","getActiveRoom","state","roomMessagesState","activeRoomJID","persistorReady","__CHAT_PERSISTOR_READY__","chat","heap","readPersistedState","user","walletAddress","dispatch","setUser","restored","
|
|
1
|
+
{"version":3,"names":["_toolkit","require","_chatSettingsSlice","_interopRequireWildcard","_roomsSlice","_roomHeapSlice","_callSlice","_interopRequireDefault","_unreadMidlleware","_logoutMiddleware","_newMessageMidlleware","_reactionsMiddleware","_jumpThreadMiddleware","_perfMiddleware","_persistence","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","rootReducer","combineReducers","chatSettingStore","chatSettingsReducer","rooms","roomsSlice","roomHeapSlice","reducer","callReducer","createChatStore","configureStore","middleware","getDefaultMiddleware","base","serializableCheck","immutableCheck","chain","unreadMiddleware","newMessageMidlleware","reactionsMiddleware","jumpThreadMiddleware","logoutMiddleware","persistenceMiddleware","isPerfProfilingEnabled","concat","perfMiddleware","globalScope","globalThis","store","exports","__CHAT_STORE__","getActiveRoom","state","roomMessagesState","activeRoomJID","persistorReady","__CHAT_PERSISTOR_READY__","chat","heap","readPersistedState","user","walletAddress","dispatch","setUser","restored","values","resetSessionRoomState","filter","room","jid","length","addRooms","restoredFailed","failedMessages","payload","stillRendered","roomJID","messages","some","m","id","markMessageFailed","bootFailures","computeBootTimeFailures"],"sourceRoot":"../../../src","sources":["roomStore/index.ts"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAb,OAAA;AAKuB,SAAAM,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAY,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iB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