@ethora/chat-component-rn 26.8.5 → 26.8.7
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 +26 -0
- package/README.md +95 -0
- package/lib/commonjs/assets/emojiData.js +40 -0
- package/lib/commonjs/assets/emojiData.js.map +1 -0
- package/lib/commonjs/assets/icons.js +5 -3
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +35 -15
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +33 -24
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +22 -16
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/EncryptedSendNotice.js +47 -0
- package/lib/commonjs/components/MainComponents/EncryptedSendNotice.js.map +1 -0
- package/lib/commonjs/components/MainComponents/EncryptionCard.js +286 -0
- package/lib/commonjs/components/MainComponents/EncryptionCard.js.map +1 -0
- package/lib/commonjs/components/MainComponents/MediaMessage.js +7 -0
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +4 -12
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +110 -35
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +5 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +32 -29
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomStack.js +133 -65
- package/lib/commonjs/components/MainComponents/RoomStack.js.map +1 -1
- package/lib/commonjs/components/MainComponents/SealedAttachment.js +231 -0
- package/lib/commonjs/components/MainComponents/SealedAttachment.js.map +1 -0
- package/lib/commonjs/components/MainComponents/SystemMessage.js +6 -2
- package/lib/commonjs/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Avatar.js +5 -1
- package/lib/commonjs/components/MessageBubble/Avatar.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +18 -21
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/EmojiPickerSheet.js +447 -0
- package/lib/commonjs/components/MessageBubble/EmojiPickerSheet.js.map +1 -0
- package/lib/commonjs/components/MessageBubble/Message.js +264 -136
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +215 -13
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReaction.js +113 -94
- package/lib/commonjs/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageReply.js +66 -24
- package/lib/commonjs/components/MessageBubble/MessageReply.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +7 -4
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +159 -16
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +4 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/SwipeBackLayer.js +76 -44
- package/lib/commonjs/components/Modals/Modal/SwipeBackLayer.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +29 -6
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +5 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +37 -13
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/LastMessageItem.js +6 -0
- package/lib/commonjs/components/RoomComponents/LastMessageItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js +2 -2
- package/lib/commonjs/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageEmoji.js +8 -9
- package/lib/commonjs/components/RoomComponents/styled/LastMessageEmoji.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +4 -6
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +2 -2
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageSealed.js +41 -0
- package/lib/commonjs/components/RoomComponents/styled/LastMessageSealed.js.map +1 -0
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +2 -2
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/Thread/ThreadWrapper.js +273 -152
- package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/commonjs/components/UsersList/UsersList.js +2 -1
- package/lib/commonjs/components/UsersList/UsersList.js.map +1 -1
- package/lib/commonjs/components/styled/DateLabel.js +6 -3
- package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +4 -2
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/context/MessageNotificationContext.js +188 -9
- package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +22 -7
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/e2ee/crypto.js +207 -0
- package/lib/commonjs/e2ee/crypto.js.map +1 -0
- package/lib/commonjs/e2ee/deviceStore.js +84 -0
- package/lib/commonjs/e2ee/deviceStore.js.map +1 -0
- package/lib/commonjs/e2ee/fileCipher.js +95 -0
- package/lib/commonjs/e2ee/fileCipher.js.map +1 -0
- package/lib/commonjs/e2ee/fileEnvelope.js +79 -0
- package/lib/commonjs/e2ee/fileEnvelope.js.map +1 -0
- package/lib/commonjs/e2ee/index.js +210 -0
- package/lib/commonjs/e2ee/index.js.map +1 -0
- package/lib/commonjs/e2ee/limits.js +9 -0
- package/lib/commonjs/e2ee/limits.js.map +1 -0
- package/lib/commonjs/e2ee/ns.js +8 -0
- package/lib/commonjs/e2ee/ns.js.map +1 -0
- package/lib/commonjs/e2ee/omemo.js +622 -0
- package/lib/commonjs/e2ee/omemo.js.map +1 -0
- package/lib/commonjs/e2ee/protobuf.js +149 -0
- package/lib/commonjs/e2ee/protobuf.js.map +1 -0
- package/lib/commonjs/e2ee/ratchet.js +238 -0
- package/lib/commonjs/e2ee/ratchet.js.map +1 -0
- package/lib/commonjs/e2ee/sealedBody.js +23 -0
- package/lib/commonjs/e2ee/sealedBody.js.map +1 -0
- package/lib/commonjs/e2ee/sealedFiles.js +174 -0
- package/lib/commonjs/e2ee/sealedFiles.js.map +1 -0
- package/lib/commonjs/e2ee/send.js +54 -0
- package/lib/commonjs/e2ee/send.js.map +1 -0
- package/lib/commonjs/e2ee/stanza.js +114 -0
- package/lib/commonjs/e2ee/stanza.js.map +1 -0
- package/lib/commonjs/e2ee/store.js +43 -0
- package/lib/commonjs/e2ee/store.js.map +1 -0
- package/lib/commonjs/helpers/accountName.js +23 -0
- package/lib/commonjs/helpers/accountName.js.map +1 -0
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -4
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/createRoomFromApi.js +36 -2
- package/lib/commonjs/helpers/createRoomFromApi.js.map +1 -1
- package/lib/commonjs/helpers/createUserNameFromSetUser.js +2 -1
- package/lib/commonjs/helpers/createUserNameFromSetUser.js.map +1 -1
- package/lib/commonjs/helpers/displayName.js +16 -0
- package/lib/commonjs/helpers/displayName.js.map +1 -0
- package/lib/commonjs/helpers/emoji.js +51 -0
- package/lib/commonjs/helpers/emoji.js.map +1 -0
- package/lib/commonjs/helpers/haptics.js +29 -0
- package/lib/commonjs/helpers/haptics.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +32 -66
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +21 -12
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/mamReactions.js +57 -0
- package/lib/commonjs/helpers/mamReactions.js.map +1 -0
- package/lib/commonjs/helpers/parseMessageReference.js +42 -0
- package/lib/commonjs/helpers/parseMessageReference.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +5 -0
- package/lib/commonjs/helpers/persistCrypto.js.map +1 -1
- package/lib/commonjs/helpers/reactionsConfig.js +17 -0
- package/lib/commonjs/helpers/reactionsConfig.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +20 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -1
- package/lib/commonjs/helpers/updateMessagesTillLast.js +17 -2
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/helpers/videoCache.js +136 -0
- package/lib/commonjs/helpers/videoCache.js.map +1 -0
- package/lib/commonjs/hooks/useHeapSender.js +3 -1
- package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +8 -0
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/useMessageHeapState.js +3 -2
- package/lib/commonjs/hooks/useMessageHeapState.js.map +1 -1
- package/lib/commonjs/hooks/useRoomInitialization.js +16 -7
- package/lib/commonjs/hooks/useRoomInitialization.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +85 -15
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +180 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +13 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +4 -1
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +111 -17
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +106 -50
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js +29 -74
- package/lib/commonjs/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +44 -0
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/mamRouter.js +186 -0
- package/lib/commonjs/networking/xmpp/mamRouter.js.map +1 -0
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +41 -4
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js +16 -3
- package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +13 -6
- package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +14 -6
- package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +104 -23
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/newMessageMidlleware.js +29 -34
- package/lib/commonjs/roomStore/Middleware/newMessageMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/perfMiddleware.js +51 -0
- package/lib/commonjs/roomStore/Middleware/perfMiddleware.js.map +1 -0
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js +66 -43
- package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +88 -68
- package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +18 -14
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistBackend.js +93 -0
- package/lib/commonjs/roomStore/persistBackend.js.map +1 -0
- package/lib/commonjs/roomStore/persistence.js +253 -51
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +282 -136
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/theme/theme.js +3 -0
- package/lib/commonjs/theme/theme.js.map +1 -1
- package/lib/commonjs/utils/devLogger.js +14 -0
- package/lib/commonjs/utils/devLogger.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/emojiData.js +36 -0
- package/lib/module/assets/emojiData.js.map +1 -0
- package/lib/module/assets/icons.js +4 -2
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +37 -17
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +34 -25
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +23 -17
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/EncryptedSendNotice.js +42 -0
- package/lib/module/components/MainComponents/EncryptedSendNotice.js.map +1 -0
- package/lib/module/components/MainComponents/EncryptionCard.js +281 -0
- package/lib/module/components/MainComponents/EncryptionCard.js.map +1 -0
- package/lib/module/components/MainComponents/MediaMessage.js +7 -0
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +7 -14
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +110 -35
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +5 -0
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +32 -29
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MainComponents/RoomStack.js +131 -63
- package/lib/module/components/MainComponents/RoomStack.js.map +1 -1
- package/lib/module/components/MainComponents/SealedAttachment.js +224 -0
- package/lib/module/components/MainComponents/SealedAttachment.js.map +1 -0
- package/lib/module/components/MainComponents/SystemMessage.js +6 -2
- package/lib/module/components/MainComponents/SystemMessage.js.map +1 -1
- package/lib/module/components/MessageBubble/Avatar.js +5 -1
- package/lib/module/components/MessageBubble/Avatar.js.map +1 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js +19 -22
- package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/module/components/MessageBubble/EmojiPickerSheet.js +438 -0
- package/lib/module/components/MessageBubble/EmojiPickerSheet.js.map +1 -0
- package/lib/module/components/MessageBubble/Message.js +269 -140
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +217 -15
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReaction.js +115 -94
- package/lib/module/components/MessageBubble/MessageReaction.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageReply.js +65 -24
- package/lib/module/components/MessageBubble/MessageReply.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +7 -4
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +161 -18
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +4 -0
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/SwipeBackLayer.js +76 -44
- package/lib/module/components/Modals/Modal/SwipeBackLayer.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +32 -8
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +4 -0
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +37 -13
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/LastMessageItem.js +6 -0
- package/lib/module/components/RoomComponents/LastMessageItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js +2 -2
- package/lib/module/components/RoomComponents/styled/LastAudioMessage.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageEmoji.js +8 -9
- package/lib/module/components/RoomComponents/styled/LastMessageEmoji.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +4 -6
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +2 -2
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageSealed.js +36 -0
- package/lib/module/components/RoomComponents/styled/LastMessageSealed.js.map +1 -0
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +2 -2
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/Thread/ThreadWrapper.js +273 -153
- package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
- package/lib/module/components/UsersList/UsersList.js +2 -1
- package/lib/module/components/UsersList/UsersList.js.map +1 -1
- package/lib/module/components/styled/DateLabel.js +6 -3
- package/lib/module/components/styled/DateLabel.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +4 -2
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/context/MessageNotificationContext.js +190 -11
- package/lib/module/context/MessageNotificationContext.js.map +1 -1
- package/lib/module/context/xmppProvider.js +22 -7
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/e2ee/crypto.js +170 -0
- package/lib/module/e2ee/crypto.js.map +1 -0
- package/lib/module/e2ee/deviceStore.js +77 -0
- package/lib/module/e2ee/deviceStore.js.map +1 -0
- package/lib/module/e2ee/fileCipher.js +90 -0
- package/lib/module/e2ee/fileCipher.js.map +1 -0
- package/lib/module/e2ee/fileEnvelope.js +66 -0
- package/lib/module/e2ee/fileEnvelope.js.map +1 -0
- package/lib/module/e2ee/index.js +185 -0
- package/lib/module/e2ee/index.js.map +1 -0
- package/lib/module/e2ee/limits.js +5 -0
- package/lib/module/e2ee/limits.js.map +1 -0
- package/lib/module/e2ee/ns.js +4 -0
- package/lib/module/e2ee/ns.js.map +1 -0
- package/lib/module/e2ee/omemo.js +610 -0
- package/lib/module/e2ee/omemo.js.map +1 -0
- package/lib/module/e2ee/protobuf.js +140 -0
- package/lib/module/e2ee/protobuf.js.map +1 -0
- package/lib/module/e2ee/ratchet.js +228 -0
- package/lib/module/e2ee/ratchet.js.map +1 -0
- package/lib/module/e2ee/sealedBody.js +19 -0
- package/lib/module/e2ee/sealedBody.js.map +1 -0
- package/lib/module/e2ee/sealedFiles.js +154 -0
- package/lib/module/e2ee/sealedFiles.js.map +1 -0
- package/lib/module/e2ee/send.js +48 -0
- package/lib/module/e2ee/send.js.map +1 -0
- package/lib/module/e2ee/stanza.js +107 -0
- package/lib/module/e2ee/stanza.js.map +1 -0
- package/lib/module/e2ee/store.js +35 -0
- package/lib/module/e2ee/store.js.map +1 -0
- package/lib/module/helpers/accountName.js +18 -0
- package/lib/module/helpers/accountName.js.map +1 -0
- package/lib/module/helpers/createMessageFromXml.js +19 -4
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/createRoomFromApi.js +36 -2
- package/lib/module/helpers/createRoomFromApi.js.map +1 -1
- package/lib/module/helpers/createUserNameFromSetUser.js +3 -1
- package/lib/module/helpers/createUserNameFromSetUser.js.map +1 -1
- package/lib/module/helpers/displayName.js +11 -0
- package/lib/module/helpers/displayName.js.map +1 -0
- package/lib/module/helpers/emoji.js +44 -0
- package/lib/module/helpers/emoji.js.map +1 -0
- package/lib/module/helpers/haptics.js +24 -0
- package/lib/module/helpers/haptics.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +32 -66
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +21 -12
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/mamReactions.js +51 -0
- package/lib/module/helpers/mamReactions.js.map +1 -0
- package/lib/module/helpers/parseMessageReference.js +37 -0
- package/lib/module/helpers/parseMessageReference.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +4 -0
- package/lib/module/helpers/persistCrypto.js.map +1 -1
- package/lib/module/helpers/reactionsConfig.js +10 -0
- package/lib/module/helpers/reactionsConfig.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +19 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -1
- package/lib/module/helpers/updateMessagesTillLast.js +17 -2
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/helpers/videoCache.js +125 -0
- package/lib/module/helpers/videoCache.js.map +1 -0
- package/lib/module/hooks/useHeapSender.js +3 -1
- package/lib/module/hooks/useHeapSender.js.map +1 -1
- package/lib/module/hooks/useLogout.js +8 -0
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/useMessageHeapState.js +3 -2
- package/lib/module/hooks/useMessageHeapState.js.map +1 -1
- package/lib/module/hooks/useRoomInitialization.js +17 -8
- package/lib/module/hooks/useRoomInitialization.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +85 -15
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +180 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +1 -0
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +4 -1
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +109 -18
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +107 -51
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/getHistory.xmpp.js +29 -74
- package/lib/module/networking/xmpp/getHistory.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js +42 -0
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/mamRouter.js +175 -0
- package/lib/module/networking/xmpp/mamRouter.js.map +1 -0
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +38 -2
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js +16 -3
- package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +13 -6
- package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +14 -6
- package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +105 -24
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/Middleware/newMessageMidlleware.js +29 -34
- package/lib/module/roomStore/Middleware/newMessageMidlleware.js.map +1 -1
- package/lib/module/roomStore/Middleware/perfMiddleware.js +45 -0
- package/lib/module/roomStore/Middleware/perfMiddleware.js.map +1 -0
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js +66 -43
- package/lib/module/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
- package/lib/module/roomStore/Middleware/unreadMidlleware.js +89 -69
- package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
- package/lib/module/roomStore/index.js +19 -15
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistBackend.js +86 -0
- package/lib/module/roomStore/persistBackend.js.map +1 -0
- package/lib/module/roomStore/persistence.js +253 -49
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +275 -134
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/theme/theme.js +3 -0
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/utils/devLogger.js +13 -0
- package/lib/module/utils/devLogger.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/emojiData.d.ts +8 -0
- package/lib/typescript/assets/emojiData.d.ts.map +1 -0
- package/lib/typescript/assets/icons.d.ts +8 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/EncryptedSendNotice.d.ts +4 -0
- package/lib/typescript/components/MainComponents/EncryptedSendNotice.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/EncryptionCard.d.ts +10 -0
- package/lib/typescript/components/MainComponents/EncryptionCard.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts +2 -2
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- 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/MainComponents/RoomStack.d.ts +7 -2
- package/lib/typescript/components/MainComponents/RoomStack.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/SealedAttachment.d.ts +13 -0
- package/lib/typescript/components/MainComponents/SealedAttachment.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/SystemMessage.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Avatar.d.ts +2 -0
- package/lib/typescript/components/MessageBubble/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/EmojiPickerSheet.d.ts +11 -0
- package/lib/typescript/components/MessageBubble/EmojiPickerSheet.d.ts.map +1 -0
- package/lib/typescript/components/MessageBubble/Message.d.ts +2 -2
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +2 -0
- package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReaction.d.ts +1 -0
- package/lib/typescript/components/MessageBubble/MessageReaction.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageReply.d.ts +7 -7
- package/lib/typescript/components/MessageBubble/MessageReply.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/SwipeBackLayer.d.ts +2 -1
- package/lib/typescript/components/Modals/Modal/SwipeBackLayer.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts +2 -2
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/LastMessageItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastAudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageEmoji.d.ts +3 -6
- package/lib/typescript/components/RoomComponents/styled/LastMessageEmoji.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageSealed.d.ts +7 -0
- package/lib/typescript/components/RoomComponents/styled/LastMessageSealed.d.ts.map +1 -0
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts +7 -1
- package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
- package/lib/typescript/components/UsersList/UsersList.d.ts.map +1 -1
- package/lib/typescript/components/styled/DateLabel.d.ts +1 -0
- package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts +1 -0
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/context/MessageNotificationContext.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/e2ee/crypto.d.ts +28 -0
- package/lib/typescript/e2ee/crypto.d.ts.map +1 -0
- package/lib/typescript/e2ee/deviceStore.d.ts +4 -0
- package/lib/typescript/e2ee/deviceStore.d.ts.map +1 -0
- package/lib/typescript/e2ee/fileCipher.d.ts +7 -0
- package/lib/typescript/e2ee/fileCipher.d.ts.map +1 -0
- package/lib/typescript/e2ee/fileEnvelope.d.ts +27 -0
- package/lib/typescript/e2ee/fileEnvelope.d.ts.map +1 -0
- package/lib/typescript/e2ee/index.d.ts +23 -0
- package/lib/typescript/e2ee/index.d.ts.map +1 -0
- package/lib/typescript/e2ee/limits.d.ts +3 -0
- package/lib/typescript/e2ee/limits.d.ts.map +1 -0
- package/lib/typescript/e2ee/ns.d.ts +2 -0
- package/lib/typescript/e2ee/ns.d.ts.map +1 -0
- package/lib/typescript/e2ee/omemo.d.ts +64 -0
- package/lib/typescript/e2ee/omemo.d.ts.map +1 -0
- package/lib/typescript/e2ee/protobuf.d.ts +25 -0
- package/lib/typescript/e2ee/protobuf.d.ts.map +1 -0
- package/lib/typescript/e2ee/ratchet.d.ts +39 -0
- package/lib/typescript/e2ee/ratchet.d.ts.map +1 -0
- package/lib/typescript/e2ee/sealedBody.d.ts +2 -0
- package/lib/typescript/e2ee/sealedBody.d.ts.map +1 -0
- package/lib/typescript/e2ee/sealedFiles.d.ts +31 -0
- package/lib/typescript/e2ee/sealedFiles.d.ts.map +1 -0
- package/lib/typescript/e2ee/send.d.ts +6 -0
- package/lib/typescript/e2ee/send.d.ts.map +1 -0
- package/lib/typescript/e2ee/stanza.d.ts +8 -0
- package/lib/typescript/e2ee/stanza.d.ts.map +1 -0
- package/lib/typescript/e2ee/store.d.ts +16 -0
- package/lib/typescript/e2ee/store.d.ts.map +1 -0
- package/lib/typescript/helpers/accountName.d.ts +7 -0
- package/lib/typescript/helpers/accountName.d.ts.map +1 -0
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/createRoomFromApi.d.ts.map +1 -1
- package/lib/typescript/helpers/createUserNameFromSetUser.d.ts.map +1 -1
- package/lib/typescript/helpers/displayName.d.ts +2 -0
- package/lib/typescript/helpers/displayName.d.ts.map +1 -0
- package/lib/typescript/helpers/emoji.d.ts +6 -0
- package/lib/typescript/helpers/emoji.d.ts.map +1 -0
- package/lib/typescript/helpers/haptics.d.ts +3 -0
- package/lib/typescript/helpers/haptics.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/mamReactions.d.ts +13 -0
- package/lib/typescript/helpers/mamReactions.d.ts.map +1 -0
- package/lib/typescript/helpers/parseMessageReference.d.ts +16 -0
- package/lib/typescript/helpers/parseMessageReference.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts.map +1 -1
- package/lib/typescript/helpers/reactionsConfig.d.ts +5 -0
- package/lib/typescript/helpers/reactionsConfig.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +4 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -1
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/helpers/videoCache.d.ts +19 -0
- package/lib/typescript/helpers/videoCache.d.ts.map +1 -0
- package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/useMessageHeapState.d.ts.map +1 -1
- package/lib/typescript/hooks/useRoomInitialization.d.ts +2 -2
- package/lib/typescript/hooks/useRoomInitialization.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/main.d.ts +2 -0
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +4 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts +22 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts +4 -2
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts +3 -1
- package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts +1 -0
- package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/mamRouter.d.ts +23 -0
- package/lib/typescript/networking/xmpp/mamRouter.d.ts.map +1 -0
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts +1 -0
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- 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 +22 -1
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/newMessageMidlleware.d.ts.map +1 -1
- package/lib/typescript/roomStore/Middleware/perfMiddleware.d.ts +4 -0
- package/lib/typescript/roomStore/Middleware/perfMiddleware.d.ts.map +1 -0
- package/lib/typescript/roomStore/Middleware/reactionsMiddleware.d.ts +9 -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/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistBackend.d.ts +11 -0
- package/lib/typescript/roomStore/persistBackend.d.ts.map +1 -0
- package/lib/typescript/roomStore/persistence.d.ts +5 -6
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +41 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/theme/theme.d.ts +4 -1
- package/lib/typescript/theme/theme.d.ts.map +1 -1
- package/lib/typescript/types/models/message.model.d.ts +9 -0
- package/lib/typescript/types/models/message.model.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +21 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/models/xmpp.model.d.ts +6 -1
- package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +19 -3
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/utils/devLogger.d.ts +8 -0
- package/lib/typescript/utils/devLogger.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +14 -1
- package/src/assets/emojiData.ts +2146 -0
- package/src/assets/icons.tsx +32 -5
- package/src/components/MainComponents/ChatHeader.tsx +46 -16
- package/src/components/MainComponents/ChatRoom.tsx +46 -30
- package/src/components/MainComponents/ChatWrapper.tsx +28 -10
- package/src/components/MainComponents/EncryptedSendNotice.tsx +35 -0
- package/src/components/MainComponents/EncryptionCard.tsx +287 -0
- package/src/components/MainComponents/MediaMessage.tsx +5 -0
- package/src/components/MainComponents/MessageContainer.tsx +7 -15
- package/src/components/MainComponents/MessageList.tsx +96 -43
- package/src/components/MainComponents/ReduxWrapper.tsx +5 -0
- package/src/components/MainComponents/RoomList.tsx +28 -29
- package/src/components/MainComponents/RoomStack.tsx +156 -83
- package/src/components/MainComponents/SealedAttachment.tsx +251 -0
- package/src/components/MainComponents/SystemMessage.tsx +6 -2
- package/src/components/MessageBubble/Avatar.tsx +7 -1
- package/src/components/MessageBubble/BottomReplyContainer.tsx +20 -21
- package/src/components/MessageBubble/EmojiPickerSheet.tsx +468 -0
- package/src/components/MessageBubble/Message.tsx +242 -93
- package/src/components/MessageBubble/MessageInteractions.tsx +215 -15
- package/src/components/MessageBubble/MessageReaction.tsx +120 -96
- package/src/components/MessageBubble/MessageReply.tsx +65 -32
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +7 -4
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +181 -35
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +4 -0
- package/src/components/Modals/Modal/SwipeBackLayer.tsx +114 -63
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +53 -8
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +5 -0
- package/src/components/RoomComponents/ChatRoomItem.tsx +34 -15
- package/src/components/RoomComponents/LastMessageItem.tsx +5 -0
- package/src/components/RoomComponents/styled/LastAudioMessage.tsx +3 -1
- package/src/components/RoomComponents/styled/LastMessageEmoji.tsx +7 -8
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +2 -2
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +1 -1
- package/src/components/RoomComponents/styled/LastMessageSealed.tsx +31 -0
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +1 -1
- package/src/components/Thread/ThreadWrapper.tsx +287 -198
- package/src/components/UsersList/UsersList.tsx +2 -1
- package/src/components/styled/DateLabel.tsx +7 -3
- package/src/components/styled/SendInput.tsx +5 -2
- package/src/context/MessageNotificationContext.tsx +205 -7
- package/src/context/xmppProvider.tsx +29 -9
- package/src/e2ee/crypto.ts +194 -0
- package/src/e2ee/deviceStore.ts +80 -0
- package/src/e2ee/fileCipher.ts +86 -0
- package/src/e2ee/fileEnvelope.ts +115 -0
- package/src/e2ee/index.ts +192 -0
- package/src/e2ee/limits.ts +2 -0
- package/src/e2ee/ns.ts +1 -0
- package/src/e2ee/omemo.ts +802 -0
- package/src/e2ee/protobuf.ts +188 -0
- package/src/e2ee/ratchet.ts +271 -0
- package/src/e2ee/sealedBody.ts +17 -0
- package/src/e2ee/sealedFiles.ts +181 -0
- package/src/e2ee/send.ts +70 -0
- package/src/e2ee/stanza.ts +133 -0
- package/src/e2ee/store.ts +54 -0
- package/src/helpers/accountName.ts +15 -0
- package/src/helpers/createMessageFromXml.ts +31 -6
- package/src/helpers/createRoomFromApi.tsx +37 -1
- package/src/helpers/createUserNameFromSetUser.ts +2 -1
- package/src/helpers/displayName.ts +9 -0
- package/src/helpers/emoji.ts +39 -0
- package/src/helpers/haptics.ts +19 -0
- package/src/helpers/historyPreloadScheduler.ts +37 -69
- package/src/helpers/insertMessageWithDelimiter.ts +23 -16
- package/src/helpers/mamReactions.ts +59 -0
- package/src/helpers/parseMessageReference.ts +38 -0
- package/src/helpers/persistCrypto.ts +5 -0
- package/src/helpers/reactionsConfig.ts +13 -0
- package/src/helpers/secureKeyValue.ts +15 -0
- package/src/helpers/updateMessagesTillLast.tsx +14 -2
- package/src/helpers/videoCache.ts +138 -0
- package/src/hooks/useHeapSender.tsx +3 -2
- package/src/hooks/useLogout.tsx +9 -0
- package/src/hooks/useMessageHeapState.tsx +6 -2
- package/src/hooks/useRoomInitialization.tsx +32 -15
- package/src/hooks/useSendMessage.tsx +89 -16
- package/src/hooks/useUnreadMessagesCounter.ts +1 -1
- package/src/i18n/strings.ts +180 -0
- package/src/main.ts +2 -0
- package/src/networking/api-requests/auth.api.ts +9 -1
- package/src/networking/api-requests/rooms.api.ts +121 -18
- package/src/networking/stanzaHandlers.ts +116 -60
- package/src/networking/xmpp/getHistory.xmpp.ts +44 -106
- package/src/networking/xmpp/handleStanzas.xmpp.ts +51 -0
- package/src/networking/xmpp/mamRouter.ts +176 -0
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +46 -3
- package/src/networking/xmpp/sendMediaMessage.xmpp.ts +19 -1
- package/src/networking/xmpp/sendTextMessage.xmpp.ts +17 -10
- package/src/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.ts +23 -10
- package/src/networking/xmppClient.ts +111 -20
- package/src/roomStore/Middleware/newMessageMidlleware.tsx +35 -38
- package/src/roomStore/Middleware/perfMiddleware.ts +50 -0
- package/src/roomStore/Middleware/reactionsMiddleware.tsx +53 -52
- package/src/roomStore/Middleware/unreadMidlleware.tsx +92 -80
- package/src/roomStore/index.ts +28 -27
- package/src/roomStore/persistBackend.ts +93 -0
- package/src/roomStore/persistence.ts +295 -73
- package/src/roomStore/roomsSlice.ts +304 -155
- package/src/theme/theme.ts +10 -1
- package/src/types/models/message.model.ts +9 -0
- package/src/types/models/room.model.ts +22 -0
- package/src/types/models/xmpp.model.ts +4 -2
- package/src/types/types.ts +19 -3
- package/src/utils/devLogger.ts +16 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sendEncrypted = sendEncrypted;
|
|
7
|
+
exports.sendSealedMedia = sendSealedMedia;
|
|
8
|
+
exports.shouldEncrypt = shouldEncrypt;
|
|
9
|
+
var _index = require("./index");
|
|
10
|
+
function shouldEncrypt(roomJID) {
|
|
11
|
+
return (0, _index.isE2eeEnabled)() && (0, _index.isE2eeRoom)(roomJID);
|
|
12
|
+
}
|
|
13
|
+
let queue = Promise.resolve();
|
|
14
|
+
function sendEncrypted(client, roomJID, id, data, body, plain) {
|
|
15
|
+
queue = queue.then(async () => {
|
|
16
|
+
let stanza = plain;
|
|
17
|
+
try {
|
|
18
|
+
const crypto = await (0, _index.omemoReady)();
|
|
19
|
+
if (!crypto) {
|
|
20
|
+
throw new Error('omemo_not_ready');
|
|
21
|
+
}
|
|
22
|
+
const recipients = await (0, _index.resolveRecipients)(roomJID, (0, _index.accountDomain)(client));
|
|
23
|
+
stanza = await crypto.encryptGroupMessage(roomJID, recipients, [body], id, [data]);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
const reason = String(error?.message || error);
|
|
26
|
+
if (reason.startsWith('omemo_members_unknown')) {
|
|
27
|
+
console.warn(`OMEMO: not sending to ${roomJID} - ${reason}`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
console.warn(`OMEMO: sending to ${roomJID} in clear - ${reason}`);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
await client.send(stanza);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('An error occurred while sending message:', error);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function sendSealedMedia(client, roomJID, id, body, cleartext) {
|
|
40
|
+
queue = queue.then(async () => {
|
|
41
|
+
try {
|
|
42
|
+
const crypto = await (0, _index.omemoReady)();
|
|
43
|
+
if (!crypto) {
|
|
44
|
+
throw new Error('omemo_not_ready');
|
|
45
|
+
}
|
|
46
|
+
const recipients = await (0, _index.resolveRecipients)(roomJID, (0, _index.accountDomain)(client));
|
|
47
|
+
const stanza = await crypto.encryptGroupMessage(roomJID, recipients, [body], id, cleartext);
|
|
48
|
+
await client.send(stanza);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error(`OMEMO: refusing to send sealed attachment to ${roomJID} - ${String(error?.message || error)}`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","shouldEncrypt","roomJID","isE2eeEnabled","isE2eeRoom","queue","Promise","resolve","sendEncrypted","client","id","data","body","plain","then","stanza","crypto","omemoReady","Error","recipients","resolveRecipients","accountDomain","encryptGroupMessage","error","reason","String","message","startsWith","console","warn","send","sendSealedMedia","cleartext"],"sourceRoot":"../../../src","sources":["e2ee/send.ts"],"mappings":";;;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAQO,SAASC,aAAaA,CAACC,OAAe,EAAW;EACtD,OAAO,IAAAC,oBAAa,EAAC,CAAC,IAAI,IAAAC,iBAAU,EAACF,OAAO,CAAC;AAC/C;AAEA,IAAIG,KAAoB,GAAGC,OAAO,CAACC,OAAO,CAAC,CAAC;AAErC,SAASC,aAAaA,CAC3BC,MAAc,EACdP,OAAe,EACfQ,EAAU,EACVC,IAAa,EACbC,IAAa,EACbC,KAAc,EACR;EACNR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MAAM,EAAE;QAAC,MAAM,IAAIE,KAAK,CAAC,iBAAiB,CAAC;MAAC;MACjD,MAAMC,UAAU,GAAG,MAAM,IAAAC,wBAAiB,EAAClB,OAAO,EAAE,IAAAmB,oBAAa,EAACZ,MAAM,CAAC,CAAC;MAC1E,MAAMM,MAAM,GAAG,MAAMC,MAAM,CAACM,mBAAmB,CAACpB,OAAO,EAAEiB,UAAU,EAAE,CAACP,IAAI,CAAC,EAAEF,EAAE,EAAEsB,SAAS,CAAC;MAC3F,MAAMvB,MAAM,CAACqB,IAAI,CAACf,MAAM,CAAC;IAC3B,CAAC,CAAC,OAAOQ,KAAK,EAAE;MACdK,OAAO,CAACL,KAAK,CACX,gDAAgDrB,OAAO,MAAMuB,MAAM,CAChEF,KAAK,EAAYG,OAAO,IAAIH,KAC/B,CAAC,EACH,CAAC;IACH;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decryptStanzaInPlace = decryptStanzaInPlace;
|
|
7
|
+
exports.encryptedCarrier = encryptedCarrier;
|
|
8
|
+
exports.placeholderKey = placeholderKey;
|
|
9
|
+
exports.rewriteEncryptedStanza = rewriteEncryptedStanza;
|
|
10
|
+
var _ltx = require("ltx");
|
|
11
|
+
var _roomStore = require("../roomStore");
|
|
12
|
+
var _strings = require("../i18n/strings");
|
|
13
|
+
var _ns = require("./ns");
|
|
14
|
+
var _index = require("./index");
|
|
15
|
+
const READY_TIMEOUT_MS = 8000;
|
|
16
|
+
function encryptedCarrier(stanza, depth = 0) {
|
|
17
|
+
if (depth > 4 || !stanza?.getChild) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
if (stanza.name === 'message' && stanza.getChild('encrypted', _ns.NS_OMEMO)) {
|
|
21
|
+
return stanza;
|
|
22
|
+
}
|
|
23
|
+
for (const child of stanza.children ?? []) {
|
|
24
|
+
if (typeof child === 'string') {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const found = encryptedCarrier(child, depth + 1);
|
|
28
|
+
if (found) {
|
|
29
|
+
return found;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const PLACEHOLDER_KEY = {
|
|
35
|
+
unsupported: 'e2ee.unsupportedMessage',
|
|
36
|
+
'other-device': 'e2ee.otherDevice',
|
|
37
|
+
failed: 'e2ee.undecryptable'
|
|
38
|
+
};
|
|
39
|
+
function placeholderKey(error) {
|
|
40
|
+
return PLACEHOLDER_KEY[error] ?? PLACEHOLDER_KEY.failed;
|
|
41
|
+
}
|
|
42
|
+
function placeholder(error) {
|
|
43
|
+
const settings = _roomStore.store.getState()?.chatSettingStore;
|
|
44
|
+
return new _ltx.Element('body', {}).t((0, _strings.translateKey)(placeholderKey(error), settings?.config?.i18n?.locale || settings?.langSource, settings?.config?.i18n?.strings));
|
|
45
|
+
}
|
|
46
|
+
function mark(carrier, error) {
|
|
47
|
+
let data = carrier.getChild('data');
|
|
48
|
+
if (!data) {
|
|
49
|
+
data = new _ltx.Element('data', {});
|
|
50
|
+
carrier.append(data);
|
|
51
|
+
}
|
|
52
|
+
data.attrs.omemoEncrypted = 'true';
|
|
53
|
+
if (error) {
|
|
54
|
+
data.attrs.undecryptable = 'true';
|
|
55
|
+
data.attrs.e2eeError = error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function strip(carrier) {
|
|
59
|
+
carrier.remove('encrypted', _ns.NS_OMEMO);
|
|
60
|
+
carrier.remove('encryption', 'urn:xmpp:eme:0');
|
|
61
|
+
carrier.remove('body');
|
|
62
|
+
}
|
|
63
|
+
function close(carrier, error) {
|
|
64
|
+
strip(carrier);
|
|
65
|
+
carrier.append(placeholder(error));
|
|
66
|
+
mark(carrier, error);
|
|
67
|
+
return 'undecryptable';
|
|
68
|
+
}
|
|
69
|
+
function rewriteEncryptedStanza(stanza) {
|
|
70
|
+
const carrier = encryptedCarrier(stanza);
|
|
71
|
+
if (!carrier) {
|
|
72
|
+
return 'not-encrypted';
|
|
73
|
+
}
|
|
74
|
+
const encrypted = carrier.getChild('encrypted', _ns.NS_OMEMO);
|
|
75
|
+
if (!encrypted?.getChild('payload')) {
|
|
76
|
+
return 'drop';
|
|
77
|
+
}
|
|
78
|
+
return close(carrier, 'unsupported');
|
|
79
|
+
}
|
|
80
|
+
const waitForDevice = () => {
|
|
81
|
+
let timer;
|
|
82
|
+
const timeout = new Promise(resolve => {
|
|
83
|
+
timer = setTimeout(() => resolve(undefined), READY_TIMEOUT_MS);
|
|
84
|
+
});
|
|
85
|
+
return Promise.race([(0, _index.omemoReady)(), timeout]).finally(() => {
|
|
86
|
+
if (timer) {
|
|
87
|
+
clearTimeout(timer);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
async function decryptStanzaInPlace(stanza, domain) {
|
|
92
|
+
const carrier = encryptedCarrier(stanza);
|
|
93
|
+
if (!carrier) {
|
|
94
|
+
return 'not-encrypted';
|
|
95
|
+
}
|
|
96
|
+
const encrypted = carrier.getChild('encrypted', _ns.NS_OMEMO);
|
|
97
|
+
if (!encrypted?.getChild('payload')) {
|
|
98
|
+
return 'drop';
|
|
99
|
+
}
|
|
100
|
+
const from = String(carrier.attrs?.from || '');
|
|
101
|
+
const roomJid = from.split('/')[0];
|
|
102
|
+
const sender = (0, _index.senderJidFromMuc)(from, domain);
|
|
103
|
+
const crypto = await waitForDevice();
|
|
104
|
+
const decrypted = sender ? await crypto?.decrypt(carrier, sender, roomJid) : undefined;
|
|
105
|
+
if (!decrypted?.content) {
|
|
106
|
+
return close(carrier, decrypted?.error === 'omemo_not_encrypted_for_this_device' ? 'other-device' : 'failed');
|
|
107
|
+
}
|
|
108
|
+
strip(carrier);
|
|
109
|
+
const wrapper = (0, _ltx.parse)(`<omemo-content>${decrypted.content}</omemo-content>`);
|
|
110
|
+
carrier.append(...wrapper.children);
|
|
111
|
+
mark(carrier);
|
|
112
|
+
return 'decrypted';
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=stanza.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ltx","require","_roomStore","_strings","_ns","_index","READY_TIMEOUT_MS","encryptedCarrier","stanza","depth","getChild","undefined","name","NS_OMEMO","child","children","found","PLACEHOLDER_KEY","unsupported","failed","placeholderKey","error","placeholder","settings","store","getState","chatSettingStore","Element","t","translateKey","config","i18n","locale","langSource","strings","mark","carrier","data","append","attrs","omemoEncrypted","undecryptable","e2eeError","strip","remove","close","rewriteEncryptedStanza","encrypted","waitForDevice","timer","timeout","Promise","resolve","setTimeout","race","omemoReady","finally","clearTimeout","decryptStanzaInPlace","domain","from","String","roomJid","split","sender","senderJidFromMuc","crypto","decrypted","decrypt","content","wrapper","parse"],"sourceRoot":"../../../src","sources":["e2ee/stanza.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,GAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAaA,MAAMK,gBAAgB,GAAG,IAAI;AAEtB,SAASC,gBAAgBA,CAC9BC,MAAe,EACfC,KAAK,GAAG,CAAC,EACY;EACrB,IAAIA,KAAK,GAAG,CAAC,IAAI,CAACD,MAAM,EAAEE,QAAQ,EAAE;IAAC,OAAOC,SAAS;EAAC;EACtD,IAAIH,MAAM,CAACI,IAAI,KAAK,SAAS,IAAIJ,MAAM,CAACE,QAAQ,CAAC,WAAW,EAAEG,YAAQ,CAAC,EAAE;IACvE,OAAOL,MAAM;EACf;EACA,KAAK,MAAMM,KAAK,IAAIN,MAAM,CAACO,QAAQ,IAAI,EAAE,EAAE;IACzC,IAAI,OAAOD,KAAK,KAAK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|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createMemoryBackend = createMemoryBackend;
|
|
7
|
+
exports.createMemoryStore = createMemoryStore;
|
|
8
|
+
exports.createStore = createStore;
|
|
9
|
+
exports.decodeValue = decodeValue;
|
|
10
|
+
exports.encodeValue = encodeValue;
|
|
11
|
+
var _crypto = require("./crypto");
|
|
12
|
+
const BYTES_TAG = '$bytes';
|
|
13
|
+
function encodeValue(value) {
|
|
14
|
+
return JSON.stringify(value, (_key, item) => item instanceof Uint8Array ? {
|
|
15
|
+
[BYTES_TAG]: (0, _crypto.toBase64)(item)
|
|
16
|
+
} : item);
|
|
17
|
+
}
|
|
18
|
+
function decodeValue(text) {
|
|
19
|
+
return JSON.parse(text, (_key, item) => item && typeof item === 'object' && typeof item[BYTES_TAG] === 'string' ? (0, _crypto.fromBase64)(item[BYTES_TAG]) : item);
|
|
20
|
+
}
|
|
21
|
+
function createStore(backend, jid) {
|
|
22
|
+
const prefix = `${jid.toLowerCase()}|`;
|
|
23
|
+
return {
|
|
24
|
+
get: async key => {
|
|
25
|
+
const raw = await backend.getItem(prefix + key);
|
|
26
|
+
return raw === null ? undefined : decodeValue(raw);
|
|
27
|
+
},
|
|
28
|
+
set: (key, value) => backend.setItem(prefix + key, encodeValue(value)),
|
|
29
|
+
delete: key => backend.removeItem(prefix + key)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createMemoryBackend() {
|
|
33
|
+
const data = new Map();
|
|
34
|
+
return {
|
|
35
|
+
getItem: async key => data.get(key) ?? null,
|
|
36
|
+
setItem: async (key, value) => void data.set(key, value),
|
|
37
|
+
removeItem: async key => void data.delete(key)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function createMemoryStore(jid = 'memory') {
|
|
41
|
+
return createStore(createMemoryBackend(), jid);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_crypto","require","BYTES_TAG","encodeValue","value","JSON","stringify","_key","item","Uint8Array","toBase64","decodeValue","text","parse","fromBase64","createStore","backend","jid","prefix","toLowerCase","get","key","raw","getItem","undefined","set","setItem","delete","removeItem","createMemoryBackend","data","Map","createMemoryStore"],"sourceRoot":"../../../src","sources":["e2ee/store.ts"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAQA,MAAMC,SAAS,GAAG,QAAQ;AAEnB,SAASC,WAAWA,CAACC,KAAc,EAAU;EAClD,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,EAAE,CAACG,IAAI,EAAEC,IAAI,KACtCA,IAAI,YAAYC,UAAU,GAAG;IAAE,CAACP,SAAS,GAAG,IAAAQ,gBAAQ,EAACF,IAAI;EAAE,CAAC,GAAGA,IACjE,CAAC;AACH;AAEO,SAASG,WAAWA,CAAIC,IAAY,EAAK;EAC9C,OAAOP,IAAI,CAACQ,KAAK,CAACD,IAAI,EAAE,CAACL,IAAI,EAAEC,IAAI,KACjCA,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,CAACN,SAAS,CAAC,KAAK,QAAQ,GACnE,IAAAY,kBAAU,EAACN,IAAI,CAACN,SAAS,CAAC,CAAC,GAC3BM,IACN,CAAC;AACH;AAQO,SAASO,WAAWA,CAACC,OAAsB,EAAEC,GAAW,EAAc;EAC3E,MAAMC,MAAM,GAAG,GAAGD,GAAG,CAACE,WAAW,CAAC,CAAC,GAAG;EACtC,OAAO;IACLC,GAAG,EAAE,MAAUC,GAAW,IAAK;MAC7B,MAAMC,GAAG,GAAG,MAAMN,OAAO,CAACO,OAAO,CAACL,MAAM,GAAGG,GAAG,CAAC;MAC/C,OAAOC,GAAG,KAAK,IAAI,GAAGE,SAAS,GAAGb,WAAW,CAAIW,GAAG,CAAC;IACvD,CAAC;IACDG,GAAG,EAAEA,CAACJ,GAAG,EAAEjB,KAAK,KAAKY,OAAO,CAACU,OAAO,CAACR,MAAM,GAAGG,GAAG,EAAElB,WAAW,CAACC,KAAK,CAAC,CAAC;IACtEuB,MAAM,EAAGN,GAAG,IAAKL,OAAO,CAACY,UAAU,CAACV,MAAM,GAAGG,GAAG;EAClD,CAAC;AACH;AAEO,SAASQ,mBAAmBA,CAAA,EAAkB;EACnD,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAiB,CAAC;EACtC,OAAO;IACLR,OAAO,EAAE,MAAOF,GAAG,IAAKS,IAAI,CAACV,GAAG,CAACC,GAAG,CAAC,IAAI,IAAI;IAC7CK,OAAO,EAAE,MAAAA,CAAOL,GAAG,EAAEjB,KAAK,KAAK,KAAK0B,IAAI,CAACL,GAAG,CAACJ,GAAG,EAAEjB,KAAK,CAAC;IACxDwB,UAAU,EAAE,MAAOP,GAAG,IAAK,KAAKS,IAAI,CAACH,MAAM,CAACN,GAAG;EACjD,CAAC;AACH;AAEO,SAASW,iBAAiBA,CAACf,GAAG,GAAG,QAAQ,EAAc;EAC5D,OAAOF,WAAW,CAACc,mBAAmB,CAAC,CAAC,EAAEZ,GAAG,CAAC;AAChD","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.accountNameOf = void 0;
|
|
7
|
+
const accountNameOf = (user, appId) => {
|
|
8
|
+
for (const raw of [user?.xmppUsername, user?.userJID, user?.id, user?._id]) {
|
|
9
|
+
const value = String(raw || '').split('@')[0].trim();
|
|
10
|
+
if (!value) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (value.includes('_')) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
if (appId) {
|
|
17
|
+
return `${appId}_${value}`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return '';
|
|
21
|
+
};
|
|
22
|
+
exports.accountNameOf = accountNameOf;
|
|
23
|
+
//# sourceMappingURL=accountName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["accountNameOf","user","appId","raw","xmppUsername","userJID","id","_id","value","String","split","trim","includes","exports"],"sourceRoot":"../../../src","sources":["helpers/accountName.ts"],"mappings":";;;;;;AAAO,MAAMA,aAAa,GAAGA,CAC3BC,IAGa,EACbC,KAAa,KACF;EACX,KAAK,MAAMC,GAAG,IAAI,CAACF,IAAI,EAAEG,YAAY,EAAEH,IAAI,EAAEI,OAAO,EAAEJ,IAAI,EAAEK,EAAE,EAAEL,IAAI,EAAEM,GAAG,CAAC,EAAE;IAC1E,MAAMC,KAAK,GAAGC,MAAM,CAACN,GAAG,IAAI,EAAE,CAAC,CAACO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAEC,IAAI,CAAC,CAAC;IACrD,IAAI,CAACH,KAAK,EAAE;MAAC;IAAS;IACtB,IAAIA,KAAK,CAACI,QAAQ,CAAC,GAAG,CAAC,EAAE;MAAC,OAAOJ,KAAK;IAAC;IACvC,IAAIN,KAAK,EAAE;MAAC,OAAO,GAAGA,KAAK,IAAIM,KAAK,EAAE;IAAC;EACzC;EACA,OAAO,EAAE;AACX,CAAC;AAACK,OAAA,CAAAb,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createMessageFromXml = void 0;
|
|
7
|
+
var _e2ee = require("../e2ee");
|
|
8
|
+
var _displayName = require("./displayName");
|
|
9
|
+
var _sealedBody = require("../e2ee/sealedBody");
|
|
7
10
|
/**
|
|
8
11
|
* Build an IMessage from XML.
|
|
9
12
|
*
|
|
@@ -81,11 +84,14 @@ const createMessageFromXml = async (arg, bodyEl, positionalId, positionalFrom, p
|
|
|
81
84
|
// Synthesize user.name from sender attrs (web reads usersSet from
|
|
82
85
|
// redux in <Message>; we fix it once at the source so Avatar /
|
|
83
86
|
// MessageHeader render the actual sender instead of "??").
|
|
84
|
-
const firstName = (merged.senderFirstName || '').toString().trim();
|
|
85
|
-
const lastName = (merged.senderLastName || '').toString().trim();
|
|
87
|
+
const firstName = (merged.senderFirstName || merged.firstName || '').toString().trim();
|
|
88
|
+
const lastName = (merged.senderLastName || merged.lastName || '').toString().trim();
|
|
86
89
|
const fullName = (merged.fullName || '').toString().trim();
|
|
87
90
|
const senderJID = (merged.senderJID || '').toString();
|
|
88
|
-
const
|
|
91
|
+
const senderBare = senderJID.split('/')[0] || '';
|
|
92
|
+
const senderResource = senderJID.includes('/') ? senderJID.split('/')[1] || '' : '';
|
|
93
|
+
const senderIsOccupant = !!senderResource && (senderBare === String(merged.roomJid || '') || /@conference\./i.test(senderBare));
|
|
94
|
+
const senderLocal = senderIsOccupant ? senderResource : senderBare.includes('@') ? senderBare.split('@')[0] : senderBare;
|
|
89
95
|
|
|
90
96
|
// Bug #41 root cause: the resource of the MUC `from` (room@conference/
|
|
91
97
|
// occupant-id) is the SAME field getDataFromXml uses to derive
|
|
@@ -104,11 +110,20 @@ const createMessageFromXml = async (arg, bodyEl, positionalId, positionalFrom, p
|
|
|
104
110
|
// the "official" fetch lands.
|
|
105
111
|
const xmppFrom = (merged.xmppFrom || '').toString();
|
|
106
112
|
const fromResource = xmppFrom.includes('/') ? xmppFrom.split('/')[1] : '';
|
|
107
|
-
const composed =
|
|
113
|
+
const composed = (0, _displayName.composeName)(firstName, lastName);
|
|
108
114
|
const existingName = String(merged?.user?.name || '').trim();
|
|
109
115
|
const resolvedName = existingName || composed || fullName || senderLocal || merged?.user?.id || '';
|
|
116
|
+
const unencrypted = merged.omemoEncrypted !== 'true' && (0, _e2ee.isE2eeRoom)(String(merged.roomJid || ''));
|
|
117
|
+
const sealedKeys = merged.clientEncrypted === 'true' ? (0, _sealedBody.parseSealedMediaBody)(merged.body) : undefined;
|
|
110
118
|
const message = {
|
|
111
119
|
...merged,
|
|
120
|
+
...(unencrypted ? {
|
|
121
|
+
unencrypted: true
|
|
122
|
+
} : {}),
|
|
123
|
+
...(sealedKeys ? {
|
|
124
|
+
e2eeKeys: sealedKeys,
|
|
125
|
+
body: 'media'
|
|
126
|
+
} : {}),
|
|
112
127
|
user: {
|
|
113
128
|
...(merged.user || {}),
|
|
114
129
|
id: merged?.user?.id || fromResource || senderLocal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMessageFromXml","arg","bodyEl","positionalId","positionalFrom","positionalDeleted","console","log","id","body","date","user","name","roomJid","isPositional","undefined","inner","outerExtras","bodyText","getText","text","split","xmppFrom","deleted","data","merged","isDeleted","numericPart","exec","String","Date","slice","toISOString","now","firstName","senderFirstName","toString","trim","lastName","senderLastName","fullName","senderJID","
|
|
1
|
+
{"version":3,"names":["_e2ee","require","_displayName","_sealedBody","createMessageFromXml","arg","bodyEl","positionalId","positionalFrom","positionalDeleted","console","log","id","body","date","user","name","roomJid","isPositional","undefined","inner","outerExtras","bodyText","getText","text","split","xmppFrom","deleted","data","merged","isDeleted","numericPart","exec","String","Date","slice","toISOString","now","firstName","senderFirstName","toString","trim","lastName","senderLastName","fullName","senderJID","senderBare","senderResource","includes","senderIsOccupant","test","senderLocal","fromResource","composed","composeName","existingName","resolvedName","unencrypted","omemoEncrypted","isE2eeRoom","sealedKeys","clientEncrypted","parseSealedMediaBody","message","e2eeKeys","exports"],"sourceRoot":"../../../src","sources":["helpers/createMessageFromXml.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,oBAAoB,GAAG,MAAAA,CAClCC,GAAwB,EACxBC,MAAY,EACZC,YAAqB,EACrBC,cAA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K,MAAM,GAC7B,IAAAC,gCAAoB,EAACjC,MAAM,CAAChB,IAAI,CAAC,GACjCM,SAAS;EAEf,MAAM4C,OAAiB,GAAG;IACxB,GAAGlC,MAAM;IACT,IAAI4B,WAAW,GAAG;MAAEA,WAAW,EAAE;IAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,IAAIG,UAAU,GAAG;MAAEI,QAAQ,EAAEJ,UAAU;MAAE/C,IAAI,EAAE;IAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9DE,IAAI,EAAE;MACJ,IAAIc,MAAM,CAACd,IAAI,IAAI,CAAC,CAAC,CAAC;MACtBH,EAAE,EAAEiB,MAAM,EAAEd,IAAI,EAAEH,EAAE,IAAIwC,YAAY,IAAID,WAAW;MACnDnC,IAAI,EAAEwC,YAAY;MAClBlB,SAAS,EAAEA,SAAS,IAAIT,MAAM,EAAEd,IAAI,EAAEuB,SAAS;MAC/CI,QAAQ,EAAEA,QAAQ,IAAIb,MAAM,EAAEd,IAAI,EAAE2B;IACtC;EACF,CAAC;EAED,OAAOqB,OAAO;AAChB,CAAC;AAACE,OAAA,CAAA7D,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -4,12 +4,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createRoomFromApi = void 0;
|
|
7
|
+
const mapApiLastMessage = (apiLastMessage, roomJid) => {
|
|
8
|
+
const body = String(apiLastMessage?.body || '').trim();
|
|
9
|
+
if (!apiLastMessage || !body) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const senderName = `${apiLastMessage.senderFirstName || ''} ${apiLastMessage.senderLastName || ''}`.trim();
|
|
13
|
+
return {
|
|
14
|
+
id: apiLastMessage.messageId || apiLastMessage.stanzaId || '',
|
|
15
|
+
xmppId: apiLastMessage.stanzaId,
|
|
16
|
+
roomJid,
|
|
17
|
+
body,
|
|
18
|
+
date: apiLastMessage.createdAt,
|
|
19
|
+
isDeleted: false,
|
|
20
|
+
user: {
|
|
21
|
+
id: apiLastMessage.fromUserId || apiLastMessage.from || '',
|
|
22
|
+
name: senderName
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const seedTimestamp = seed => {
|
|
27
|
+
if (!seed) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const id = Number(seed.id);
|
|
31
|
+
if (Number.isFinite(id) && id > 0) {
|
|
32
|
+
return id;
|
|
33
|
+
}
|
|
34
|
+
const ms = seed.date ? new Date(seed.date).getTime() : NaN;
|
|
35
|
+
return Number.isFinite(ms) && ms > 0 ? ms * 1000 : undefined;
|
|
36
|
+
};
|
|
7
37
|
const createRoomFromApi = (room, service = 'conference.dev.xmpp.ethoradev.com', usersArrayLength = 0) => {
|
|
8
38
|
try {
|
|
39
|
+
const jid = `${room?.name}@${service}` || '';
|
|
40
|
+
const lastMessage = mapApiLastMessage(room?.lastMessage, jid);
|
|
9
41
|
const roomData = {
|
|
10
42
|
...room,
|
|
11
43
|
id: room?._id || '',
|
|
12
|
-
jid
|
|
44
|
+
jid,
|
|
13
45
|
name: room?.title || '',
|
|
14
46
|
title: room?.title || '',
|
|
15
47
|
usersCnt: Number(room?.members?.length || usersArrayLength + 1),
|
|
@@ -18,7 +50,9 @@ const createRoomFromApi = (room, service = 'conference.dev.xmpp.ethoradev.com',
|
|
|
18
50
|
roomBg: null,
|
|
19
51
|
icon: room?.picture !== 'none' ? room?.picture : null,
|
|
20
52
|
unreadMessages: 0,
|
|
21
|
-
lastViewedTimestamp: 0
|
|
53
|
+
lastViewedTimestamp: 0,
|
|
54
|
+
lastMessage,
|
|
55
|
+
lastMessageTimestamp: seedTimestamp(lastMessage)
|
|
22
56
|
};
|
|
23
57
|
return roomData;
|
|
24
58
|
} catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["mapApiLastMessage","apiLastMessage","roomJid","body","String","trim","undefined","senderName","senderFirstName","senderLastName","id","messageId","stanzaId","xmppId","date","createdAt","isDeleted","user","fromUserId","from","name","seedTimestamp","seed","Number","isFinite","ms","Date","getTime","NaN","createRoomFromApi","room","service","usersArrayLength","jid","lastMessage","roomData","_id","title","usersCnt","members","length","messages","isLoading","roomBg","icon","picture","unreadMessages","lastViewedTimestamp","lastMessageTimestamp","error","console","log","exports"],"sourceRoot":"../../../src","sources":["helpers/createRoomFromApi.tsx"],"mappings":";;;;;;AAGA,MAAMA,iBAAiB,GAAGA,CACxBC,cAAsC,EACtCC,OAAe,KACa;EAC5B,MAAMC,IAAI,GAAGC,MAAM,CAACH,cAAc,EAAEE,IAAI,IAAI,EAAE,CAAC,CAACE,IAAI,CAAC,CAAC;EACtD,IAAI,CAACJ,cAAc,IAAI,CAACE,IAAI,EAAE;IAAC,OAAOG,SAAS;EAAC;EAChD,MAAMC,UAAU,GAAG,GAAGN,cAAc,CAACO,eAAe,IAAI,EAAE,IACxDP,cAAc,CAACQ,cAAc,IAAI,EAAE,EACnC,CAACJ,IAAI,CAAC,CAAC;EACT,OAAO;IACLK,EAAE,EAAET,cAAc,CAACU,SAAS,IAAIV,cAAc,CAACW,QAAQ,IAAI,EAAE;IAC7DC,MAAM,EAAEZ,cAAc,CAACW,QAAQ;IAC/BV,OAAO;IACPC,IAAI;IACJW,IAAI,EAAEb,cAAc,CAACc,SAAS;IAC9BC,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAE;MACJP,EAAE,EAAET,cAAc,CAACiB,UAAU,IAAIjB,cAAc,CAACkB,IAAI,IAAI,EAAE;MAC1DC,IAAI,EAAEb;IACR;EACF,CAAC;AACH,CAAC;AAED,MAAMc,aAAa,GAAIC,IAA6B,IAAyB;EAC3E,IAAI,CAACA,IAAI,EAAE;IAAC,OAAOhB,SAAS;EAAC;EAC7B,MAAMI,EAAE,GAAGa,MAAM,CAACD,IAAI,CAACZ,EAAE,CAAC;EAC1B,IAA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,CAAC;IACD,OAAOC,QAAQ;EACjB,CAAC,CAAC,OAAOc,KAAK,EAAE;IACdC,OAAO,CAACC,GAAG,CAACF,KAAK,CAAC;IAClB,OAAO,IAAI;EACb;AACF,CAAC;AAACG,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.resolveSenderDisplayName = exports.createUserNameFromSetUser = void 0;
|
|
7
|
+
var _displayName = require("./displayName");
|
|
7
8
|
/**
|
|
8
9
|
* Cache-only lookup. Returns the literal "Deleted User" as a MISS sentinel
|
|
9
10
|
* when `usersSet` has no entry for `userId` yet, callers that want a
|
|
@@ -21,7 +22,7 @@ const createUserNameFromSetUser = (usersSet, userId) => {
|
|
|
21
22
|
// members (no REST match yet) carry just the roster `name` attr —
|
|
22
23
|
// fall back to that before giving up and returning the raw id.
|
|
23
24
|
const bareName = user.name?.trim() || '';
|
|
24
|
-
return
|
|
25
|
+
return (0, _displayName.composeName)(firstName, lastName) || bareName || userId;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createUserNameFromSetUser","usersSet","userId","user","firstName","trim","lastName","bareName","name","exports","resolveSenderDisplayName","message","rawUserId","String","id","localUserId","split","currentNameRaw","currentName","dataFullName","fullName","dataFirst","senderFirstName","dataLast","senderLastName","composedFromData","usersSetName","usersSetNameAlt","isUsersSetUseful"],"sourceRoot":"../../../src","sources":["helpers/createUserNameFromSetUser.ts"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"names":["_displayName","require","createUserNameFromSetUser","usersSet","userId","user","firstName","trim","lastName","bareName","name","composeName","exports","resolveSenderDisplayName","message","rawUserId","String","id","localUserId","split","currentNameRaw","currentName","dataFullName","fullName","dataFirst","senderFirstName","dataLast","senderLastName","composedFromData","usersSetName","usersSetNameAlt","isUsersSetUseful"],"sourceRoot":"../../../src","sources":["helpers/createUserNameFromSetUser.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,yBAAyB,GAAGA,CACvCC,QAAoC,EACpCC,MAAc,KACH;EACX,MAAMC,IAAI,GAAGF,QAAQ,CAACC,MAAM,CAAC;EAE7B,IAAI,CAACC,IAAI,EAAE;IAAC,OAAO,cAAc;EAAC;EAElC,MAAMC,SAAS,GAAGD,IAAI,CAACC,SAAS,EAAEC,IAAI,CAAC,CAAC,IAAI,EAAE;EAC9C,MAAMC,QAAQ,GAAGH,IAAI,CAACG,QAAQ,EAAED,IAAI,CAAC,CAAC,IAAI,EAAE;EAC5C;EACA;EACA;EACA,MAAME,QAAQ,GAAGJ,IAAI,CAACK,IAAI,EAAEH,IAAI,CAAC,CAAC,IAAI,EAAE;EAExC,OAAO,IAAAI,wBAAW,EAACL,SAAS,EAAEE,QAAQ,CAAC,IAAIC,QAAQ,IAAIL,MAAM;AAC/D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApBAQ,OAAA,CAAAV,yBAAA,GAAAA,yBAAA;AAqBO,MAAMW,wBAAwB,GAAGA,CACtCC,OAIC,EACDX,QAAoC,KACzB;EACX,MAAMY,SAAS,GAAGC,MAAM,CAACF,OAAO,EAAET,IAAI,EAAEY,EAAE,IAAI,EAAE,CAAC;EACjD,MAAMC,WAAW,GAAGH,SAAS,CAACI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC3C,MAAMC,cAAc,GAAGJ,MAAM,CAACF,OAAO,EAAET,IAAI,EAAEK,IAAI,IAAI,EAAE,CAAC,CAACH,IAAI,CAAC,CAAC;EAC/D;EACA;EACA,MAAMc,WAAW,GAAGD,cAAc,KAAK,cAAc,GAAG,EAAE,GAAGA,cAAc;EAE3E,MAAME,YAAY,GAAGN,MAAM,CAACF,OAAO,EAAES,QAAQ,IAAI,EAAE,CAAC,CAAChB,IAAI,CAAC,CAAC;EAC3D,MAAMiB,SAAS,GAAGR,MAAM,CAACF,OAAO,EAAEW,eAAe,IAAI,EAAE,CAAC,CAAClB,IAAI,CAAC,CAAC;EAC/D,MAAMmB,QAAQ,GAAGV,MAAM,CAACF,OAAO,EAAEa,cAAc,IAAI,EAAE,CAAC,CAACpB,IAAI,CAAC,CAAC;EAC7D,MAAMqB,gBAAgB,GAAGN,YAAY,IAAI,GAAGE,SAAS,IAAIE,QAAQ,EAAE,CAACnB,IAAI,CAAC,CAAC;EAE1E,MAAMsB,YAAY,GAAG3B,yBAAyB,CAACC,QAAQ,EAAEe,WAAW,CAAC;EACrE,MAAMY,eAAe,GAAG5B,yBAAyB,CAACC,QAAQ,EAAEY,SAAS,CAAC;EACtE,MAAMgB,gBAAgB,GAAIrB,IAAY,IAAK,CAAC,CAACA,IAAI,IAAIA,IAAI,KAAK,cAAc;EAE5E,OACEW,WAAW,IACVU,gBAAgB,CAACF,YAAY,CAAC,IAAIA,YAAa,IAC/CE,gBAAgB,CAACD,eAAe,CAAC,IAAIA,eAAgB,IACtDF,gBAAgB,IAChBV,WAAW,IACXH,SAAS,IACT,cAAc;AAElB,CAAC;AAACH,OAAA,CAAAC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.composeName = void 0;
|
|
7
|
+
const composeName = (first, last) => {
|
|
8
|
+
const f = String(first ?? '').trim();
|
|
9
|
+
const l = String(last ?? '').trim();
|
|
10
|
+
if (f && f.includes('@') && f.toLowerCase() === l.toLowerCase()) {
|
|
11
|
+
return f;
|
|
12
|
+
}
|
|
13
|
+
return `${f} ${l}`.trim();
|
|
14
|
+
};
|
|
15
|
+
exports.composeName = composeName;
|
|
16
|
+
//# sourceMappingURL=displayName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["composeName","first","last","f","String","trim","l","includes","toLowerCase","exports"],"sourceRoot":"../../../src","sources":["helpers/displayName.ts"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAGA,CACzBC,KAAqB,EACrBC,IAAoB,KACT;EACX,MAAMC,CAAC,GAAGC,MAAM,CAACH,KAAK,IAAI,EAAE,CAAC,CAACI,IAAI,CAAC,CAAC;EACpC,MAAMC,CAAC,GAAGF,MAAM,CAACF,IAAI,IAAI,EAAE,CAAC,CAACG,IAAI,CAAC,CAAC;EACnC,IAAIF,CAAC,IAAIA,CAAC,CAACI,QAAQ,CAAC,GAAG,CAAC,IAAIJ,CAAC,CAACK,WAAW,CAAC,CAAC,KAAKF,CAAC,CAACE,WAAW,CAAC,CAAC,EAAE;IAAC,OAAOL,CAAC;EAAC;EAC3E,OAAO,GAAGA,CAAC,IAAIG,CAAC,EAAE,CAACD,IAAI,CAAC,CAAC;AAC3B,CAAC;AAACI,OAAA,CAAAT,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.searchEmojis = exports.getEmojiNativeById = exports.getEmojiIdByNative = exports.DEFAULT_QUICK_REACTIONS = void 0;
|
|
7
|
+
var _emojiData = require("../assets/emojiData");
|
|
8
|
+
let byId = null;
|
|
9
|
+
const index = () => {
|
|
10
|
+
if (!byId) {
|
|
11
|
+
byId = new Map();
|
|
12
|
+
for (const category of _emojiData.EMOJI_CATEGORIES) {
|
|
13
|
+
for (const entry of category.emojis) {
|
|
14
|
+
byId.set(entry[0], entry);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return byId;
|
|
19
|
+
};
|
|
20
|
+
const getEmojiNativeById = id => index().get(id)?.[1] ?? id;
|
|
21
|
+
exports.getEmojiNativeById = getEmojiNativeById;
|
|
22
|
+
const getEmojiIdByNative = native => {
|
|
23
|
+
for (const [id, entry] of index()) {
|
|
24
|
+
if (entry[1] === native) {
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
30
|
+
exports.getEmojiIdByNative = getEmojiIdByNative;
|
|
31
|
+
const DEFAULT_QUICK_REACTIONS = exports.DEFAULT_QUICK_REACTIONS = ['+1', 'heart', 'joy', 'open_mouth', 'cry', 'pray'];
|
|
32
|
+
const searchEmojis = (query, limit = 60) => {
|
|
33
|
+
const q = query.trim().toLowerCase();
|
|
34
|
+
if (!q) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const category of _emojiData.EMOJI_CATEGORIES) {
|
|
39
|
+
for (const entry of category.emojis) {
|
|
40
|
+
if (entry[0].includes(q) || entry[2].includes(q)) {
|
|
41
|
+
out.push(entry);
|
|
42
|
+
if (out.length >= limit) {
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
};
|
|
50
|
+
exports.searchEmojis = searchEmojis;
|
|
51
|
+
//# sourceMappingURL=emoji.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_emojiData","require","byId","index","Map","category","EMOJI_CATEGORIES","entry","emojis","set","getEmojiNativeById","id","get","exports","getEmojiIdByNative","native","undefined","DEFAULT_QUICK_REACTIONS","searchEmojis","query","limit","q","trim","toLowerCase","out","includes","push","length"],"sourceRoot":"../../../src","sources":["helpers/emoji.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAA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B,EAAE;IACvC,KAAK,MAAMC,KAAK,IAAIF,QAAQ,CAACG,MAAM,EAAE;MACnC,IAAID,KAAK,CAAC,CAAC,CAAC,CAACkB,QAAQ,CAACJ,CAAC,CAAC,IAAId,KAAK,CAAC,CAAC,CAAC,CAACkB,QAAQ,CAACJ,CAAC,CAAC,EAAE;QAChDG,GAAG,CAACE,IAAI,CAACnB,KAAK,CAAC;QACf,IAAIiB,GAAG,CAACG,MAAM,IAAIP,KAAK,EAAE;UAAC,OAAOI,GAAG;QAAC;MACvC;IACF;EACF;EACA,OAAOA,GAAG;AACZ,CAAC;AAACX,OAAA,CAAAK,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hapticTap = void 0;
|
|
7
|
+
// expo-haptics is an OPTIONAL peer, probed the same way as expo-blur: the JS
|
|
8
|
+
// package alone is not enough, the native module has to be in the binary,
|
|
9
|
+
// otherwise the call throws. Without it the gesture simply has no feedback.
|
|
10
|
+
let Haptics = null;
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
requireNativeModule
|
|
14
|
+
} = require('expo-modules-core');
|
|
15
|
+
requireNativeModule('ExpoHaptics');
|
|
16
|
+
Haptics = require('expo-haptics');
|
|
17
|
+
} catch {
|
|
18
|
+
Haptics = null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Short tap, the messenger "I got your long-press" feedback. Never throws. */
|
|
22
|
+
const hapticTap = () => {
|
|
23
|
+
if (!Haptics) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
Haptics.impactAsync?.(Haptics.ImpactFeedbackStyle?.Medium).catch?.(() => {});
|
|
27
|
+
};
|
|
28
|
+
exports.hapticTap = hapticTap;
|
|
29
|
+
//# sourceMappingURL=haptics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Haptics","requireNativeModule","require","hapticTap","impactAsync","ImpactFeedbackStyle","Medium","catch","exports"],"sourceRoot":"../../../src","sources":["helpers/haptics.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,IAAIA,OAAY,GAAG,IAAI;AACvB,IAAI;EACF,MAAM;IAAEC;EAAoB,CAAC,GAAGC,OAAO,CAAC,mBAAmB,CAAC;EAC5DD,mBAAmB,CAAC,aAAa,CAAC;EAClCD,OAAO,GAAGE,OAAO,CAAC,cAAc,CAAC;AACnC,CAAC,CAAC,MAAM;EACNF,OAAO,GAAG,IAAI;AAChB;;AAEA;AACO,MAAMG,SAAS,GAAGA,CAAA,KAAM;EAC7B,IAAI,CAACH,OAAO,EAAE;IACZ;EACF;EACAA,OAAO,CAACI,WAAW,GAAGJ,OAAO,CAACK,mBAAmB,EAAEC,MAAM,CAAC,CAACC,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AAC9E,CAAC;AAACC,OAAA,CAAAL,SAAA,GAAAA,SAAA","ignoreList":[]}
|