@ethora/chat-component-rn 26.8.6 → 26.8.8
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 +36 -0
- package/README.md +64 -2
- package/lib/commonjs/assets/icons.js +4 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +28 -6
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +9 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +5 -3
- 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/ReduxWrapper.js +13 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.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/Menu/HeaderRoomListMenu.js +26 -13
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/MenuRoom/MenuRoom.js +5 -3
- package/lib/commonjs/components/MenuRoom/MenuRoom.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js +2 -1
- package/lib/commonjs/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +69 -9
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js +7 -4
- package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +8 -5
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +2 -2
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +166 -21
- 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/Modal.js +33 -11
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +8 -8
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.js +279 -0
- package/lib/commonjs/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.js.map +1 -0
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +10 -8
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +13 -11
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +50 -15
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js +121 -0
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -0
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +10 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +32 -9
- 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/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 +56 -46
- 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/SendInput.js +4 -2
- package/lib/commonjs/components/styled/SendInput.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/constants/MODAL_COMPONENTS.js +2 -0
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js +1 -0
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -4
- package/lib/commonjs/helpers/createMessageFromXml.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/persistCrypto.js +5 -0
- package/lib/commonjs/helpers/persistCrypto.js.map +1 -1
- package/lib/commonjs/helpers/preferencesStorage.js.map +1 -1
- package/lib/commonjs/helpers/secureKeyValue.js +20 -0
- package/lib/commonjs/helpers/secureKeyValue.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/useChatSettingState.js +2 -0
- package/lib/commonjs/hooks/useChatSettingState.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +4 -0
- package/lib/commonjs/hooks/useChatWrapperInit.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/useSendMessage.js +71 -7
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +367 -1
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/i18n/useT.js +8 -4
- package/lib/commonjs/i18n/useT.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/api-requests/user.api.js +13 -0
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +40 -0
- package/lib/commonjs/networking/xmpp/handleStanzas.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 +6 -0
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -2
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/persistBackend.js +9 -12
- package/lib/commonjs/roomStore/persistBackend.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +8 -1
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/services/languageSettings.js +177 -0
- package/lib/commonjs/services/languageSettings.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +3 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +29 -7
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +9 -1
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +5 -3
- 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/ReduxWrapper.js +14 -1
- package/lib/module/components/MainComponents/ReduxWrapper.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/Menu/HeaderRoomListMenu.js +26 -13
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/MenuRoom/MenuRoom.js +5 -3
- package/lib/module/components/MenuRoom/MenuRoom.js.map +1 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js +2 -1
- package/lib/module/components/MessageBubble/BottomReplyContainer.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +72 -12
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/MessageBubble/MessageInteractions.js +7 -4
- package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +8 -5
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +2 -2
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +168 -23
- 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/Modal.js +33 -11
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +8 -8
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.js +274 -0
- package/lib/module/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.js.map +1 -0
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +10 -8
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +13 -11
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +54 -18
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js +116 -0
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -0
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +10 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +32 -9
- 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/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 +57 -47
- 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/SendInput.js +4 -2
- package/lib/module/components/styled/SendInput.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/constants/MODAL_COMPONENTS.js +2 -0
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_TYPES.js +1 -0
- package/lib/module/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -4
- package/lib/module/helpers/createMessageFromXml.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/persistCrypto.js +4 -0
- package/lib/module/helpers/persistCrypto.js.map +1 -1
- package/lib/module/helpers/preferencesStorage.js.map +1 -1
- package/lib/module/helpers/secureKeyValue.js +19 -0
- package/lib/module/helpers/secureKeyValue.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/useChatSettingState.js +2 -0
- package/lib/module/hooks/useChatSettingState.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +4 -0
- package/lib/module/hooks/useChatWrapperInit.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/useSendMessage.js +71 -7
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +367 -1
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/i18n/useT.js +8 -4
- package/lib/module/i18n/useT.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/api-requests/user.api.js +12 -0
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +1 -1
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/handleStanzas.xmpp.js +38 -0
- package/lib/module/networking/xmpp/handleStanzas.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 +6 -0
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +5 -1
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/persistBackend.js +10 -13
- package/lib/module/roomStore/persistBackend.js.map +1 -1
- package/lib/module/roomStore/persistence.js +8 -1
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/services/languageSettings.js +164 -0
- package/lib/module/services/languageSettings.js.map +1 -0
- package/lib/module/version.js +1 -1
- 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/ReduxWrapper.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/Menu/HeaderRoomListMenu.d.ts +7 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/MenuRoom/MenuRoom.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/BottomReplyContainer.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/MessageInteractions.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/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.d.ts +15 -0
- package/lib/typescript/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/LanguageCard.d.ts +14 -0
- package/lib/typescript/components/Modals/UserSettingsModal/LanguageCard.d.ts.map +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- 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/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.map +1 -1
- package/lib/typescript/components/UsersList/UsersList.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/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/constants/MODAL_COMPONENTS.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts +1 -0
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.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/persistCrypto.d.ts +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts.map +1 -1
- package/lib/typescript/helpers/preferencesStorage.d.ts +4 -0
- package/lib/typescript/helpers/preferencesStorage.d.ts.map +1 -1
- package/lib/typescript/helpers/secureKeyValue.d.ts +4 -0
- package/lib/typescript/helpers/secureKeyValue.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/useChatSettingState.d.ts +1 -0
- package/lib/typescript/hooks/useChatSettingState.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.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/i18n/useT.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/api-requests/user.api.d.ts +6 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.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/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.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +8 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistBackend.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/services/languageSettings.d.ts +29 -0
- package/lib/typescript/services/languageSettings.d.ts.map +1 -0
- package/lib/typescript/types/models/message.model.d.ts +5 -0
- package/lib/typescript/types/models/message.model.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +5 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/models/user.model.d.ts +4 -0
- package/lib/typescript/types/models/user.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +25 -0
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +8 -4
- package/src/assets/icons.tsx +27 -0
- package/src/components/MainComponents/ChatHeader.tsx +30 -9
- package/src/components/MainComponents/ChatRoom.tsx +11 -1
- package/src/components/MainComponents/ChatWrapper.tsx +5 -3
- 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/ReduxWrapper.tsx +11 -0
- package/src/components/MainComponents/SealedAttachment.tsx +251 -0
- package/src/components/Menu/HeaderRoomListMenu.tsx +40 -13
- package/src/components/MenuRoom/MenuRoom.tsx +5 -3
- package/src/components/MessageBubble/BottomReplyContainer.tsx +2 -1
- package/src/components/MessageBubble/Message.tsx +99 -9
- package/src/components/MessageBubble/MessageInteractions.tsx +7 -6
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +8 -5
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +2 -2
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +188 -40
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +4 -0
- package/src/components/Modals/Modal/Modal.tsx +44 -16
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +8 -8
- package/src/components/Modals/SettingsModals/ChangePassword/ChangePasswordModal.tsx +316 -0
- package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +10 -15
- package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +13 -14
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +72 -20
- package/src/components/Modals/UserSettingsModal/LanguageCard.tsx +144 -0
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +13 -1
- package/src/components/RoomComponents/ChatRoomItem.tsx +23 -11
- package/src/components/RoomComponents/LastMessageItem.tsx +5 -0
- package/src/components/RoomComponents/styled/LastAudioMessage.tsx +3 -1
- 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 +17 -2
- package/src/components/UsersList/UsersList.tsx +2 -1
- package/src/components/styled/SendInput.tsx +5 -2
- 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/constants/MODAL_COMPONENTS.tsx +2 -0
- package/src/helpers/constants/MODAL_TYPES.ts +1 -0
- package/src/helpers/createMessageFromXml.ts +31 -6
- package/src/helpers/createUserNameFromSetUser.ts +2 -1
- package/src/helpers/displayName.ts +9 -0
- package/src/helpers/persistCrypto.ts +5 -0
- package/src/helpers/preferencesStorage.ts +4 -0
- package/src/helpers/secureKeyValue.ts +15 -0
- package/src/helpers/videoCache.ts +138 -0
- package/src/hooks/useChatSettingState.tsx +4 -0
- package/src/hooks/useChatWrapperInit.ts +4 -0
- package/src/hooks/useLogout.tsx +9 -0
- package/src/hooks/useSendMessage.tsx +71 -5
- package/src/i18n/strings.ts +367 -1
- package/src/i18n/useT.ts +6 -4
- 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/api-requests/user.api.ts +9 -0
- package/src/networking/stanzaHandlers.ts +1 -0
- package/src/networking/xmpp/handleStanzas.xmpp.ts +49 -0
- 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 +6 -0
- package/src/roomStore/chatSettingsSlice.ts +13 -0
- package/src/roomStore/persistBackend.ts +8 -11
- package/src/roomStore/persistence.ts +15 -0
- package/src/services/languageSettings.ts +143 -0
- package/src/types/models/message.model.ts +5 -0
- package/src/types/models/room.model.ts +5 -0
- package/src/types/models/user.model.ts +4 -0
- package/src/types/types.ts +25 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
KeyboardAvoidingView,
|
|
5
|
+
Platform,
|
|
6
|
+
ScrollView,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Text,
|
|
9
|
+
TextInput,
|
|
10
|
+
TouchableOpacity,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import ModalHeaderComponent from '../../ModalHeaderComponent';
|
|
14
|
+
import { ModalContainerFullScreen } from '../../styledModalComponents';
|
|
15
|
+
import { useTheme } from '../../../../hooks/useTheme';
|
|
16
|
+
import type { ChatTheme } from '../../../../theme/theme';
|
|
17
|
+
import { useT } from '../../../../i18n/useT';
|
|
18
|
+
import { useToast } from '../../../../context/ToastContext';
|
|
19
|
+
import { useChatSettingState } from '../../../../hooks/useChatSettingState';
|
|
20
|
+
import { changePassword } from '../../../../networking/api-requests/user.api';
|
|
21
|
+
import { chatTextStyle } from '../../../../helpers/typography';
|
|
22
|
+
|
|
23
|
+
/** What the backend asks of a password at sign-up. */
|
|
24
|
+
export const MIN_PASSWORD_LENGTH = 8;
|
|
25
|
+
|
|
26
|
+
/** The reason a backend gave, or nothing - never an axios dump. */
|
|
27
|
+
const serverReason = (error: any): string => {
|
|
28
|
+
const data = error?.response?.data;
|
|
29
|
+
const text =
|
|
30
|
+
(typeof data === 'string' && data) ||
|
|
31
|
+
data?.message ||
|
|
32
|
+
data?.error ||
|
|
33
|
+
(Array.isArray(data?.errors) && data.errors.map((e: any) => e?.message || e).join(', ')) ||
|
|
34
|
+
'';
|
|
35
|
+
return typeof text === 'string' ? text.trim() : '';
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
interface FieldProps {
|
|
39
|
+
testID: string;
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
onChangeText: (value: string) => void;
|
|
43
|
+
error?: string;
|
|
44
|
+
editable: boolean;
|
|
45
|
+
newPassword?: boolean;
|
|
46
|
+
onSubmitEditing?: () => void;
|
|
47
|
+
styles: ReturnType<typeof createStyles>;
|
|
48
|
+
theme: ChatTheme;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** One labelled password field: label above, error (if any) below. */
|
|
52
|
+
const Field: React.FC<FieldProps> = ({
|
|
53
|
+
testID,
|
|
54
|
+
label,
|
|
55
|
+
value,
|
|
56
|
+
onChangeText,
|
|
57
|
+
error,
|
|
58
|
+
editable,
|
|
59
|
+
newPassword,
|
|
60
|
+
onSubmitEditing,
|
|
61
|
+
styles,
|
|
62
|
+
theme,
|
|
63
|
+
}) => (
|
|
64
|
+
<View style={styles.field}>
|
|
65
|
+
<Text style={styles.fieldLabel}>{label}</Text>
|
|
66
|
+
<TextInput
|
|
67
|
+
testID={testID}
|
|
68
|
+
style={[styles.input, error ? styles.inputError : null]}
|
|
69
|
+
value={value}
|
|
70
|
+
onChangeText={onChangeText}
|
|
71
|
+
placeholder={label}
|
|
72
|
+
placeholderTextColor={theme.textMuted}
|
|
73
|
+
keyboardAppearance={theme.dark ? 'dark' : 'light'}
|
|
74
|
+
secureTextEntry
|
|
75
|
+
autoCapitalize="none"
|
|
76
|
+
autoCorrect={false}
|
|
77
|
+
textContentType={newPassword ? 'newPassword' : 'password'}
|
|
78
|
+
editable={editable}
|
|
79
|
+
returnKeyType={onSubmitEditing ? 'done' : 'next'}
|
|
80
|
+
onSubmitEditing={onSubmitEditing}
|
|
81
|
+
blurOnSubmit={!!onSubmitEditing}
|
|
82
|
+
/>
|
|
83
|
+
{error ? <Text style={styles.fieldError}>{error}</Text> : null}
|
|
84
|
+
</View>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
interface ChangePasswordModalProps {
|
|
88
|
+
handleCloseModal: () => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Change the account password: the current one, the new one twice. Nothing
|
|
93
|
+
* is sent until the form is complete and the two match; what the backend
|
|
94
|
+
* refuses is shown as it said it. Laid out like the Settings screen it is
|
|
95
|
+
* reached from: one card on the list ground.
|
|
96
|
+
*/
|
|
97
|
+
const ChangePasswordModal: React.FC<ChangePasswordModalProps> = ({ handleCloseModal }) => {
|
|
98
|
+
const theme = useTheme();
|
|
99
|
+
const t = useT();
|
|
100
|
+
const { showToast } = useToast();
|
|
101
|
+
const { config } = useChatSettingState();
|
|
102
|
+
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
103
|
+
const [current, setCurrent] = useState('');
|
|
104
|
+
const [next, setNext] = useState('');
|
|
105
|
+
const [again, setAgain] = useState('');
|
|
106
|
+
const [busy, setBusy] = useState(false);
|
|
107
|
+
const [error, setError] = useState('');
|
|
108
|
+
|
|
109
|
+
const mismatch = again.length > 0 && next !== again;
|
|
110
|
+
const tooShort = next.length > 0 && next.length < MIN_PASSWORD_LENGTH;
|
|
111
|
+
const sameAsCurrent = next.length > 0 && next === current;
|
|
112
|
+
const ready =
|
|
113
|
+
current.length > 0 &&
|
|
114
|
+
next.length >= MIN_PASSWORD_LENGTH &&
|
|
115
|
+
next === again &&
|
|
116
|
+
!sameAsCurrent &&
|
|
117
|
+
!busy;
|
|
118
|
+
|
|
119
|
+
const submit = useCallback(async () => {
|
|
120
|
+
if (!ready) {return;}
|
|
121
|
+
setBusy(true);
|
|
122
|
+
setError('');
|
|
123
|
+
try {
|
|
124
|
+
await changePassword(current, next);
|
|
125
|
+
showToast({
|
|
126
|
+
id: Date.now().toString(),
|
|
127
|
+
title: t('settings.password.title'),
|
|
128
|
+
message: t('settings.password.changed'),
|
|
129
|
+
type: 'success',
|
|
130
|
+
});
|
|
131
|
+
handleCloseModal();
|
|
132
|
+
} catch (err) {
|
|
133
|
+
const status = (err as any)?.response?.status;
|
|
134
|
+
setError(
|
|
135
|
+
serverReason(err) ||
|
|
136
|
+
(status === 400 || status === 401 || status === 403
|
|
137
|
+
? t('settings.password.wrongCurrent')
|
|
138
|
+
: t('settings.password.failed'))
|
|
139
|
+
);
|
|
140
|
+
setBusy(false);
|
|
141
|
+
}
|
|
142
|
+
}, [current, handleCloseModal, next, ready, showToast, t]);
|
|
143
|
+
|
|
144
|
+
const newError = tooShort
|
|
145
|
+
? t('settings.password.tooShort', { min: MIN_PASSWORD_LENGTH })
|
|
146
|
+
: sameAsCurrent
|
|
147
|
+
? t('settings.password.sameAsCurrent')
|
|
148
|
+
: undefined;
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<ModalContainerFullScreen style={styles.screen}>
|
|
152
|
+
<ModalHeaderComponent
|
|
153
|
+
handleCloseModal={handleCloseModal}
|
|
154
|
+
headerTitle={t('settings.password.title')}
|
|
155
|
+
titleStyle={chatTextStyle(config?.typography?.profile?.screenTitle)}
|
|
156
|
+
/>
|
|
157
|
+
<KeyboardAvoidingView
|
|
158
|
+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
159
|
+
style={styles.fill}
|
|
160
|
+
>
|
|
161
|
+
<ScrollView
|
|
162
|
+
style={styles.fill}
|
|
163
|
+
contentContainerStyle={styles.body}
|
|
164
|
+
keyboardShouldPersistTaps="handled"
|
|
165
|
+
>
|
|
166
|
+
<View style={styles.card} testID="settings-change-password">
|
|
167
|
+
<Field
|
|
168
|
+
testID="password-current"
|
|
169
|
+
label={t('settings.password.current')}
|
|
170
|
+
value={current}
|
|
171
|
+
onChangeText={setCurrent}
|
|
172
|
+
editable={!busy}
|
|
173
|
+
styles={styles}
|
|
174
|
+
theme={theme}
|
|
175
|
+
/>
|
|
176
|
+
<Field
|
|
177
|
+
testID="password-new"
|
|
178
|
+
label={t('settings.password.new')}
|
|
179
|
+
value={next}
|
|
180
|
+
onChangeText={setNext}
|
|
181
|
+
error={newError}
|
|
182
|
+
editable={!busy}
|
|
183
|
+
newPassword
|
|
184
|
+
styles={styles}
|
|
185
|
+
theme={theme}
|
|
186
|
+
/>
|
|
187
|
+
<Field
|
|
188
|
+
testID="password-again"
|
|
189
|
+
label={t('settings.password.again')}
|
|
190
|
+
value={again}
|
|
191
|
+
onChangeText={setAgain}
|
|
192
|
+
error={mismatch ? t('settings.password.mismatch') : undefined}
|
|
193
|
+
editable={!busy}
|
|
194
|
+
newPassword
|
|
195
|
+
onSubmitEditing={submit}
|
|
196
|
+
styles={styles}
|
|
197
|
+
theme={theme}
|
|
198
|
+
/>
|
|
199
|
+
<Text style={styles.hint}>{t('settings.password.hint')}</Text>
|
|
200
|
+
</View>
|
|
201
|
+
|
|
202
|
+
{!!error && (
|
|
203
|
+
<Text testID="password-error" style={styles.error}>
|
|
204
|
+
{error}
|
|
205
|
+
</Text>
|
|
206
|
+
)}
|
|
207
|
+
|
|
208
|
+
<TouchableOpacity
|
|
209
|
+
testID="password-submit"
|
|
210
|
+
accessibilityRole="button"
|
|
211
|
+
accessibilityState={{ disabled: !ready }}
|
|
212
|
+
activeOpacity={0.8}
|
|
213
|
+
disabled={!ready}
|
|
214
|
+
onPress={submit}
|
|
215
|
+
style={[styles.button, !ready ? styles.buttonDisabled : null]}
|
|
216
|
+
>
|
|
217
|
+
{busy ? (
|
|
218
|
+
<ActivityIndicator color={theme.textOnPrimary} />
|
|
219
|
+
) : (
|
|
220
|
+
<Text style={[styles.buttonText, !ready ? styles.buttonTextDisabled : null]}>
|
|
221
|
+
{t('settings.password.submit')}
|
|
222
|
+
</Text>
|
|
223
|
+
)}
|
|
224
|
+
</TouchableOpacity>
|
|
225
|
+
</ScrollView>
|
|
226
|
+
</KeyboardAvoidingView>
|
|
227
|
+
</ModalContainerFullScreen>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export default ChangePasswordModal;
|
|
232
|
+
|
|
233
|
+
const createStyles = (theme: ChatTheme) =>
|
|
234
|
+
StyleSheet.create({
|
|
235
|
+
screen: {
|
|
236
|
+
backgroundColor: theme.listBackground,
|
|
237
|
+
},
|
|
238
|
+
fill: {
|
|
239
|
+
flex: 1,
|
|
240
|
+
width: '100%',
|
|
241
|
+
},
|
|
242
|
+
body: {
|
|
243
|
+
padding: 12,
|
|
244
|
+
gap: 12,
|
|
245
|
+
paddingBottom: 32,
|
|
246
|
+
},
|
|
247
|
+
// Same surface as the Settings cards this screen is reached from.
|
|
248
|
+
card: {
|
|
249
|
+
backgroundColor: theme.surface,
|
|
250
|
+
borderRadius: 20,
|
|
251
|
+
paddingHorizontal: 20,
|
|
252
|
+
paddingVertical: 22,
|
|
253
|
+
gap: 18,
|
|
254
|
+
shadowColor: theme.shadow,
|
|
255
|
+
shadowOffset: { width: 0, height: 4 },
|
|
256
|
+
shadowOpacity: 0.06,
|
|
257
|
+
shadowRadius: 12,
|
|
258
|
+
elevation: 3,
|
|
259
|
+
},
|
|
260
|
+
field: {
|
|
261
|
+
gap: 8,
|
|
262
|
+
},
|
|
263
|
+
fieldLabel: {
|
|
264
|
+
fontSize: 14,
|
|
265
|
+
fontWeight: '500',
|
|
266
|
+
color: theme.textSecondary,
|
|
267
|
+
},
|
|
268
|
+
input: {
|
|
269
|
+
height: 48,
|
|
270
|
+
paddingHorizontal: 16,
|
|
271
|
+
borderRadius: 12,
|
|
272
|
+
borderWidth: 1,
|
|
273
|
+
borderColor: theme.border,
|
|
274
|
+
backgroundColor: theme.surfaceSecondary,
|
|
275
|
+
fontSize: 16,
|
|
276
|
+
color: theme.text,
|
|
277
|
+
},
|
|
278
|
+
inputError: {
|
|
279
|
+
borderColor: theme.danger,
|
|
280
|
+
},
|
|
281
|
+
fieldError: {
|
|
282
|
+
fontSize: 13,
|
|
283
|
+
lineHeight: 18,
|
|
284
|
+
color: theme.danger,
|
|
285
|
+
},
|
|
286
|
+
hint: {
|
|
287
|
+
fontSize: 13,
|
|
288
|
+
lineHeight: 18,
|
|
289
|
+
color: theme.textSecondary,
|
|
290
|
+
},
|
|
291
|
+
error: {
|
|
292
|
+
fontSize: 14,
|
|
293
|
+
lineHeight: 19,
|
|
294
|
+
paddingHorizontal: 8,
|
|
295
|
+
color: theme.danger,
|
|
296
|
+
},
|
|
297
|
+
button: {
|
|
298
|
+
minHeight: 48,
|
|
299
|
+
borderRadius: 14,
|
|
300
|
+
alignItems: 'center',
|
|
301
|
+
justifyContent: 'center',
|
|
302
|
+
paddingHorizontal: 20,
|
|
303
|
+
backgroundColor: theme.primary,
|
|
304
|
+
},
|
|
305
|
+
buttonDisabled: {
|
|
306
|
+
backgroundColor: theme.surfaceSecondary,
|
|
307
|
+
},
|
|
308
|
+
buttonText: {
|
|
309
|
+
fontSize: 16,
|
|
310
|
+
fontWeight: '600',
|
|
311
|
+
color: theme.textOnPrimary,
|
|
312
|
+
},
|
|
313
|
+
buttonTextDisabled: {
|
|
314
|
+
color: theme.textMuted,
|
|
315
|
+
},
|
|
316
|
+
});
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from '../SharedStyledComponents';
|
|
22
22
|
import { View } from 'react-native';
|
|
23
23
|
import { useTheme } from '../../../../hooks/useTheme';
|
|
24
|
+
import { useT } from '../../../../i18n/useT';
|
|
24
25
|
|
|
25
26
|
interface ManageDataModalProps {
|
|
26
27
|
handleCloseModal: any;
|
|
@@ -39,6 +40,7 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
39
40
|
}) => {
|
|
40
41
|
const { config } = useSelector((state: RootState) => state.chatSettingStore);
|
|
41
42
|
const theme = useTheme();
|
|
43
|
+
const t = useT();
|
|
42
44
|
|
|
43
45
|
const handleDownloadClick = async () => {
|
|
44
46
|
// const exportedData = await getExportMyData();
|
|
@@ -59,13 +61,13 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
59
61
|
<ModalContainerFullScreen>
|
|
60
62
|
<ModalHeaderComponent
|
|
61
63
|
handleCloseModal={handleCloseModal}
|
|
62
|
-
headerTitle={'
|
|
64
|
+
headerTitle={t('settings.manageData.title')}
|
|
63
65
|
/>
|
|
64
66
|
<SharedSettingsCenterContainer>
|
|
65
67
|
<SharedSettingsColumnContainer>
|
|
66
68
|
<SharedSettingsSectionContainer>
|
|
67
69
|
<SharedSettingsStyledLabel>
|
|
68
|
-
|
|
70
|
+
{t('settings.manageData.downloadLabel')}
|
|
69
71
|
</SharedSettingsStyledLabel>
|
|
70
72
|
<LabelData
|
|
71
73
|
style={{
|
|
@@ -73,25 +75,23 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
73
75
|
textAlign: 'left',
|
|
74
76
|
}}
|
|
75
77
|
>
|
|
76
|
-
|
|
77
|
-
data
|
|
78
|
+
{t('settings.manageData.downloadDescription')}
|
|
78
79
|
</LabelData>
|
|
79
80
|
</SharedSettingsSectionContainer>
|
|
80
81
|
<SharedSettingsStyledButton
|
|
81
82
|
borderColor={theme.primary}
|
|
82
83
|
onPress={handleDownloadClick}
|
|
83
|
-
text=
|
|
84
|
+
text={t('settings.manageData.downloadLabel')}
|
|
84
85
|
color={theme.primary}
|
|
85
86
|
/>
|
|
86
87
|
</SharedSettingsColumnContainer>
|
|
87
88
|
<SharedSettingsColumnContainer>
|
|
88
89
|
<SharedSettingsSectionContainer>
|
|
89
90
|
<SharedSettingsStyledLabel>
|
|
90
|
-
|
|
91
|
+
{t('settings.manageData.deleteLabel')}
|
|
91
92
|
</SharedSettingsStyledLabel>
|
|
92
93
|
<SharedSettingsLabelData>
|
|
93
|
-
|
|
94
|
-
data from our system.
|
|
94
|
+
{t('settings.manageData.deleteDescription')}
|
|
95
95
|
</SharedSettingsLabelData>
|
|
96
96
|
</SharedSettingsSectionContainer>
|
|
97
97
|
<SharedSettingsInfoPanel
|
|
@@ -101,17 +101,12 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
101
101
|
<InfoIcon color={theme.primary} />
|
|
102
102
|
</View>
|
|
103
103
|
<SharedSettingsInfoText>
|
|
104
|
-
|
|
105
|
-
network nodes operated by the community may still retain
|
|
106
|
-
historical transactions generated by your account, however your
|
|
107
|
-
personally identifiable information such as your name, e-mail,
|
|
108
|
-
your key-value storage etc will be removed. Any of your digital
|
|
109
|
-
assets will be lost.
|
|
104
|
+
{t('settings.manageData.deleteDisclosure')}
|
|
110
105
|
</SharedSettingsInfoText>
|
|
111
106
|
</SharedSettingsInfoPanel>
|
|
112
107
|
<SharedSettingsStyledButton
|
|
113
108
|
borderColor={theme.danger}
|
|
114
|
-
text=
|
|
109
|
+
text={t('action.deleteMyAccount')}
|
|
115
110
|
color={theme.danger}
|
|
116
111
|
/>
|
|
117
112
|
</SharedSettingsColumnContainer>
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from '../SharedStyledComponents';
|
|
17
17
|
import { RadioInput } from './RadioInput';
|
|
18
18
|
import { useTheme } from '../../../../hooks/useTheme';
|
|
19
|
+
import { useT } from '../../../../i18n/useT';
|
|
19
20
|
|
|
20
21
|
interface VisibilityModalProps {
|
|
21
22
|
handleCloseModal: any;
|
|
@@ -27,6 +28,7 @@ const VisibilityModal: React.FC<VisibilityModalProps> = ({
|
|
|
27
28
|
const dispatch = useDispatch();
|
|
28
29
|
const { user } = useSelector((state: RootState) => state.chatSettingStore);
|
|
29
30
|
const theme = useTheme();
|
|
31
|
+
const t = useT();
|
|
30
32
|
|
|
31
33
|
const doUpdateUser = (user: User) => dispatch(setUser(user));
|
|
32
34
|
const [isProfileOpen, setIsProfileOpen] = useState(user?.isProfileOpen);
|
|
@@ -67,17 +69,17 @@ const VisibilityModal: React.FC<VisibilityModalProps> = ({
|
|
|
67
69
|
<ModalContainerFullScreen>
|
|
68
70
|
<ModalHeaderComponent
|
|
69
71
|
handleCloseModal={handleCloseModal}
|
|
70
|
-
headerTitle={'
|
|
72
|
+
headerTitle={t('settings.visibility.title')}
|
|
71
73
|
/>
|
|
72
74
|
<SharedSettingsCenterContainer>
|
|
73
75
|
<SharedSettingsColumnContainer>
|
|
74
76
|
<SharedSettingsStyledLabel>
|
|
75
|
-
|
|
77
|
+
{t('settings.visibility.profileLabel')}
|
|
76
78
|
</SharedSettingsStyledLabel>
|
|
77
79
|
<RadioGroup>
|
|
78
80
|
<RadioLabel>
|
|
79
81
|
<RadioInput
|
|
80
|
-
option={{ label: '
|
|
82
|
+
option={{ label: t('settings.visibility.open'), value: isProfileOpen }}
|
|
81
83
|
radioColor={theme.primary}
|
|
82
84
|
checked={isProfileOpen === true}
|
|
83
85
|
onChange={() => setIsProfileOpen(true)}
|
|
@@ -85,50 +87,47 @@ const VisibilityModal: React.FC<VisibilityModalProps> = ({
|
|
|
85
87
|
</RadioLabel>
|
|
86
88
|
|
|
87
89
|
<SharedSettingsLabelData>
|
|
88
|
-
|
|
89
|
-
or QR code.
|
|
90
|
+
{t('settings.visibility.openDescription')}
|
|
90
91
|
</SharedSettingsLabelData>
|
|
91
92
|
<RadioLabel>
|
|
92
93
|
<RadioInput
|
|
93
|
-
option={{ label: '
|
|
94
|
+
option={{ label: t('settings.visibility.restricted'), value: isProfileOpen }}
|
|
94
95
|
radioColor={theme.primary}
|
|
95
96
|
checked={isProfileOpen === false}
|
|
96
97
|
onChange={() => setIsProfileOpen(false)}
|
|
97
98
|
/>
|
|
98
99
|
</RadioLabel>
|
|
99
100
|
<SharedSettingsLabelData>
|
|
100
|
-
|
|
101
|
-
your profile.
|
|
101
|
+
{t('settings.visibility.restrictedDescription')}
|
|
102
102
|
</SharedSettingsLabelData>
|
|
103
103
|
</RadioGroup>
|
|
104
104
|
</SharedSettingsColumnContainer>
|
|
105
105
|
<SharedSettingsColumnContainer>
|
|
106
106
|
<SharedSettingsStyledLabel>
|
|
107
|
-
|
|
107
|
+
{t('settings.visibility.documentsLabel')}
|
|
108
108
|
</SharedSettingsStyledLabel>
|
|
109
109
|
<RadioGroup>
|
|
110
110
|
<RadioLabel>
|
|
111
111
|
<RadioInput
|
|
112
|
-
option={{ label: '
|
|
112
|
+
option={{ label: t('settings.visibility.full'), value: isAssetsOpen }}
|
|
113
113
|
radioColor={theme.primary}
|
|
114
114
|
checked={isAssetsOpen === true}
|
|
115
115
|
onChange={() => setIsAssetsOpen(true)}
|
|
116
116
|
/>
|
|
117
117
|
</RadioLabel>
|
|
118
118
|
<SharedSettingsLabelData>
|
|
119
|
-
|
|
119
|
+
{t('settings.visibility.fullDescription')}
|
|
120
120
|
</SharedSettingsLabelData>
|
|
121
121
|
<RadioLabel>
|
|
122
122
|
<RadioInput
|
|
123
|
-
option={{ label: '
|
|
123
|
+
option={{ label: t('settings.visibility.individual'), value: isAssetsOpen }}
|
|
124
124
|
radioColor={theme.primary}
|
|
125
125
|
checked={isAssetsOpen === false}
|
|
126
126
|
onChange={() => setIsAssetsOpen(false)}
|
|
127
127
|
/>
|
|
128
128
|
</RadioLabel>
|
|
129
129
|
<SharedSettingsLabelData>
|
|
130
|
-
|
|
131
|
-
see them.
|
|
130
|
+
{t('settings.visibility.individualDescription')}
|
|
132
131
|
</SharedSettingsLabelData>
|
|
133
132
|
</RadioGroup>
|
|
134
133
|
</SharedSettingsColumnContainer>
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
EditIcon,
|
|
18
18
|
IconDoc,
|
|
19
19
|
LeaveIcon,
|
|
20
|
+
LockIcon,
|
|
20
21
|
LogoutIcon,
|
|
21
22
|
ProfileIcon,
|
|
22
23
|
ShareIcon,
|
|
@@ -38,12 +39,26 @@ import { MODAL_TYPES } from '../../../helpers/constants/MODAL_TYPES';
|
|
|
38
39
|
import {
|
|
39
40
|
setActiveFile,
|
|
40
41
|
setActiveModal,
|
|
41
|
-
setLangSource,
|
|
42
42
|
} from '../../../roomStore/chatSettingsSlice';
|
|
43
43
|
import { addRoomViaApi, setCurrentRoom } from '../../../roomStore/roomsSlice';
|
|
44
44
|
import { runLogoutFlow } from '../../Menu/HeaderRoomListMenu';
|
|
45
45
|
import { useLogout } from '../../../hooks/useLogout';
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
ApiRoom,
|
|
48
|
+
ownAppId,
|
|
49
|
+
postPrivateRoom,
|
|
50
|
+
} from '../../../networking/api-requests/rooms.api';
|
|
51
|
+
import EncryptionCard from '../../MainComponents/EncryptionCard';
|
|
52
|
+
import { accountNameOf } from '../../../helpers/accountName';
|
|
53
|
+
import { setChatLanguage } from '../../../services/languageSettings';
|
|
54
|
+
import { composeName } from '../../../helpers/displayName';
|
|
55
|
+
import { isUnresolvedSenderId } from '../../../helpers/isUnresolvedSenderId';
|
|
56
|
+
|
|
57
|
+
/** A name, unless it is only the account's id standing in for one. */
|
|
58
|
+
const nameOrNothing = (name?: string | null): string => {
|
|
59
|
+
const trimmed = String(name ?? '').trim();
|
|
60
|
+
return isUnresolvedSenderId(trimmed) ? '' : trimmed;
|
|
61
|
+
};
|
|
47
62
|
import {
|
|
48
63
|
getUserFiles,
|
|
49
64
|
isMediaFile,
|
|
@@ -51,7 +66,7 @@ import {
|
|
|
51
66
|
} from '../../../networking/api-requests/user.api';
|
|
52
67
|
import { createRoomFromApi } from '../../../helpers/createRoomFromApi';
|
|
53
68
|
import { walletToUsername } from '../../../helpers/walletUsername';
|
|
54
|
-
import {
|
|
69
|
+
import { } from '../../../types/types';
|
|
55
70
|
import {
|
|
56
71
|
ProfileHero,
|
|
57
72
|
ProfileTopBar,
|
|
@@ -191,13 +206,17 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
191
206
|
// AsyncStorage), including the host's confirm copy and callbacks.
|
|
192
207
|
const performLogout = useLogout();
|
|
193
208
|
const handleLogout = useCallback(() => {
|
|
194
|
-
runLogoutFlow(config?.logout ?? { enabled: true }, performLogout
|
|
195
|
-
|
|
209
|
+
runLogoutFlow(config?.logout ?? { enabled: true }, performLogout, {
|
|
210
|
+
label: t('menu.logout'),
|
|
211
|
+
message: t('menu.logoutConfirm'),
|
|
212
|
+
cancel: t('action.cancel'),
|
|
213
|
+
}).catch(() => {});
|
|
214
|
+
}, [config?.logout, performLogout, t]);
|
|
196
215
|
|
|
197
216
|
const handleShare = useCallback(async () => {
|
|
198
217
|
const name =
|
|
199
|
-
profileUser?.name ||
|
|
200
|
-
|
|
218
|
+
nameOrNothing(profileUser?.name) ||
|
|
219
|
+
composeName(profileUser?.firstName, profileUser?.lastName);
|
|
201
220
|
const id =
|
|
202
221
|
profileUser?.userJID ||
|
|
203
222
|
profileUser?.defaultWallet?.walletAddress ||
|
|
@@ -228,8 +247,8 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
228
247
|
|
|
229
248
|
showToast({
|
|
230
249
|
id: Date.now().toString(),
|
|
231
|
-
title: '
|
|
232
|
-
message: '
|
|
250
|
+
title: t('toast.success'),
|
|
251
|
+
message: t('toast.roomCreatedSuccess'),
|
|
233
252
|
type: 'success',
|
|
234
253
|
duration: 3000,
|
|
235
254
|
});
|
|
@@ -238,17 +257,18 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
238
257
|
}
|
|
239
258
|
};
|
|
240
259
|
|
|
241
|
-
const
|
|
260
|
+
const openPrivateRoom = useCallback(async (e2ee: boolean) => {
|
|
242
261
|
showToast({
|
|
243
262
|
id: Date.now().toString(),
|
|
244
|
-
title: '
|
|
245
|
-
message: '
|
|
263
|
+
title: t('toast.roomCreationTitle'),
|
|
264
|
+
message: t('toast.roomCreating'),
|
|
246
265
|
type: 'info',
|
|
247
266
|
duration: 3000,
|
|
248
267
|
});
|
|
249
268
|
if (config?.newArch) {
|
|
250
269
|
const newRoom = await postPrivateRoom(
|
|
251
|
-
selectedUser?.userJID ?? (selectedUser?.id || '')
|
|
270
|
+
selectedUser?.userJID ?? (selectedUser?.id || ''),
|
|
271
|
+
e2ee
|
|
252
272
|
);
|
|
253
273
|
handleRoomCreation(newRoom, 2);
|
|
254
274
|
} else {
|
|
@@ -281,7 +301,18 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
281
301
|
}
|
|
282
302
|
|
|
283
303
|
dispatch(setActiveModal(undefined));
|
|
284
|
-
}, [selectedUser]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
304
|
+
}, [selectedUser, t]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
305
|
+
|
|
306
|
+
const handlePrivateMessage = useCallback(
|
|
307
|
+
() => openPrivateRoom(false),
|
|
308
|
+
[openPrivateRoom]
|
|
309
|
+
);
|
|
310
|
+
const handleEncryptedPrivateMessage = useCallback(
|
|
311
|
+
() => openPrivateRoom(true),
|
|
312
|
+
[openPrivateRoom]
|
|
313
|
+
);
|
|
314
|
+
const canStartEncrypted =
|
|
315
|
+
config?.e2ee?.enabled === true && !!config?.newArch;
|
|
285
316
|
|
|
286
317
|
const openFile = (file: UserFile) => {
|
|
287
318
|
dispatch(
|
|
@@ -333,6 +364,16 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
333
364
|
icon: (color: string) => <ChatIcon color={color} />,
|
|
334
365
|
onPress: handlePrivateMessage,
|
|
335
366
|
},
|
|
367
|
+
...(canStartEncrypted
|
|
368
|
+
? [
|
|
369
|
+
{
|
|
370
|
+
key: 'encrypted-message',
|
|
371
|
+
label: t('action.encryptedMessage'),
|
|
372
|
+
icon: (color: string) => <LockIcon color={color} />,
|
|
373
|
+
onPress: handleEncryptedPrivateMessage,
|
|
374
|
+
},
|
|
375
|
+
]
|
|
376
|
+
: []),
|
|
336
377
|
]),
|
|
337
378
|
{
|
|
338
379
|
key: 'share',
|
|
@@ -341,7 +382,7 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
341
382
|
onPress: handleShare,
|
|
342
383
|
},
|
|
343
384
|
],
|
|
344
|
-
[isOwnProfile, t, handleShare, handlePrivateMessage, handleLogout] // eslint-disable-line react-hooks/exhaustive-deps
|
|
385
|
+
[isOwnProfile, t, handleShare, handlePrivateMessage, handleEncryptedPrivateMessage, canStartEncrypted, handleLogout] // eslint-disable-line react-hooks/exhaustive-deps
|
|
345
386
|
);
|
|
346
387
|
|
|
347
388
|
// Collapsed, the hero's round buttons are gone — the "…" menu carries
|
|
@@ -373,8 +414,8 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
373
414
|
}
|
|
374
415
|
|
|
375
416
|
const displayName =
|
|
376
|
-
profileUser?.name ||
|
|
377
|
-
|
|
417
|
+
nameOrNothing(profileUser?.name) ||
|
|
418
|
+
composeName(profileUser?.firstName, profileUser?.lastName) ||
|
|
378
419
|
t('modal.profile.title');
|
|
379
420
|
const heroImage =
|
|
380
421
|
appendFileToken(profileUser?.profileImage, fileToken) || null;
|
|
@@ -393,9 +434,12 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
393
434
|
testID={`${PREFIX}-language-${option.id}`}
|
|
394
435
|
activeOpacity={0.7}
|
|
395
436
|
style={styles.languageRow}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
437
|
+
// The same choice Settings offers as "chat language": kept
|
|
438
|
+
// on the device, and written to the profile when the host
|
|
439
|
+
// turned that on.
|
|
440
|
+
onPress={() => {
|
|
441
|
+
setChatLanguage(option.id).catch(() => {});
|
|
442
|
+
}}
|
|
399
443
|
>
|
|
400
444
|
<Text style={styles.languageLabel}>{option.name}</Text>
|
|
401
445
|
{selected && (
|
|
@@ -529,6 +573,14 @@ const UserProfileModal: React.FC<UserProfileModalProps> = ({
|
|
|
529
573
|
</Text>
|
|
530
574
|
</View>
|
|
531
575
|
|
|
576
|
+
{!isOwnProfile && config?.e2ee?.enabled === true && (
|
|
577
|
+
<EncryptionCard
|
|
578
|
+
account={accountNameOf(profileUser, ownAppId())}
|
|
579
|
+
style={styles.card}
|
|
580
|
+
testID="user-profile-e2ee"
|
|
581
|
+
/>
|
|
582
|
+
)}
|
|
583
|
+
|
|
532
584
|
{tabs.length > 0 && (
|
|
533
585
|
<View style={styles.card}>
|
|
534
586
|
<View style={styles.tabsRow}>
|