@ethora/chat-component-rn 26.8.1 → 26.8.2
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 +96 -0
- package/README.md +43 -10
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/AuthForms/Login.js +4 -4
- package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +29 -8
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +9 -3
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +150 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatWrapper.js +34 -13
- package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +29 -9
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +5 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +13 -5
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +322 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +546 -203
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +69 -27
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -106
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +563 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/styled/AudioMessage.js +2 -1
- package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +37 -9
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +80 -11
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +9 -3
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/components/styled/UnsupportedType.js +14 -4
- package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +119 -61
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +184 -59
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/createMessageFromXml.js +19 -1
- package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
- package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
- package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/commonjs/helpers/getChatBackground.js +23 -0
- package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
- package/lib/commonjs/helpers/getDisplayFileName.js +79 -0
- package/lib/commonjs/helpers/getDisplayFileName.js.map +1 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js +188 -0
- package/lib/commonjs/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/commonjs/helpers/historyPreloadScheduler.js +65 -2
- package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/commonjs/helpers/initXmppRooms.js +14 -8
- package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js +51 -9
- package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/commonjs/helpers/isOwnMessage.js +75 -0
- package/lib/commonjs/helpers/isOwnMessage.js.map +1 -0
- package/lib/commonjs/helpers/keyboardLayout.js +12 -2
- package/lib/commonjs/helpers/keyboardLayout.js.map +1 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/commonjs/helpers/mimeToExtension.js +6 -14
- package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
- package/lib/commonjs/helpers/msgSortableMs.js +37 -0
- package/lib/commonjs/helpers/msgSortableMs.js.map +1 -0
- package/lib/commonjs/helpers/persistCrypto.js +122 -0
- package/lib/commonjs/helpers/persistCrypto.js.map +1 -0
- package/lib/commonjs/helpers/pickImageAsset.js +68 -0
- package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
- package/lib/commonjs/helpers/pushPayload.js +71 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -0
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +130 -17
- package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/commonjs/helpers/secureFileUrl.js +101 -0
- package/lib/commonjs/helpers/secureFileUrl.js.map +1 -0
- package/lib/commonjs/helpers/secureKeyValue.js +83 -0
- package/lib/commonjs/helpers/secureKeyValue.js.map +1 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js +59 -0
- package/lib/commonjs/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/commonjs/helpers/secureUserStorage.js +75 -0
- package/lib/commonjs/helpers/secureUserStorage.js.map +1 -0
- package/lib/commonjs/helpers/shallowEqual.js +36 -0
- package/lib/commonjs/helpers/shallowEqual.js.map +1 -0
- package/lib/commonjs/helpers/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/hooks/useChatRoomFocus.js +45 -12
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useChatWrapperInit.js +30 -10
- package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/commonjs/hooks/useComposing.js +27 -0
- package/lib/commonjs/hooks/useComposing.js.map +1 -1
- package/lib/commonjs/hooks/useFileToken.js +10 -0
- package/lib/commonjs/hooks/useFileToken.js.map +1 -0
- package/lib/commonjs/hooks/useLogout.js +23 -7
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/usePendingNotification.js +8 -11
- package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +50 -14
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +145 -37
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +44 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/auth.api.js +134 -60
- package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +68 -9
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/apiClient.js +62 -112
- package/lib/commonjs/networking/apiClient.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +332 -0
- package/lib/commonjs/networking/authRefresh.js.map +1 -0
- package/lib/commonjs/networking/stanzaHandlers.js +41 -28
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +124 -8
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +26 -7
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/index.js +35 -2
- package/lib/commonjs/roomStore/index.js.map +1 -1
- package/lib/commonjs/roomStore/persistence.js +226 -23
- package/lib/commonjs/roomStore/persistence.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +151 -38
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/commonjs/services/pushSubscriptionService.js +15 -13
- package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/AuthForms/Login.js +4 -4
- package/lib/module/components/AuthForms/Login.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +29 -8
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +9 -3
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +152 -16
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/ChatWrapper.js +35 -14
- package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/LoginWrapper.js +2 -1
- package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +30 -10
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +5 -1
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +13 -5
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +207 -35
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +313 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +549 -207
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +70 -28
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js +2 -1
- package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +9 -1
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -108
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +555 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +9 -2
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +21 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js +22 -3
- package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +17 -3
- package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +6 -3
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/styled/AudioMessage.js +2 -1
- package/lib/module/components/styled/AudioMessage.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +37 -9
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +81 -12
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +9 -3
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/components/styled/UnsupportedType.js +14 -4
- package/lib/module/components/styled/UnsupportedType.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +120 -62
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/xmppProvider.js +184 -60
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/createMessageFromXml.js +19 -1
- package/lib/module/helpers/createMessageFromXml.js.map +1 -1
- package/lib/module/helpers/ensureScopedChatCache.js +2 -2
- package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
- package/lib/module/helpers/getChatBackground.js +18 -0
- package/lib/module/helpers/getChatBackground.js.map +1 -0
- package/lib/module/helpers/getDisplayFileName.js +73 -0
- package/lib/module/helpers/getDisplayFileName.js.map +1 -0
- package/lib/module/helpers/getServerReadTimestamp.js +181 -0
- package/lib/module/helpers/getServerReadTimestamp.js.map +1 -0
- package/lib/module/helpers/historyPreloadScheduler.js +66 -3
- package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
- package/lib/module/helpers/initXmppRooms.js +14 -8
- package/lib/module/helpers/initXmppRooms.js.map +1 -1
- package/lib/module/helpers/insertMessageWithDelimiter.js +52 -9
- package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
- package/lib/module/helpers/isOwnMessage.js +70 -0
- package/lib/module/helpers/isOwnMessage.js.map +1 -0
- package/lib/module/helpers/keyboardLayout.js +12 -2
- package/lib/module/helpers/keyboardLayout.js.map +1 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
- package/lib/module/helpers/mimeToExtension.js +6 -13
- package/lib/module/helpers/mimeToExtension.js.map +1 -1
- package/lib/module/helpers/msgSortableMs.js +32 -0
- package/lib/module/helpers/msgSortableMs.js.map +1 -0
- package/lib/module/helpers/persistCrypto.js +115 -0
- package/lib/module/helpers/persistCrypto.js.map +1 -0
- package/lib/module/helpers/pickImageAsset.js +63 -0
- package/lib/module/helpers/pickImageAsset.js.map +1 -0
- package/lib/module/helpers/pushPayload.js +63 -0
- package/lib/module/helpers/pushPayload.js.map +1 -0
- package/lib/module/helpers/resolveInitBeforeLoadUser.js +130 -16
- package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
- package/lib/module/helpers/secureFileUrl.js +91 -0
- package/lib/module/helpers/secureFileUrl.js.map +1 -0
- package/lib/module/helpers/secureKeyValue.js +75 -0
- package/lib/module/helpers/secureKeyValue.js.map +1 -0
- package/lib/module/helpers/secureStoreRuntime.js +52 -0
- package/lib/module/helpers/secureStoreRuntime.js.map +1 -0
- package/lib/module/helpers/secureUserStorage.js +72 -0
- package/lib/module/helpers/secureUserStorage.js.map +1 -0
- package/lib/module/helpers/shallowEqual.js +31 -0
- package/lib/module/helpers/shallowEqual.js.map +1 -0
- package/lib/module/helpers/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/hooks/useChatRoomFocus.js +46 -13
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useChatWrapperInit.js +30 -10
- package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
- package/lib/module/hooks/useComposing.js +28 -1
- package/lib/module/hooks/useComposing.js.map +1 -1
- package/lib/module/hooks/useFileToken.js +5 -0
- package/lib/module/hooks/useFileToken.js.map +1 -0
- package/lib/module/hooks/useLogout.js +23 -7
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/usePendingNotification.js +8 -11
- package/lib/module/hooks/usePendingNotification.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +52 -16
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js +6 -1
- package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
- package/lib/module/i18n/strings.js +145 -37
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +14 -2
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/auth.api.js +131 -59
- package/lib/module/networking/api-requests/auth.api.js.map +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
- package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +9 -9
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +64 -7
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/apiClient.js +61 -113
- package/lib/module/networking/apiClient.js.map +1 -1
- package/lib/module/networking/authRefresh.js +321 -0
- package/lib/module/networking/authRefresh.js.map +1 -0
- package/lib/module/networking/stanzaHandlers.js +41 -28
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +46 -8
- package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
- package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +5 -1
- package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
- package/lib/module/networking/xmppClient.js +124 -8
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +26 -7
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/index.js +37 -4
- package/lib/module/roomStore/index.js.map +1 -1
- package/lib/module/roomStore/persistence.js +223 -22
- package/lib/module/roomStore/persistence.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +139 -34
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/services/pushSubscriptionService.js +15 -13
- package/lib/module/services/pushSubscriptionService.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/assets/icons.d.ts +16 -0
- package/lib/typescript/assets/icons.d.ts.map +1 -1
- package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
- package/lib/typescript/components/Header/HeaderRoomList.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/LoginWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts +10 -1
- package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts +7 -0
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
- 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/NewChatModal/ModalContent.d.ts +4 -2
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
- package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
- package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
- package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts +14 -0
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
- package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts +8 -0
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
- package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts +49 -0
- package/lib/typescript/helpers/getDisplayFileName.d.ts.map +1 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts +108 -0
- package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +1 -0
- package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
- package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts +1 -1
- package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
- package/lib/typescript/helpers/isOwnMessage.d.ts +36 -0
- package/lib/typescript/helpers/isOwnMessage.d.ts.map +1 -0
- package/lib/typescript/helpers/keyboardLayout.d.ts +5 -1
- package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/mimeToExtension.d.ts +0 -15
- package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
- package/lib/typescript/helpers/msgSortableMs.d.ts +2 -0
- package/lib/typescript/helpers/msgSortableMs.d.ts.map +1 -0
- package/lib/typescript/helpers/persistCrypto.d.ts +13 -0
- package/lib/typescript/helpers/persistCrypto.d.ts.map +1 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
- package/lib/typescript/helpers/pushPayload.d.ts +7 -0
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -0
- package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
- package/lib/typescript/helpers/secureFileUrl.d.ts +7 -0
- package/lib/typescript/helpers/secureFileUrl.d.ts.map +1 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts +13 -0
- package/lib/typescript/helpers/secureKeyValue.d.ts.map +1 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts +29 -0
- package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +1 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts +23 -0
- package/lib/typescript/helpers/secureUserStorage.d.ts.map +1 -0
- package/lib/typescript/helpers/shallowEqual.d.ts +11 -0
- package/lib/typescript/helpers/shallowEqual.d.ts.map +1 -0
- package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/hooks/useChatRoomFocus.d.ts +4 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
- package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
- package/lib/typescript/hooks/useFileToken.d.ts +2 -0
- package/lib/typescript/hooks/useFileToken.d.ts.map +1 -0
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +1 -0
- package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +9 -2
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -1
- package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/apiClient.d.ts +12 -6
- package/lib/typescript/networking/apiClient.d.ts.map +1 -1
- package/lib/typescript/networking/authRefresh.d.ts +95 -0
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -0
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +10 -2
- package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +14 -0
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts +16 -0
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/index.d.ts.map +1 -1
- package/lib/typescript/roomStore/persistence.d.ts +18 -1
- package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +43 -3
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
- package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +50 -5
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +41 -28
- package/src/assets/icons.tsx +48 -9
- package/src/components/AuthForms/Login.tsx +3 -3
- package/src/components/Header/HeaderRoomList.tsx +29 -7
- package/src/components/MainComponents/ChatHeader.tsx +9 -3
- package/src/components/MainComponents/ChatRoom.tsx +161 -15
- package/src/components/MainComponents/ChatWrapper.tsx +36 -20
- package/src/components/MainComponents/LoginWrapper.tsx +1 -0
- package/src/components/MainComponents/MediaMessage.tsx +26 -8
- package/src/components/MainComponents/MessageContainer.tsx +5 -1
- package/src/components/MainComponents/MessageList.tsx +23 -4
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
- package/src/components/MainComponents/RoomList.tsx +236 -39
- package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +333 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +600 -282
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +79 -38
- package/src/components/Modals/FilePreviewModal/PdfView.tsx +2 -1
- package/src/components/Modals/Modal/Modal.tsx +7 -0
- package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -119
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +624 -0
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
- package/src/components/Modals/styledModalComponents.tsx +9 -2
- package/src/components/RoomComponents/ChatRoomItem.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageFile.tsx +28 -4
- package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +18 -3
- package/src/components/RoomComponents/styled/LastMessageVideo.tsx +18 -3
- package/src/components/VideoCalls/VideoCallSession.tsx +8 -3
- package/src/components/styled/AudioMessage.tsx +2 -1
- package/src/components/styled/MessageImage.tsx +53 -7
- package/src/components/styled/SendInput.tsx +83 -12
- package/src/components/styled/StyledComponents.ts +9 -3
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
- package/src/components/styled/UnsupportedType.tsx +14 -4
- package/src/components/styled/VideoMessage.tsx +131 -54
- package/src/context/xmppProvider.tsx +216 -57
- package/src/helpers/createMessageFromXml.ts +20 -1
- package/src/helpers/ensureScopedChatCache.ts +2 -2
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/getDisplayFileName.ts +87 -0
- package/src/helpers/getServerReadTimestamp.ts +197 -0
- package/src/helpers/historyPreloadScheduler.ts +80 -3
- package/src/helpers/initXmppRooms.tsx +14 -10
- package/src/helpers/insertMessageWithDelimiter.ts +55 -19
- package/src/helpers/isOwnMessage.ts +90 -0
- package/src/helpers/keyboardLayout.ts +23 -2
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/mimeToExtension.ts +6 -22
- package/src/helpers/msgSortableMs.ts +25 -0
- package/src/helpers/persistCrypto.ts +127 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/pushPayload.ts +62 -0
- package/src/helpers/resolveInitBeforeLoadUser.ts +125 -18
- package/src/helpers/secureFileUrl.ts +103 -0
- package/src/helpers/secureKeyValue.ts +80 -0
- package/src/helpers/secureStoreRuntime.ts +62 -0
- package/src/helpers/secureUserStorage.ts +80 -0
- package/src/helpers/shallowEqual.ts +33 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/hooks/useChatRoomFocus.ts +49 -9
- package/src/hooks/useChatWrapperInit.ts +30 -10
- package/src/hooks/useComposing.tsx +37 -1
- package/src/hooks/useFileToken.ts +7 -0
- package/src/hooks/useLogout.tsx +29 -9
- package/src/hooks/usePendingNotification.ts +5 -11
- package/src/hooks/useSendMessage.tsx +60 -15
- package/src/hooks/useUnreadMessagesCounter.ts +11 -0
- package/src/i18n/strings.ts +145 -37
- package/src/main.ts +26 -2
- package/src/networking/api-requests/auth.api.ts +156 -48
- package/src/networking/api-requests/roomMembers.api.ts +1 -1
- package/src/networking/api-requests/rooms.api.ts +9 -9
- package/src/networking/api-requests/user.api.ts +79 -7
- package/src/networking/apiClient.ts +68 -123
- package/src/networking/authRefresh.ts +451 -0
- package/src/networking/stanzaHandlers.ts +44 -28
- package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +71 -10
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +12 -1
- package/src/networking/xmppClient.ts +141 -9
- package/src/roomStore/chatSettingsSlice.ts +34 -10
- package/src/roomStore/index.ts +40 -4
- package/src/roomStore/persistence.ts +234 -24
- package/src/roomStore/roomsSlice.ts +161 -29
- package/src/services/pushSubscriptionService.ts +18 -13
- package/src/types/types.ts +72 -5
- package/src/version.ts +1 -1
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/** @format */
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
Viewider,
|
|
6
|
-
Label,
|
|
7
|
-
LabelData,
|
|
8
|
-
BorderedContainer,
|
|
9
|
-
CenterContainer,
|
|
10
|
-
} from '../styledModalComponents';
|
|
11
|
-
import ModalHeaderComponent from '../ModalHeaderComponent';
|
|
12
|
-
import Button from '../../styled/Button';
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
13
5
|
import { useDispatch } from 'react-redux';
|
|
6
|
+
import { ModalContainerFullScreen } from '../styledModalComponents';
|
|
7
|
+
import ModalHeaderComponent from '../ModalHeaderComponent';
|
|
8
|
+
import { ArowDownIcon } from '../../../assets/icons';
|
|
14
9
|
import { setActiveModal } from '../../../roomStore/chatSettingsSlice';
|
|
15
10
|
import { MODAL_TYPES } from '../../../helpers/constants/MODAL_TYPES';
|
|
11
|
+
import { useChatSettingState } from '../../../hooks/useChatSettingState';
|
|
12
|
+
import { chatTextStyle } from '../../../helpers/typography';
|
|
13
|
+
import { useT } from '../../../i18n/useT';
|
|
16
14
|
|
|
17
15
|
interface UserSettingsModalProps {
|
|
18
16
|
handleCloseModal: any;
|
|
@@ -21,65 +19,84 @@ interface UserSettingsModalProps {
|
|
|
21
19
|
const UserSettingsModal: React.FC<UserSettingsModalProps> = ({
|
|
22
20
|
handleCloseModal,
|
|
23
21
|
}) => {
|
|
22
|
+
const t = useT();
|
|
23
|
+
const dispatch = useDispatch();
|
|
24
|
+
const { config } = useChatSettingState();
|
|
25
|
+
|
|
24
26
|
const options = useMemo(
|
|
25
27
|
() => [
|
|
26
|
-
{
|
|
27
|
-
{
|
|
28
|
-
// { value: 'Profile Shares', key: MODAL_TYPES.PROFILE_SHARES },
|
|
29
|
-
// { value: 'Document Shares', key: MODAL_TYPES.DOCUMENT_SHARES },
|
|
30
|
-
// { value: 'Blocked Users', key: MODAL_TYPES.BLOCKED_USERS },
|
|
31
|
-
// { value: 'Referrals', key: MODAL_TYPES.REFERRALS },
|
|
28
|
+
{ label: t('settings.manageData.title'), key: MODAL_TYPES.MANAGE_DATA },
|
|
29
|
+
{ label: t('settings.visibility.title'), key: MODAL_TYPES.VISIBILITY },
|
|
32
30
|
],
|
|
33
|
-
[]
|
|
31
|
+
[t]
|
|
34
32
|
);
|
|
35
33
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const handleClick = useCallback(
|
|
35
|
+
(key: string) => {
|
|
36
|
+
dispatch(setActiveModal(key as any));
|
|
37
|
+
},
|
|
38
|
+
[dispatch]
|
|
39
|
+
);
|
|
41
40
|
|
|
42
41
|
return (
|
|
43
|
-
<ModalContainerFullScreen>
|
|
42
|
+
<ModalContainerFullScreen style={styles.screen}>
|
|
44
43
|
<ModalHeaderComponent
|
|
45
44
|
handleCloseModal={handleCloseModal}
|
|
46
|
-
headerTitle={'
|
|
45
|
+
headerTitle={t('settings.menu.title')}
|
|
46
|
+
titleStyle={chatTextStyle(config?.typography?.profile?.screenTitle)}
|
|
47
47
|
/>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
gap: 2,
|
|
66
|
-
width: '100%',
|
|
67
|
-
justifyContent: 'center',
|
|
68
|
-
borderRadius: 0,
|
|
69
|
-
alignItems: 'flex-start',
|
|
70
|
-
}}
|
|
71
|
-
onPress={() => handleClick(option.key)}
|
|
72
|
-
>
|
|
73
|
-
<Label style={{ textAlign: 'center' }}>{option.value}</Label>
|
|
74
|
-
{[2, 3, 4].includes(index) && <LabelData>0</LabelData>}
|
|
75
|
-
</Button>
|
|
76
|
-
{index < 5 && <Viewider />}
|
|
77
|
-
</>
|
|
78
|
-
))}
|
|
79
|
-
</BorderedContainer>
|
|
80
|
-
</CenterContainer>
|
|
48
|
+
{/* One card per entry, rather than a single bordered block with
|
|
49
|
+
* hairline dividers — the rows are separate destinations, and the
|
|
50
|
+
* design gives each its own surface. */}
|
|
51
|
+
<View style={styles.body}>
|
|
52
|
+
{options.map((option) => (
|
|
53
|
+
<TouchableOpacity
|
|
54
|
+
key={option.key}
|
|
55
|
+
testID={`settings-row-${option.key}`}
|
|
56
|
+
activeOpacity={0.7}
|
|
57
|
+
style={styles.card}
|
|
58
|
+
onPress={() => handleClick(option.key)}
|
|
59
|
+
>
|
|
60
|
+
<Text style={styles.label}>{option.label}</Text>
|
|
61
|
+
<ArowDownIcon color="#8C8C8C" width={20} height={20} style={styles.chevron} />
|
|
62
|
+
</TouchableOpacity>
|
|
63
|
+
))}
|
|
64
|
+
</View>
|
|
81
65
|
</ModalContainerFullScreen>
|
|
82
66
|
);
|
|
83
67
|
};
|
|
84
68
|
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
screen: {
|
|
71
|
+
backgroundColor: '#E8EDF2',
|
|
72
|
+
},
|
|
73
|
+
body: {
|
|
74
|
+
width: '100%',
|
|
75
|
+
padding: 12,
|
|
76
|
+
gap: 12,
|
|
77
|
+
},
|
|
78
|
+
card: {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'space-between',
|
|
82
|
+
backgroundColor: '#FFFFFF',
|
|
83
|
+
borderRadius: 20,
|
|
84
|
+
paddingHorizontal: 20,
|
|
85
|
+
paddingVertical: 22,
|
|
86
|
+
shadowColor: '#101828',
|
|
87
|
+
shadowOffset: { width: 0, height: 4 },
|
|
88
|
+
shadowOpacity: 0.06,
|
|
89
|
+
shadowRadius: 12,
|
|
90
|
+
elevation: 3,
|
|
91
|
+
},
|
|
92
|
+
label: {
|
|
93
|
+
fontSize: 17,
|
|
94
|
+
fontWeight: '500',
|
|
95
|
+
color: '#141414',
|
|
96
|
+
},
|
|
97
|
+
chevron: {
|
|
98
|
+
transform: [{ rotate: '-90deg' }],
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
85
102
|
export default UserSettingsModal;
|
|
@@ -86,8 +86,15 @@ export const HeaderContainer = styled.View`
|
|
|
86
86
|
* button and 8px below — properly sized and properly centered. */
|
|
87
87
|
padding: 8px 16px;
|
|
88
88
|
background-color: #fff;
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
/* Same card treatment as the room-list header: rounded bottom corners
|
|
90
|
+
* and a soft drop shadow instead of a hairline rule. */
|
|
91
|
+
border-bottom-left-radius: 20px;
|
|
92
|
+
border-bottom-right-radius: 20px;
|
|
93
|
+
shadow-color: #101828;
|
|
94
|
+
shadow-offset: 0px 4px;
|
|
95
|
+
shadow-opacity: 0.06;
|
|
96
|
+
shadow-radius: 12px;
|
|
97
|
+
elevation: 4;
|
|
91
98
|
z-index: 1;
|
|
92
99
|
flex-direction: row;
|
|
93
100
|
justify-content: space-between;
|
|
@@ -2,6 +2,8 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { RootState } from '../../roomStore';
|
|
4
4
|
import { IMessage } from '../../types/types';
|
|
5
|
+
import { useFileToken } from '../../hooks/useFileToken';
|
|
6
|
+
import { appendFileToken } from '../../helpers/secureFileUrl';
|
|
5
7
|
import { IConfig, IRoom } from '../../types/types';
|
|
6
8
|
import { ProfileImagePlaceholder } from '../MainComponents/ProfileImagePlaceholder';
|
|
7
9
|
import {
|
|
@@ -29,6 +31,8 @@ const ChatRoomItem: React.FC<ChatRoomItemProps> = ({
|
|
|
29
31
|
isDriver,
|
|
30
32
|
config,
|
|
31
33
|
}) => {
|
|
34
|
+
// Room icons can live on the membership-gated secure-files host.
|
|
35
|
+
const fileToken = useFileToken();
|
|
32
36
|
const displayName = String(chat?.title || chat?.name || '').trim();
|
|
33
37
|
|
|
34
38
|
// usersSet is the canonical name store — the same one Message.tsx
|
|
@@ -130,7 +134,13 @@ const ChatRoomItem: React.FC<ChatRoomItemProps> = ({
|
|
|
130
134
|
|
|
131
135
|
return (
|
|
132
136
|
<ChatItem key={index}>
|
|
133
|
-
<
|
|
137
|
+
<View pointerEvents="none">
|
|
138
|
+
<ProfileImagePlaceholder
|
|
139
|
+
name={displayName}
|
|
140
|
+
icon={appendFileToken(chat?.icon, fileToken)}
|
|
141
|
+
active={false}
|
|
142
|
+
/>
|
|
143
|
+
</View>
|
|
134
144
|
<View
|
|
135
145
|
style={{
|
|
136
146
|
flexDirection: 'column',
|
|
@@ -140,7 +150,9 @@ const ChatRoomItem: React.FC<ChatRoomItemProps> = ({
|
|
|
140
150
|
paddingVertical: 8,
|
|
141
151
|
paddingRight: 8,
|
|
142
152
|
borderBottomWidth: 1,
|
|
143
|
-
|
|
153
|
+
// Reads against the list's #E8EDF2 ground; #F0F0F0 was lighter
|
|
154
|
+
// than the ground itself, so the row separators vanished.
|
|
155
|
+
borderBottomColor: '#C6CFDA',
|
|
144
156
|
}}
|
|
145
157
|
>
|
|
146
158
|
<View
|
|
@@ -251,8 +263,11 @@ const ChatRoomItem: React.FC<ChatRoomItemProps> = ({
|
|
|
251
263
|
) : null}
|
|
252
264
|
</View>
|
|
253
265
|
{isDriver && (
|
|
266
|
+
// Darker than the list's own ground (#E8EDF2), otherwise the
|
|
267
|
+
// separator disappears into it — white and the old #0052CD0D
|
|
268
|
+
// hairline both did.
|
|
254
269
|
<View
|
|
255
|
-
style={{ height: 1, backgroundColor: '#
|
|
270
|
+
style={{ height: 1, backgroundColor: '#C6CFDA', marginTop: 8 }}
|
|
256
271
|
/>
|
|
257
272
|
)}
|
|
258
273
|
</View>
|
|
@@ -8,9 +8,19 @@ import {
|
|
|
8
8
|
} from './StyledRoomComponents';
|
|
9
9
|
import { FileIcon } from '../../../assets/icons';
|
|
10
10
|
import { Image, View } from 'react-native';
|
|
11
|
+
import { useFileToken } from '../../../hooks/useFileToken';
|
|
12
|
+
import {
|
|
13
|
+
appendFileToken,
|
|
14
|
+
isSecureFileUrl,
|
|
15
|
+
requestFileTokenRecovery,
|
|
16
|
+
} from '../../../helpers/secureFileUrl';
|
|
17
|
+
import { getDisplayFileName } from '../../../helpers/getDisplayFileName';
|
|
11
18
|
|
|
12
19
|
interface LastMessageFileProps
|
|
13
|
-
extends Pick<
|
|
20
|
+
extends Pick<
|
|
21
|
+
LastMessage,
|
|
22
|
+
'user' | 'originalName' | 'fileName' | 'mimetype' | 'locationPreview'
|
|
23
|
+
> {}
|
|
14
24
|
|
|
15
25
|
const fallbackImage =
|
|
16
26
|
'https://as2.ftcdn.net/v2/jpg/02/51/95/53/1000_F_251955356_FAQH0U1y1TZw3ZcdPGybwUkH90a3VAhb.jpg';
|
|
@@ -18,9 +28,18 @@ const fallbackImage =
|
|
|
18
28
|
const LastMessageFile: FC<LastMessageFileProps> = ({
|
|
19
29
|
user,
|
|
20
30
|
originalName,
|
|
31
|
+
fileName,
|
|
32
|
+
mimetype,
|
|
21
33
|
locationPreview,
|
|
22
34
|
}) => {
|
|
23
35
|
const [imgSrc, setImgSrc] = useState(locationPreview);
|
|
36
|
+
const fileToken = useFileToken();
|
|
37
|
+
// Bug #40: prefer the sender's original name over the stored hash
|
|
38
|
+
// name; only fall back to the generic "file" label when neither is
|
|
39
|
+
// present at all (avoids a synthetic "media_<timestamp>.bin" here).
|
|
40
|
+
const displayName = originalName || fileName
|
|
41
|
+
? getDisplayFileName({ originalName, fileName, mimetype })
|
|
42
|
+
: 'file';
|
|
24
43
|
|
|
25
44
|
return (
|
|
26
45
|
<LastRoomMessageContainer>
|
|
@@ -34,18 +53,23 @@ const LastMessageFile: FC<LastMessageFileProps> = ({
|
|
|
34
53
|
>
|
|
35
54
|
{imgSrc ? (
|
|
36
55
|
<Image
|
|
37
|
-
source={{ uri: imgSrc }}
|
|
56
|
+
source={{ uri: appendFileToken(imgSrc, fileToken) }}
|
|
38
57
|
style={{
|
|
39
58
|
borderRadius: 16,
|
|
40
59
|
width: 20,
|
|
41
60
|
height: 20,
|
|
42
61
|
}}
|
|
43
|
-
onError={() =>
|
|
62
|
+
onError={() => {
|
|
63
|
+
if (isSecureFileUrl(imgSrc)) {
|
|
64
|
+
requestFileTokenRecovery();
|
|
65
|
+
}
|
|
66
|
+
setImgSrc(fallbackImage);
|
|
67
|
+
}}
|
|
44
68
|
/>
|
|
45
69
|
) : (
|
|
46
70
|
<FileIcon style={{ width: '20px', height: '20px' }} />
|
|
47
71
|
)}
|
|
48
|
-
<LastRoomMessageText>{
|
|
72
|
+
<LastRoomMessageText>{displayName}</LastRoomMessageText>
|
|
49
73
|
</View>
|
|
50
74
|
</LastRoomMessageContainer>
|
|
51
75
|
);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
import { useFileToken } from '../../../hooks/useFileToken';
|
|
3
|
+
import { appendFileToken } from '../../../helpers/secureFileUrl';
|
|
2
4
|
import styled from 'styled-components/native';
|
|
3
5
|
import { LastMessage } from '../../../types/types';
|
|
4
6
|
import {
|
|
@@ -9,6 +11,7 @@ import {
|
|
|
9
11
|
ShadeWrapper,
|
|
10
12
|
} from './StyledRoomComponents';
|
|
11
13
|
import { View } from 'react-native';
|
|
14
|
+
import { getDisplayFileName } from '../../../helpers/getDisplayFileName';
|
|
12
15
|
|
|
13
16
|
const PhotoContainer = styled.View`
|
|
14
17
|
position: relative;
|
|
@@ -23,13 +26,25 @@ const PhotoContainer = styled.View`
|
|
|
23
26
|
`;
|
|
24
27
|
|
|
25
28
|
interface LastMessagePhotoProps
|
|
26
|
-
extends Pick<
|
|
29
|
+
extends Pick<
|
|
30
|
+
LastMessage,
|
|
31
|
+
'user' | 'originalName' | 'fileName' | 'mimetype' | 'locationPreview'
|
|
32
|
+
> {}
|
|
27
33
|
|
|
28
34
|
const LastMessagePhoto: FC<LastMessagePhotoProps> = ({
|
|
29
35
|
user,
|
|
30
36
|
locationPreview,
|
|
31
37
|
originalName,
|
|
38
|
+
fileName,
|
|
39
|
+
mimetype,
|
|
32
40
|
}) => {
|
|
41
|
+
const fileToken = useFileToken();
|
|
42
|
+
// Bug #40: prefer the sender's original name over the stored hash
|
|
43
|
+
// name; only fall back to the generic "file" label when neither is
|
|
44
|
+
// present at all (avoids a synthetic "media_<timestamp>.bin" here).
|
|
45
|
+
const displayName = originalName || fileName
|
|
46
|
+
? getDisplayFileName({ originalName, fileName, mimetype })
|
|
47
|
+
: 'file';
|
|
33
48
|
return (
|
|
34
49
|
<LastRoomMessageContainer>
|
|
35
50
|
<LastRoomMessageName>{user?.name || ''}:</LastRoomMessageName>
|
|
@@ -42,10 +57,10 @@ const LastMessagePhoto: FC<LastMessagePhotoProps> = ({
|
|
|
42
57
|
>
|
|
43
58
|
<PhotoContainer>
|
|
44
59
|
<ShadeWrapper>
|
|
45
|
-
<LastMessageImg src={locationPreview} />
|
|
60
|
+
<LastMessageImg src={appendFileToken(locationPreview, fileToken)} />
|
|
46
61
|
</ShadeWrapper>
|
|
47
62
|
</PhotoContainer>
|
|
48
|
-
<LastRoomMessageText>{
|
|
63
|
+
<LastRoomMessageText>{displayName}</LastRoomMessageText>
|
|
49
64
|
</View>
|
|
50
65
|
</LastRoomMessageContainer>
|
|
51
66
|
);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
import { useFileToken } from '../../../hooks/useFileToken';
|
|
3
|
+
import { appendFileToken } from '../../../helpers/secureFileUrl';
|
|
2
4
|
import styled from 'styled-components/native';
|
|
3
5
|
import { LastMessage } from '../../../types/types';
|
|
4
6
|
import {
|
|
@@ -8,6 +10,7 @@ import {
|
|
|
8
10
|
ShadeWrapper,
|
|
9
11
|
} from './StyledRoomComponents';
|
|
10
12
|
import { Text, View } from 'react-native';
|
|
13
|
+
import { getDisplayFileName } from '../../../helpers/getDisplayFileName';
|
|
11
14
|
|
|
12
15
|
const VideoContainer = styled.View`
|
|
13
16
|
position: relative;
|
|
@@ -38,13 +41,25 @@ const PlayButton = styled.View`
|
|
|
38
41
|
`;
|
|
39
42
|
|
|
40
43
|
interface LastMessageVideoProps
|
|
41
|
-
extends Pick<
|
|
44
|
+
extends Pick<
|
|
45
|
+
LastMessage,
|
|
46
|
+
'user' | 'location' | 'originalName' | 'fileName' | 'mimetype'
|
|
47
|
+
> {}
|
|
42
48
|
|
|
43
49
|
const LastMessageVideo: FC<LastMessageVideoProps> = ({
|
|
44
50
|
user,
|
|
45
51
|
location,
|
|
46
52
|
originalName,
|
|
53
|
+
fileName,
|
|
54
|
+
mimetype,
|
|
47
55
|
}) => {
|
|
56
|
+
const fileToken = useFileToken();
|
|
57
|
+
// Bug #40: prefer the sender's original name over the stored hash
|
|
58
|
+
// name; only fall back to the generic "file" label when neither is
|
|
59
|
+
// present at all (avoids a synthetic "media_<timestamp>.bin" here).
|
|
60
|
+
const displayName = originalName || fileName
|
|
61
|
+
? getDisplayFileName({ originalName, fileName, mimetype })
|
|
62
|
+
: 'file';
|
|
48
63
|
return (
|
|
49
64
|
<LastRoomMessageContainer>
|
|
50
65
|
<LastRoomMessageName>{user?.name || ''}:</LastRoomMessageName>
|
|
@@ -57,11 +72,11 @@ const LastMessageVideo: FC<LastMessageVideoProps> = ({
|
|
|
57
72
|
>
|
|
58
73
|
<VideoContainer>
|
|
59
74
|
<ShadeWrapper>
|
|
60
|
-
<Thumbnail src={location} />
|
|
75
|
+
<Thumbnail src={appendFileToken(location, fileToken)} />
|
|
61
76
|
</ShadeWrapper>
|
|
62
77
|
<PlayButton><Text>▶</Text></PlayButton>
|
|
63
78
|
</VideoContainer>
|
|
64
|
-
<LastRoomMessageText>{
|
|
79
|
+
<LastRoomMessageText>{displayName}</LastRoomMessageText>
|
|
65
80
|
</View>
|
|
66
81
|
</LastRoomMessageContainer>
|
|
67
82
|
);
|
|
@@ -345,9 +345,14 @@ export const VideoCallSession: FC<VideoCallSessionProps> = ({
|
|
|
345
345
|
if (!runtime) {return;}
|
|
346
346
|
try {
|
|
347
347
|
if (Platform.OS === 'android') {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
// NB: not `setAndroidAudioConfiguration` — that method has never
|
|
349
|
+
// existed on AudioSession (the old `?.` call silently no-oped, so
|
|
350
|
+
// the speaker icon toggled while audio stayed on the earpiece).
|
|
351
|
+
// `selectAudioOutput` routes directly; on Android its device ids
|
|
352
|
+
// are the literal strings 'speaker' / 'earpiece'.
|
|
353
|
+
await runtime.AudioSession.selectAudioOutput(
|
|
354
|
+
next ? 'speaker' : 'earpiece'
|
|
355
|
+
);
|
|
351
356
|
} else {
|
|
352
357
|
await runtime.AudioSession.setAppleAudioConfiguration?.({
|
|
353
358
|
audioCategory: 'playAndRecord',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { withFileToken } from '../../helpers/secureFileUrl';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
TouchableOpacity,
|
|
@@ -425,7 +426,7 @@ const AudioMessage = ({
|
|
|
425
426
|
const partInfo = await FileSystem.getInfoAsync(part);
|
|
426
427
|
if (!partInfo.exists) {
|
|
427
428
|
const download = await withTimeout(
|
|
428
|
-
FileSystem.downloadAsync(src, part),
|
|
429
|
+
FileSystem.downloadAsync(withFileToken(src), part),
|
|
429
430
|
12000,
|
|
430
431
|
'audio_download_timeout'
|
|
431
432
|
);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
isSecureFileUrl,
|
|
4
|
+
requestFileTokenRecovery,
|
|
5
|
+
} from '../../helpers/secureFileUrl';
|
|
6
|
+
import { pushLog } from '../../utils/devLogger';
|
|
2
7
|
import { Container } from './StyledInputComponents/MediaComponents';
|
|
3
8
|
import { useDispatch } from 'react-redux';
|
|
4
9
|
import {
|
|
@@ -14,19 +19,43 @@ import {
|
|
|
14
19
|
} from '../../helpers/mediaDimensions';
|
|
15
20
|
|
|
16
21
|
interface CustomMessageImageProps {
|
|
22
|
+
/** Full-size file. Opened in the preview modal, NOT rendered inline. */
|
|
17
23
|
fileURL: string;
|
|
18
24
|
fileName: string;
|
|
25
|
+
/**
|
|
26
|
+
* The sender's original file name (bug #40) - kept alongside `fileName`
|
|
27
|
+
* so the preview modal's save/share/download logic can prefer it over
|
|
28
|
+
* the server's stored/hashed name.
|
|
29
|
+
*/
|
|
30
|
+
originalName?: string;
|
|
19
31
|
mimetype: string;
|
|
32
|
+
/**
|
|
33
|
+
* Server-generated thumbnail — what the bubble actually renders, same
|
|
34
|
+
* as the web client. The full-size original can be many megabytes and,
|
|
35
|
+
* for secure uploads, is served from a different (membership-gated)
|
|
36
|
+
* route; rendering it inline is what left the bubbles blank.
|
|
37
|
+
*/
|
|
38
|
+
locationPreview?: string;
|
|
20
39
|
}
|
|
21
40
|
|
|
41
|
+
/** Keep the personal file token out of the logs. */
|
|
42
|
+
const maskToken = (url?: string) =>
|
|
43
|
+
(url || '').replace(/([?&]ft=)[^&]*/i, '$1<redacted>');
|
|
44
|
+
|
|
22
45
|
const FALLBACK_IMAGE =
|
|
23
46
|
'https://as2.ftcdn.net/v2/jpg/02/51/95/53/1000_F_251955356_FAQH0U1y1TZw3ZcdPGybwUkH90a3VAhb.jpg';
|
|
24
47
|
|
|
25
48
|
const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
26
49
|
fileURL,
|
|
27
50
|
fileName,
|
|
51
|
+
originalName,
|
|
28
52
|
mimetype,
|
|
53
|
+
locationPreview,
|
|
29
54
|
}) => {
|
|
55
|
+
// Preview first, original only as a fallback — mirrors the web client,
|
|
56
|
+
// where the <img> src is the preview and `fileURL` is reserved for the
|
|
57
|
+
// modal.
|
|
58
|
+
const displayURL = locationPreview || fileURL;
|
|
30
59
|
const [loading, setLoading] = useState(true);
|
|
31
60
|
// Start with a neutral box; swap to the real aspect ratio once the
|
|
32
61
|
// image's natural dimensions are known so it's shown scaled, not cropped.
|
|
@@ -35,28 +64,34 @@ const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
|
35
64
|
const dispatch = useDispatch();
|
|
36
65
|
|
|
37
66
|
useEffect(() => {
|
|
38
|
-
if (!
|
|
67
|
+
if (!displayURL) {
|
|
39
68
|
return;
|
|
40
69
|
}
|
|
41
70
|
let active = true;
|
|
42
71
|
Image.getSize(
|
|
43
|
-
|
|
72
|
+
displayURL,
|
|
44
73
|
(w, h) => {
|
|
45
74
|
if (active) {
|
|
46
75
|
setDims(fitMediaDimensions(w, h));
|
|
47
76
|
}
|
|
48
77
|
},
|
|
49
|
-
() => {
|
|
50
|
-
|
|
78
|
+
(error) => {
|
|
79
|
+
// Keep the default box — but say WHICH url failed. A blank
|
|
80
|
+
// bubble is otherwise indistinguishable between "bad url",
|
|
81
|
+
// "403 without a token" and "host unreachable".
|
|
82
|
+
pushLog('warn', 'image: getSize failed', {
|
|
83
|
+
url: maskToken(displayURL),
|
|
84
|
+
error: (error as any)?.message || String(error),
|
|
85
|
+
});
|
|
51
86
|
}
|
|
52
87
|
);
|
|
53
88
|
return () => {
|
|
54
89
|
active = false;
|
|
55
90
|
};
|
|
56
|
-
}, [
|
|
91
|
+
}, [displayURL]);
|
|
57
92
|
|
|
58
93
|
const handleOpen = () => {
|
|
59
|
-
dispatch(setActiveFile({ fileName, fileURL, mimetype }));
|
|
94
|
+
dispatch(setActiveFile({ fileName, fileURL, mimetype, originalName }));
|
|
60
95
|
dispatch(setActiveModal(MODAL_TYPES.FILE_PREVIEW));
|
|
61
96
|
};
|
|
62
97
|
|
|
@@ -78,7 +113,7 @@ const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
|
78
113
|
</View>
|
|
79
114
|
)}
|
|
80
115
|
<Image
|
|
81
|
-
source={{ uri:
|
|
116
|
+
source={{ uri: displayURL || FALLBACK_IMAGE }}
|
|
82
117
|
style={{
|
|
83
118
|
width: dims.width,
|
|
84
119
|
height: dims.height,
|
|
@@ -86,6 +121,17 @@ const CustomMessageImage: React.FC<CustomMessageImageProps> = ({
|
|
|
86
121
|
backgroundColor: 'rgba(0, 0, 0, 0)',
|
|
87
122
|
}}
|
|
88
123
|
onLoadEnd={() => setLoading(false)}
|
|
124
|
+
onError={(event) => {
|
|
125
|
+
setLoading(false);
|
|
126
|
+
pushLog('warn', 'image: load failed', {
|
|
127
|
+
url: maskToken(displayURL),
|
|
128
|
+
usingPreview: !!locationPreview,
|
|
129
|
+
error: (event as any)?.nativeEvent?.error,
|
|
130
|
+
});
|
|
131
|
+
if (isSecureFileUrl(displayURL)) {
|
|
132
|
+
requestFileTokenRecovery();
|
|
133
|
+
}
|
|
134
|
+
}}
|
|
89
135
|
// The box already matches the natural aspect ratio, so 'cover'
|
|
90
136
|
// fills it edge-to-edge with no actual cropping or letterboxing.
|
|
91
137
|
resizeMode="cover"
|