@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
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
|
-
import { BackHandler, Keyboard, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
|
-
import Animated, { Easing, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
3
|
+
import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, BackHandler, Easing, Keyboard, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
6
5
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
7
6
|
|
|
8
7
|
// Width of the left-edge strip that starts the back swipe.
|
|
9
|
-
import {
|
|
8
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
export const EDGE_WIDTH = 28;
|
|
11
10
|
// Released past this share of the width (or faster than the velocity
|
|
12
11
|
// below), the swipe completes; otherwise the room settles back.
|
|
@@ -23,10 +22,27 @@ export const POP = {
|
|
|
23
22
|
duration: 240,
|
|
24
23
|
easing: Easing.out(Easing.cubic)
|
|
25
24
|
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Holds its children still while `frozen`: the list under an open room is
|
|
28
|
+
* fully covered, so re-rendering it on every store update (each incoming
|
|
29
|
+
* message) is wasted work on the JS thread. It thaws as soon as it is
|
|
30
|
+
* about to be seen again.
|
|
31
|
+
*/
|
|
32
|
+
const Freezable = /*#__PURE__*/memo(({
|
|
33
|
+
children
|
|
34
|
+
}) => /*#__PURE__*/_jsx(_Fragment, {
|
|
35
|
+
children: children
|
|
36
|
+
}), (_prev, next) => next.frozen);
|
|
26
37
|
/**
|
|
27
38
|
* Two-layer stack for the list → room navigation: the room slides in over
|
|
28
39
|
* the list, and a swipe from the left edge drags it back out, following the
|
|
29
40
|
* finger, with the list parallaxing in underneath (the iOS navigation feel).
|
|
41
|
+
*
|
|
42
|
+
* Driven by RN's own `Animated` (native driver), not Reanimated: every layer
|
|
43
|
+
* derives from ONE value through interpolation, so the layers cannot drift
|
|
44
|
+
* apart, and a React re-render mid-flight cannot reset a layer to the style
|
|
45
|
+
* it was first rendered with.
|
|
30
46
|
*/
|
|
31
47
|
export const RoomStack = /*#__PURE__*/forwardRef(({
|
|
32
48
|
list,
|
|
@@ -38,43 +54,83 @@ export const RoomStack = /*#__PURE__*/forwardRef(({
|
|
|
38
54
|
const {
|
|
39
55
|
width: windowWidth
|
|
40
56
|
} = useWindowDimensions();
|
|
41
|
-
const width =
|
|
57
|
+
const [width, setWidth] = useState(windowWidth);
|
|
58
|
+
const widthRef = useRef(width);
|
|
59
|
+
widthRef.current = width;
|
|
42
60
|
const hasRoom = !!room;
|
|
43
61
|
// Room's horizontal offset: 0 = covering the list, `width` = off-screen.
|
|
44
62
|
// A room already open on the first render is shown in place.
|
|
45
|
-
const x =
|
|
46
|
-
const closing =
|
|
63
|
+
const x = useRef(new Animated.Value(hasRoom ? 0 : windowWidth)).current;
|
|
64
|
+
const closing = useRef(false);
|
|
65
|
+
|
|
66
|
+
// True while the list is (about to be) visible under a moving room.
|
|
67
|
+
const [peeking, setPeeking] = useState(false);
|
|
68
|
+
// Bumped after every completed pop — see the settle effect below.
|
|
69
|
+
const [popCount, setPopCount] = useState(0);
|
|
70
|
+
const slideTo = useCallback((toValue, config, done) => {
|
|
71
|
+
Animated.timing(x, {
|
|
72
|
+
toValue,
|
|
73
|
+
...config,
|
|
74
|
+
useNativeDriver: true
|
|
75
|
+
}).start(({
|
|
76
|
+
finished
|
|
77
|
+
}) => done?.(finished));
|
|
78
|
+
}, [x]);
|
|
47
79
|
const isFirstRender = useRef(true);
|
|
48
80
|
useEffect(() => {
|
|
49
81
|
if (isFirstRender.current) {
|
|
50
82
|
isFirstRender.current = false;
|
|
51
83
|
return;
|
|
52
84
|
}
|
|
53
|
-
closing.
|
|
85
|
+
closing.current = false;
|
|
86
|
+
setPeeking(false);
|
|
87
|
+
x.stopAnimation();
|
|
88
|
+
x.setValue(widthRef.current);
|
|
54
89
|
if (hasRoom) {
|
|
55
|
-
|
|
56
|
-
x.value = withTiming(0, PUSH);
|
|
57
|
-
} else {
|
|
58
|
-
x.value = width.value;
|
|
90
|
+
slideTo(0, PUSH);
|
|
59
91
|
}
|
|
60
92
|
}, [hasRoom]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
61
93
|
|
|
62
94
|
const onBackRef = useRef(onBack);
|
|
63
95
|
onBackRef.current = onBack;
|
|
64
|
-
const finish = useCallback(() =>
|
|
65
|
-
|
|
66
|
-
|
|
96
|
+
const finish = useCallback(() => {
|
|
97
|
+
onBackRef.current();
|
|
98
|
+
setPopCount(count => count + 1);
|
|
99
|
+
}, []);
|
|
100
|
+
|
|
101
|
+
// `onBack` normally clears the room, and the effect above takes over.
|
|
102
|
+
// If the room is still (or again) there after a pop — something
|
|
103
|
+
// re-selected it — bring it back on screen: a room parked off-screen
|
|
104
|
+
// would leave the list visible but untouchable.
|
|
105
|
+
const hasRoomRef = useRef(hasRoom);
|
|
106
|
+
hasRoomRef.current = hasRoom;
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (popCount === 0 || !hasRoomRef.current) {
|
|
67
109
|
return;
|
|
68
110
|
}
|
|
69
|
-
closing.
|
|
70
|
-
|
|
71
|
-
|
|
111
|
+
closing.current = false;
|
|
112
|
+
setPeeking(false);
|
|
113
|
+
slideTo(0, POP);
|
|
114
|
+
}, [popCount]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
115
|
+
|
|
116
|
+
const slideOut = useCallback(() => {
|
|
117
|
+
closing.current = true;
|
|
118
|
+
setPeeking(true);
|
|
119
|
+
slideTo(widthRef.current, POP, finished => {
|
|
72
120
|
if (finished) {
|
|
73
|
-
|
|
121
|
+
finish();
|
|
122
|
+
} else {
|
|
123
|
+
closing.current = false;
|
|
74
124
|
}
|
|
75
125
|
});
|
|
76
|
-
}, [finish]);
|
|
77
|
-
|
|
126
|
+
}, [finish, slideTo]);
|
|
127
|
+
const pop = useCallback(() => {
|
|
128
|
+
if (closing.current) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
Keyboard.dismiss();
|
|
132
|
+
slideOut();
|
|
133
|
+
}, [slideOut]);
|
|
78
134
|
useImperativeHandle(ref, () => ({
|
|
79
135
|
pop
|
|
80
136
|
}), [pop]);
|
|
@@ -88,80 +144,92 @@ export const RoomStack = /*#__PURE__*/forwardRef(({
|
|
|
88
144
|
});
|
|
89
145
|
return () => sub.remove();
|
|
90
146
|
}, [hasRoom, hardwareBack, pop]);
|
|
91
|
-
const
|
|
92
|
-
const swipeBack = Gesture.Pan().hitSlop({
|
|
147
|
+
const swipeBack = useMemo(() => Gesture.Pan().runOnJS(true).hitSlop({
|
|
93
148
|
left: 0,
|
|
94
149
|
width: EDGE_WIDTH
|
|
95
150
|
}).activeOffsetX(12).failOffsetY([-16, 16]).onStart(() => {
|
|
96
|
-
|
|
151
|
+
if (closing.current) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
Keyboard.dismiss();
|
|
155
|
+
setPeeking(true);
|
|
156
|
+
x.stopAnimation();
|
|
97
157
|
}).onUpdate(e => {
|
|
98
|
-
if (closing.
|
|
158
|
+
if (closing.current) {
|
|
99
159
|
return;
|
|
100
160
|
}
|
|
101
|
-
x.
|
|
161
|
+
x.setValue(Math.min(Math.max(e.translationX, 0), widthRef.current));
|
|
102
162
|
}).onEnd(e => {
|
|
103
|
-
if (closing.
|
|
163
|
+
if (closing.current) {
|
|
104
164
|
return;
|
|
105
165
|
}
|
|
106
|
-
const complete =
|
|
166
|
+
const complete = e.translationX > widthRef.current * COMPLETE_DISTANCE || e.velocityX > COMPLETE_VELOCITY;
|
|
107
167
|
if (complete) {
|
|
108
|
-
|
|
109
|
-
x.value = withTiming(width.value, POP, finished => {
|
|
110
|
-
if (finished) {
|
|
111
|
-
runOnJS(finish)();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
168
|
+
slideOut();
|
|
114
169
|
} else {
|
|
115
|
-
|
|
170
|
+
slideTo(0, POP, () => setPeeking(false));
|
|
116
171
|
}
|
|
117
|
-
});
|
|
172
|
+
}), [slideOut, slideTo, x]);
|
|
118
173
|
const onLayout = useCallback(e => {
|
|
119
174
|
const next = e.nativeEvent.layout.width;
|
|
120
|
-
if (next > 0 && next !==
|
|
175
|
+
if (next > 0 && next !== widthRef.current) {
|
|
121
176
|
// Keep an off-screen room off-screen when the container resizes.
|
|
122
|
-
if (
|
|
123
|
-
x.
|
|
177
|
+
if (!hasRoomRef.current) {
|
|
178
|
+
x.setValue(next);
|
|
124
179
|
}
|
|
125
|
-
|
|
180
|
+
setWidth(next);
|
|
126
181
|
}
|
|
127
|
-
}, []);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const dimStyle = useAnimatedStyle(() => ({
|
|
144
|
-
opacity: interpolate(x.value, [0, width.value], [LIST_DIM, 0])
|
|
145
|
-
}));
|
|
182
|
+
}, [x]);
|
|
183
|
+
const {
|
|
184
|
+
listShift,
|
|
185
|
+
dimOpacity
|
|
186
|
+
} = useMemo(() => ({
|
|
187
|
+
listShift: x.interpolate({
|
|
188
|
+
inputRange: [0, width],
|
|
189
|
+
outputRange: [-width * LIST_PARALLAX, 0],
|
|
190
|
+
extrapolate: 'clamp'
|
|
191
|
+
}),
|
|
192
|
+
dimOpacity: x.interpolate({
|
|
193
|
+
inputRange: [0, width],
|
|
194
|
+
outputRange: [LIST_DIM, 0],
|
|
195
|
+
extrapolate: 'clamp'
|
|
196
|
+
})
|
|
197
|
+
}), [x, width]);
|
|
146
198
|
return /*#__PURE__*/_jsxs(View, {
|
|
147
199
|
style: styles.container,
|
|
148
200
|
onLayout: onLayout,
|
|
149
201
|
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
150
|
-
style: [styles.layer,
|
|
202
|
+
style: [styles.layer,
|
|
203
|
+
// Without a room the list always rests in place, whatever the
|
|
204
|
+
// animated value is doing.
|
|
205
|
+
hasRoom ? {
|
|
206
|
+
transform: [{
|
|
207
|
+
translateX: listShift
|
|
208
|
+
}]
|
|
209
|
+
} : null],
|
|
151
210
|
pointerEvents: hasRoom ? 'none' : 'auto',
|
|
152
211
|
accessibilityElementsHidden: hasRoom,
|
|
153
212
|
importantForAccessibility: hasRoom ? 'no-hide-descendants' : 'auto',
|
|
154
|
-
children:
|
|
213
|
+
children: /*#__PURE__*/_jsx(Freezable, {
|
|
214
|
+
frozen: hasRoom && !peeking,
|
|
215
|
+
children: list
|
|
216
|
+
})
|
|
155
217
|
}), hasRoom && /*#__PURE__*/_jsxs(_Fragment, {
|
|
156
218
|
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
157
219
|
pointerEvents: "none",
|
|
158
|
-
style: [styles.layer, styles.dim,
|
|
220
|
+
style: [styles.layer, styles.dim, {
|
|
221
|
+
opacity: dimOpacity
|
|
222
|
+
}]
|
|
159
223
|
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
160
224
|
gesture: swipeBack,
|
|
161
225
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
162
226
|
style: [styles.layer, styles.room, {
|
|
163
227
|
backgroundColor: roomBackground
|
|
164
|
-
},
|
|
228
|
+
}, {
|
|
229
|
+
transform: [{
|
|
230
|
+
translateX: x
|
|
231
|
+
}]
|
|
232
|
+
}],
|
|
165
233
|
children: room
|
|
166
234
|
})
|
|
167
235
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useImperativeHandle","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","memo","useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","Animated","BackHandler","Easing","Keyboard","StyleSheet","useWindowDimensions","View","Gesture","GestureDetector","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","EDGE_WIDTH","COMPLETE_DISTANCE","COMPLETE_VELOCITY","LIST_PARALLAX","LIST_DIM","PUSH","duration","easing","bezier","POP","out","cubic","Freezable","children","_prev","next","frozen","RoomStack","list","room","onBack","roomBackground","hardwareBack","ref","width","windowWidth","setWidth","widthRef","current","hasRoom","x","Value","closing","peeking","setPeeking","popCount","setPopCount","slideTo","toValue","config","done","timing","useNativeDriver","start","finished","isFirstRender","stopAnimation","setValue","onBackRef","finish","count","hasRoomRef","slideOut","pop","dismiss","undefined","sub","addEventListener","remove","swipeBack","Pan","runOnJS","hitSlop","left","activeOffsetX","failOffsetY","onStart","onUpdate","e","Math","min","max","translationX","onEnd","complete","velocityX","onLayout","nativeEvent","layout","listShift","dimOpacity","interpolate","inputRange","outputRange","extrapolate","style","styles","container","layer","transform","translateX","pointerEvents","accessibilityElementsHidden","importantForAccessibility","dim","opacity","gesture","backgroundColor","displayName","create","flex","overflow","position","top","right","bottom","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius"],"sourceRoot":"../../../../src","sources":["components/MainComponents/RoomStack.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,IAAI,EAEJC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,QAAQ,EAERC,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CAACE,KAAK,EACZF,MAAM,CAACnE,IAAI,EACX;YAAE8E,eAAe,EAAE5E;UAAe,CAAC,EACnC;YAAEoE,SAAS,EAAE,CAAC;cAAEC,UAAU,EAAE5D;YAAE,CAAC;UAAE,CAAC,CAClC;UAAAjB,QAAA,EAEDM;QAAI,CACQ;MAAC,CACD,CAAC;IAAA,CAClB,CACH;EAAA,CACG,CAAC;AAEX,CACF,CAAC;AAEDF,SAAS,CAACiF,WAAW,GAAG,WAAW;AAEnC,MAAMZ,MAAM,GAAGjG,UAAU,CAAC8G,MAAM,CAAC;EAC/BZ,SAAS,EAAE;IACTa,IAAI,EAAE,CAAC;IACP5E,KAAK,EAAE,MAAM;IACb6E,QAAQ,EAAE;EACZ,CAAC;EACDb,KAAK,EAAE;IACLc,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT1C,IAAI,EAAE;EACR,CAAC;EACD+B,GAAG,EAAE;IACHG,eAAe,EAAE;EACnB,CAAC;EACD9E,IAAI,EAAE;IACJuF,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEnF,KAAK,EAAE,CAAC,CAAC;MAAEoF,MAAM,EAAE;IAAE,CAAC;IACtCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { LockIcon } from '../../assets/icons';
|
|
6
|
+
import FileDownload from '../styled/UnsupportedType';
|
|
7
|
+
import CustomMessageImage from '../styled/MessageImage';
|
|
8
|
+
import CustomMessageVideo from '../styled/VideoMessage';
|
|
9
|
+
import AudioMessage from '../styled/AudioMessage';
|
|
10
|
+
import { BackgroundFile, FileInformation, FileName, FileSize, FileSizeContainer, UnsupportedContainer } from '../styled/StyledInputComponents/MediaComponents';
|
|
11
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
12
|
+
import { useT } from '../../i18n/useT';
|
|
13
|
+
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
14
|
+
import { withFileToken } from '../../helpers/secureFileUrl';
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const sealedFiles = () => require('../../e2ee/sealedFiles');
|
|
17
|
+
export const sealedAttachmentsOf = message => {
|
|
18
|
+
if (!message) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
let raw = message.attachments;
|
|
22
|
+
if (typeof raw === 'string') {
|
|
23
|
+
try {
|
|
24
|
+
raw = JSON.parse(raw);
|
|
25
|
+
} catch {
|
|
26
|
+
raw = undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (Array.isArray(raw) && raw.length > 0) {
|
|
30
|
+
return raw.filter(item => item && typeof item.location === 'string' && item.location).map(item => ({
|
|
31
|
+
location: item.location,
|
|
32
|
+
size: item.size
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
return message.location ? [{
|
|
36
|
+
location: message.location,
|
|
37
|
+
size: message.size
|
|
38
|
+
}] : [];
|
|
39
|
+
};
|
|
40
|
+
const formatBytes = value => {
|
|
41
|
+
const bytes = Number(value);
|
|
42
|
+
if (!Number.isFinite(bytes) || bytes <= 0) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
if (bytes < 1024) {
|
|
46
|
+
return `${bytes} B`;
|
|
47
|
+
}
|
|
48
|
+
if (bytes < 1024 * 1024) {
|
|
49
|
+
return `${(bytes / 1024).toFixed(0)} KB`;
|
|
50
|
+
}
|
|
51
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
52
|
+
};
|
|
53
|
+
const SealedItem = ({
|
|
54
|
+
attachment,
|
|
55
|
+
keyMaterial,
|
|
56
|
+
isUser
|
|
57
|
+
}) => {
|
|
58
|
+
const theme = useTheme();
|
|
59
|
+
const t = useT();
|
|
60
|
+
const {
|
|
61
|
+
config
|
|
62
|
+
} = useChatSettingState();
|
|
63
|
+
const [state, setState] = useState('idle');
|
|
64
|
+
const [progress, setProgress] = useState(0);
|
|
65
|
+
const [opened, setOpened] = useState(null);
|
|
66
|
+
const mounted = useRef(true);
|
|
67
|
+
useEffect(() => () => {
|
|
68
|
+
mounted.current = false;
|
|
69
|
+
}, []);
|
|
70
|
+
const {
|
|
71
|
+
location
|
|
72
|
+
} = attachment;
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!keyMaterial || !location) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let active = true;
|
|
78
|
+
sealedFiles().findOpened(location).then(found => {
|
|
79
|
+
if (active && found) {
|
|
80
|
+
setOpened(found);
|
|
81
|
+
}
|
|
82
|
+
}).catch(() => {});
|
|
83
|
+
return () => {
|
|
84
|
+
active = false;
|
|
85
|
+
};
|
|
86
|
+
}, [keyMaterial, location]);
|
|
87
|
+
const handlePress = useCallback(async () => {
|
|
88
|
+
if (opened || !keyMaterial || !location || state === 'working') {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
setState('working');
|
|
92
|
+
setProgress(0);
|
|
93
|
+
try {
|
|
94
|
+
const file = await sealedFiles().openSealedAttachment(location, withFileToken(location), keyMaterial, fraction => {
|
|
95
|
+
if (mounted.current) {
|
|
96
|
+
setProgress(fraction);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
if (!mounted.current) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
setOpened(file);
|
|
103
|
+
setState('idle');
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.warn('sealed attachment could not be opened', error);
|
|
106
|
+
if (mounted.current) {
|
|
107
|
+
setState('failed');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, [keyMaterial, location, opened, state]);
|
|
111
|
+
if (opened) {
|
|
112
|
+
if (opened.mimetype.startsWith('image/')) {
|
|
113
|
+
return /*#__PURE__*/_jsx(View, {
|
|
114
|
+
testID: "sealed-attachment-image",
|
|
115
|
+
children: /*#__PURE__*/_jsx(CustomMessageImage, {
|
|
116
|
+
fileName: opened.name,
|
|
117
|
+
originalName: opened.name,
|
|
118
|
+
fileURL: opened.uri,
|
|
119
|
+
locationPreview: opened.uri,
|
|
120
|
+
mimetype: opened.mimetype
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (opened.mimetype.startsWith('video/')) {
|
|
125
|
+
return /*#__PURE__*/_jsx(CustomMessageVideo, {
|
|
126
|
+
fileName: opened.name,
|
|
127
|
+
originalName: opened.name,
|
|
128
|
+
fileURL: opened.uri,
|
|
129
|
+
mimetype: opened.mimetype
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (opened.mimetype.startsWith('audio/')) {
|
|
133
|
+
return /*#__PURE__*/_jsx(AudioMessage, {
|
|
134
|
+
src: opened.uri,
|
|
135
|
+
mimeType: opened.mimetype,
|
|
136
|
+
fileName: opened.name,
|
|
137
|
+
originalName: opened.name
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return /*#__PURE__*/_jsx(View, {
|
|
141
|
+
testID: "sealed-attachment",
|
|
142
|
+
children: /*#__PURE__*/_jsx(FileDownload, {
|
|
143
|
+
fileURL: opened.uri,
|
|
144
|
+
fileName: opened.name,
|
|
145
|
+
originalName: opened.name,
|
|
146
|
+
mimetype: opened.mimetype,
|
|
147
|
+
isUser: isUser
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const canOpen = !!keyMaterial && !!location;
|
|
152
|
+
const working = state === 'working';
|
|
153
|
+
const note = !canOpen ? t(config?.e2ee?.enabled === true ? 'media.sealedUnavailable' : 'media.sealedUnsupported') : working ? `${t('media.sealedDownloading')} ${Math.round(progress * 100)}%` : state === 'failed' ? t('media.sealedDownloadFailed') : formatBytes(attachment.size) || t('media.sealedDownload');
|
|
154
|
+
return /*#__PURE__*/_jsxs(UnsupportedContainer, {
|
|
155
|
+
isUser: isUser,
|
|
156
|
+
onPress: handlePress,
|
|
157
|
+
disabled: !canOpen || working,
|
|
158
|
+
activeOpacity: canOpen && !working ? 0.7 : 1,
|
|
159
|
+
testID: "sealed-attachment",
|
|
160
|
+
accessibilityRole: "button",
|
|
161
|
+
accessibilityLabel: t(canOpen ? 'media.sealedDownload' : 'media.sealedFile'),
|
|
162
|
+
children: [/*#__PURE__*/_jsx(BackgroundFile, {
|
|
163
|
+
children: working ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
164
|
+
size: "small",
|
|
165
|
+
color: theme.textSecondary
|
|
166
|
+
}) : /*#__PURE__*/_jsx(LockIcon, {
|
|
167
|
+
width: 26,
|
|
168
|
+
height: 26,
|
|
169
|
+
color: theme.textSecondary
|
|
170
|
+
})
|
|
171
|
+
}), /*#__PURE__*/_jsxs(FileInformation, {
|
|
172
|
+
children: [/*#__PURE__*/_jsx(FileName, {
|
|
173
|
+
numberOfLines: 1,
|
|
174
|
+
isUser: isUser,
|
|
175
|
+
colorIsUser: config?.colors?.primary,
|
|
176
|
+
colorUsers: config?.colors?.secondary,
|
|
177
|
+
children: t('media.sealedFile')
|
|
178
|
+
}), /*#__PURE__*/_jsx(FileSizeContainer, {
|
|
179
|
+
style: styles.note,
|
|
180
|
+
children: /*#__PURE__*/_jsx(FileSize, {
|
|
181
|
+
numberOfLines: 2,
|
|
182
|
+
style: state === 'failed' && canOpen ? {
|
|
183
|
+
color: theme.danger
|
|
184
|
+
} : undefined,
|
|
185
|
+
children: note
|
|
186
|
+
})
|
|
187
|
+
})]
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
const SealedAttachment = ({
|
|
192
|
+
message,
|
|
193
|
+
isUser
|
|
194
|
+
}) => {
|
|
195
|
+
const attachments = sealedAttachmentsOf(message);
|
|
196
|
+
const keys = message?.e2eeKeys;
|
|
197
|
+
if (attachments.length === 0) {
|
|
198
|
+
return /*#__PURE__*/_jsx(SealedItem, {
|
|
199
|
+
attachment: {
|
|
200
|
+
location: ''
|
|
201
|
+
},
|
|
202
|
+
isUser: isUser
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return /*#__PURE__*/_jsx(View, {
|
|
206
|
+
style: styles.stack,
|
|
207
|
+
children: attachments.map((attachment, index) => /*#__PURE__*/_jsx(SealedItem, {
|
|
208
|
+
attachment: attachment,
|
|
209
|
+
keyMaterial: keys?.[index],
|
|
210
|
+
isUser: isUser
|
|
211
|
+
}, attachment.location || index))
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
export default SealedAttachment;
|
|
215
|
+
const styles = StyleSheet.create({
|
|
216
|
+
stack: {
|
|
217
|
+
gap: 8
|
|
218
|
+
},
|
|
219
|
+
note: {
|
|
220
|
+
flexShrink: 1,
|
|
221
|
+
borderRadius: 10
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
//# sourceMappingURL=SealedAttachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useRef","useState","ActivityIndicator","StyleSheet","View","LockIcon","FileDownload","CustomMessageImage","CustomMessageVideo","AudioMessage","BackgroundFile","FileInformation","FileName","FileSize","FileSizeContainer","UnsupportedContainer","useTheme","useT","useChatSettingState","withFileToken","jsx","_jsx","jsxs","_jsxs","sealedFiles","require","sealedAttachmentsOf","message","raw","attachments","JSON","parse","undefined","Array","isArray","length","filter","item","location","map","size","formatBytes","value","bytes","Number","isFinite","toFixed","SealedItem","attachment","keyMaterial","isUser","theme","t","config","state","setState","progress","setProgress","opened","setOpened","mounted","current","active","findOpened","then","found","catch","handlePress","file","openSealedAttachment","fraction","error","console","warn","mimetype","startsWith","testID","children","fileName","name","originalName","fileURL","uri","locationPreview","src","mimeType","canOpen","working","note","e2ee","enabled","Math","round","onPress","disabled","activeOpacity","accessibilityRole","accessibilityLabel","color","textSecondary","width","height","numberOfLines","colorIsUser","colors","primary","colorUsers","secondary","style","styles","danger","SealedAttachment","keys","e2eeKeys","stack","index","create","gap","flexShrink","borderRadius"],"sourceRoot":"../../../../src","sources":["components/MainComponents/SealedAttachment.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,YAAY,MAAM,2BAA2B;AACpD,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,YAAY,MAAM,wBAAwB;AACjD,SACEC,cAAc,EACdC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,iBAAiB,EACjBC,oBAAoB,QACf,iDAAiD;AACxD,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,IAAI,QAAQ,iBAAiB;AACtC,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,SAASC,aAAa,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG5D,MAAMC,WAAW,GAAGA,CAAA,KAClBC,OAAO,CAAC,wBAAwB,CAA4C;AAO9E,OAAO,MAAMC,mBAAmB,GAAIC,OAAyB,IAAkB;EAC7E,IAAI,CAACA,OAAO,EAAE;IAAC,OAAO,EAAE;EAAC;EACzB,IAAIC,GAAY,GAAID,OAAO,CAASE,WAAW;EAC/C,IAAI,OAAOD,GAAG,KAAK,QAAQ,EAAE;IAC3B,IAAI;MACFA,GAAG,GAAGE,IAAI,CAACC,KAAK,CAACH,GAAG,CAAC;IACvB,CAAC,CAAC,MAAM;MACNA,GAAG,GAAGI,SAAS;IACjB;EACF;EACA,IAAI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,CACL,CAAC;EAAA,CACE,CAAC;AAE3B,CAAC;AAED,MAAMuB,gBAAmE,GAAGA,CAAC;EAC3EpF,OAAO;EACPuB;AACF,CAAC,KAAK;EACJ,MAAMrB,WAAW,GAAGH,mBAAmB,CAACC,OAAO,CAAC;EAChD,MAAMqF,IAAI,GAAGrF,OAAO,EAAEsF,QAAQ;EAC9B,IAAIpF,WAAW,CAACM,MAAM,KAAK,CAAC,EAAE;IAC5B,oBAAOd,IAAA,CAAC0B,UAAU;MAACC,UAAU,EAAE;QAAEV,QAAQ,EAAE;MAAG,CAAE;MAACY,MAAM,EAAEA;IAAO,CAAE,CAAC;EACrE;EACA,oBACE7B,IAAA,CAACjB,IAAI;IAACwG,KAAK,EAAEC,MAAM,CAACK,KAAM;IAAArC,QAAA,EACvBhD,WAAW,CAACU,GAAG,CAAC,CAACS,UAAU,EAAEmE,KAAK,kBACjC9F,IAAA,CAAC0B,UAAU;MAETC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAE+D,IAAI,GAAGG,KAAK,CAAE;MAC3BjE,MAAM,EAAEA;IAAO,GAHVF,UAAU,CAACV,QAAQ,IAAI6E,KAI7B,CACF;EAAC,CACE,CAAC;AAEX,CAAC;AAED,eAAeJ,gBAAgB;AAE/B,MAAMF,MAAM,GAAG1G,UAAU,CAACiH,MAAM,CAAC;EAC/BF,KAAK,EAAE;IACLG,GAAG,EAAE;EACP,CAAC;EACD7B,IAAI,EAAE;IACJ8B,UAAU,EAAE,CAAC;IACbC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const SystemMessage = ({
|
|
7
8
|
messageText,
|
|
8
9
|
colors
|
|
9
10
|
}) => {
|
|
11
|
+
// Same pill as the day separator; `colors.secondary` is not a pill
|
|
12
|
+
// colour (see DateLabel).
|
|
13
|
+
const theme = useTheme();
|
|
10
14
|
return /*#__PURE__*/_jsx(View, {
|
|
11
15
|
style: styles.container,
|
|
12
16
|
children: /*#__PURE__*/_jsx(View, {
|
|
13
17
|
style: [styles.bubble, {
|
|
14
|
-
backgroundColor:
|
|
18
|
+
backgroundColor: theme.dateLabelBackground
|
|
15
19
|
}],
|
|
16
20
|
children: /*#__PURE__*/_jsx(Text, {
|
|
17
21
|
style: [styles.text, {
|
|
18
|
-
color: colors?.primary ||
|
|
22
|
+
color: colors?.primary || theme.dateLabel
|
|
19
23
|
}],
|
|
20
24
|
children: messageText
|
|
21
25
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","StyleSheet","jsx","_jsx","SystemMessage","messageText","colors","style","styles","container","children","bubble","backgroundColor","
|
|
1
|
+
{"version":3,"names":["React","View","Text","StyleSheet","useTheme","jsx","_jsx","SystemMessage","messageText","colors","theme","style","styles","container","children","bubble","backgroundColor","dateLabelBackground","text","color","primary","dateLabel","create","width","alignItems","paddingVertical","paddingHorizontal","maxWidth","borderRadius","fontSize","lineHeight","fontWeight","textAlign"],"sourceRoot":"../../../../src","sources":["components/MainComponents/SystemMessage.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,QAAQ,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOhD,MAAMC,aAA2C,GAAGA,CAAC;EACnDC,WAAW;EACXC;AACF,CAAC,KAAK;EACJ;EACA;EACA,MAAMC,KAAK,GAAGN,QAAQ,CAAC,CAAC;EACxB,oBACEE,IAAA,CAACL,IAAI;IAACU,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,eAK5BR,IAAA,CAACL,IAAI;MACHU,KAAK,EAAE,CACLC,MAAM,CAACG,MAAM,EACb;QAAEC,eAAe,EAAEN,KAAK,CAACO;MAAoB,CAAC,CAC9C;MAAAH,QAAA,eAEFR,IAAA,CAACJ,IAAI;QAACS,KAAK,EAAE,CAACC,MAAM,CAACM,IAAI,EAAE;UAAEC,KAAK,EAAEV,MAAM,EAAEW,OAAO,IAAIV,KAAK,CAACW;QAAU,CAAC,CAAE;QAAAP,QAAA,EACvEN;MAAW,CACR;IAAC,CACH;EAAC,CACH,CAAC;AAEX,CAAC;AAED,eAAeD,aAAa;AAE5B,MAAMK,MAAM,GAAGT,UAAU,CAACmB,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,KAAK,EAAE,MAAM;IACbC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDX,MAAM,EAAE;IACNY,QAAQ,EAAE,KAAK;IACfC,YAAY,EAAE,EAAE;IAChBH,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDR,IAAI,EAAE;IACJW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -34,7 +34,8 @@ export const Avatar = ({
|
|
|
34
34
|
username,
|
|
35
35
|
firstName,
|
|
36
36
|
lastName,
|
|
37
|
-
style
|
|
37
|
+
style,
|
|
38
|
+
textSize
|
|
38
39
|
}) => {
|
|
39
40
|
const {
|
|
40
41
|
config
|
|
@@ -73,6 +74,9 @@ export const Avatar = ({
|
|
|
73
74
|
bgColor: backgroundColor?.backgroundColor,
|
|
74
75
|
children: /*#__PURE__*/_jsx(AvatarText, {
|
|
75
76
|
color: getAvatarTextColor(backgroundColor?.backgroundColor),
|
|
77
|
+
style: textSize ? {
|
|
78
|
+
fontSize: textSize
|
|
79
|
+
} : undefined,
|
|
76
80
|
children: getInitials()
|
|
77
81
|
})
|
|
78
82
|
});
|