@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
|
@@ -10,14 +10,16 @@ import { IConfig, MediaFile } from '../../types/types';
|
|
|
10
10
|
import Button from './Button';
|
|
11
11
|
import { SendIcon, AttachIcon, RecordIcon } from '../../assets/icons';
|
|
12
12
|
import { KeyboardAvoidingView, Platform, View, Text, TouchableOpacity, Alert, Linking } from 'react-native';
|
|
13
|
-
import AttachSheet from '../Modals/AttachSheet/AttachSheet';
|
|
13
|
+
import AttachSheet, { PickedMedia } from '../Modals/AttachSheet/AttachSheet';
|
|
14
14
|
import { MediaFilePreview } from './MediaFilePreview';
|
|
15
15
|
import { getIconColor } from '../../helpers/getIconColor';
|
|
16
16
|
import { getElementFont } from '../../helpers/getElementFont';
|
|
17
17
|
import { useT } from '../../i18n/useT';
|
|
18
|
+
import { getMediaLibrary } from '../../helpers/mediaLibraryRuntime';
|
|
18
19
|
import * as ImagePicker from 'expo-image-picker';
|
|
19
20
|
import * as DocumentPicker from 'expo-document-picker';
|
|
20
21
|
import * as ImageManipulator from 'expo-image-manipulator';
|
|
22
|
+
import * as FileSystem from 'expo-file-system/legacy';
|
|
21
23
|
// expo-audio replaces the discontinued expo-av: `useAudioRecorder` owns a
|
|
22
24
|
// single reusable recorder for this input's lifetime (prepare → record →
|
|
23
25
|
// stop → prepare again), and the module-level helpers cover permissions
|
|
@@ -259,22 +261,59 @@ const SendInput: React.FC<SendInputProps> = ({
|
|
|
259
261
|
}
|
|
260
262
|
};
|
|
261
263
|
|
|
264
|
+
// A tap on a thumbnail in the attach sheet's recents strip. The sheet
|
|
265
|
+
// already resolved the asset to a real on-disk uri (iOS `ph://` ids are
|
|
266
|
+
// not uploadable); here we apply the same treatment the full-blown
|
|
267
|
+
// pickers get — HEIC→JPEG for images, and a size probe so the 50 MB cap
|
|
268
|
+
// is enforced before anything hits the network.
|
|
269
|
+
const handleRecentMediaSelection = async (media: PickedMedia) => {
|
|
270
|
+
try {
|
|
271
|
+
let size: number | undefined;
|
|
272
|
+
try {
|
|
273
|
+
const info = await FileSystem.getInfoAsync(media.uri);
|
|
274
|
+
if (info.exists && typeof (info as any).size === 'number') {
|
|
275
|
+
size = (info as any).size;
|
|
276
|
+
}
|
|
277
|
+
} catch {
|
|
278
|
+
// Size is a nice-to-have; the backend still rejects oversized bodies.
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (media.isVideo) {
|
|
282
|
+
handleFileSelect([
|
|
283
|
+
{
|
|
284
|
+
uri: media.uri,
|
|
285
|
+
type: media.mimeType || 'video/mp4',
|
|
286
|
+
name: media.name,
|
|
287
|
+
size,
|
|
288
|
+
},
|
|
289
|
+
]);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const normalized = await normalizeImageAsset({
|
|
294
|
+
uri: media.uri,
|
|
295
|
+
mimeType: media.mimeType,
|
|
296
|
+
fileName: media.name,
|
|
297
|
+
} as ImagePicker.ImagePickerAsset);
|
|
298
|
+
handleFileSelect([
|
|
299
|
+
{
|
|
300
|
+
uri: normalized.uri,
|
|
301
|
+
type: normalized.mime,
|
|
302
|
+
name: normalized.name,
|
|
303
|
+
size,
|
|
304
|
+
},
|
|
305
|
+
]);
|
|
306
|
+
} catch (error) {
|
|
307
|
+
console.error('Recent media error:', error);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
|
|
262
311
|
const handleFileSelection = async () => {
|
|
263
312
|
// Drop overlapping invocations — a second getDocumentAsync while the
|
|
264
313
|
// first is still presented throws PickingInProgressException on iOS.
|
|
265
314
|
if (pickingDocRef.current) {return;}
|
|
266
315
|
pickingDocRef.current = true;
|
|
267
316
|
try {
|
|
268
|
-
// Let the attach-sheet's modal finish its NATIVE dismissal before we
|
|
269
|
-
// present the picker. The sheet fires this handler right after its
|
|
270
|
-
// slide-out animation, but the underlying RN Modal view-controller
|
|
271
|
-
// dismissal is async — presenting the document picker over a still-
|
|
272
|
-
// dismissing modal makes iOS tear it down without a cancel callback,
|
|
273
|
-
// which strands expo-document-picker's pickingContext and makes every
|
|
274
|
-
// subsequent open throw "Different document picking in progress".
|
|
275
|
-
if (Platform.OS === 'ios') {
|
|
276
|
-
await new Promise((resolve) => setTimeout(resolve, 350));
|
|
277
|
-
}
|
|
278
317
|
const result = await DocumentPicker.getDocumentAsync({
|
|
279
318
|
type: '*/*',
|
|
280
319
|
multiple: false,
|
|
@@ -297,8 +336,39 @@ const SendInput: React.FC<SendInputProps> = ({
|
|
|
297
336
|
}
|
|
298
337
|
};
|
|
299
338
|
|
|
339
|
+
// Photo-library access is requested HERE, not inside the sheet: iOS
|
|
340
|
+
// cannot present the permission alert while an RN <Modal> owns the
|
|
341
|
+
// screen (the same UIKit limitation that used to swallow the pickers),
|
|
342
|
+
// so asking from inside resolved to a silent "denied" and the recents
|
|
343
|
+
// strip stayed empty forever. Asking on the paperclip tap puts the
|
|
344
|
+
// system alert over the plain chat screen, where it can actually show.
|
|
345
|
+
// Only the first tap ever waits on it — afterwards the status is
|
|
346
|
+
// already determined and `getPermissionsAsync` returns immediately.
|
|
347
|
+
const ensureLibraryPermission = async () => {
|
|
348
|
+
const MediaLibrary = getMediaLibrary();
|
|
349
|
+
if (!MediaLibrary?.getPermissionsAsync) {return;}
|
|
350
|
+
try {
|
|
351
|
+
const perm = await MediaLibrary.getPermissionsAsync();
|
|
352
|
+
if (perm?.granted || perm?.canAskAgain === false) {return;}
|
|
353
|
+
await MediaLibrary.requestPermissionsAsync();
|
|
354
|
+
} catch (err) {
|
|
355
|
+
// Optional peer / unsupported platform: the sheet just shows the
|
|
356
|
+
// camera tile and the full-library route.
|
|
357
|
+
console.warn('Media library permission check failed:', err);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// Only the very first tap of a session goes through the permission
|
|
362
|
+
// check; afterwards the sheet opens with zero added latency.
|
|
363
|
+
const libraryPermissionCheckedRef = useRef(false);
|
|
364
|
+
|
|
300
365
|
const handleAttachPress = () => {
|
|
301
|
-
|
|
366
|
+
if (libraryPermissionCheckedRef.current) {
|
|
367
|
+
setShowMediaMenu(true);
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
libraryPermissionCheckedRef.current = true;
|
|
371
|
+
ensureLibraryPermission().finally(() => setShowMediaMenu(true));
|
|
302
372
|
};
|
|
303
373
|
|
|
304
374
|
// ─── Voice recording ──────────────────────────────────────────────
|
|
@@ -700,6 +770,7 @@ const SendInput: React.FC<SendInputProps> = ({
|
|
|
700
770
|
onCamera={handleCameraSelection}
|
|
701
771
|
onGallery={handleGallerySelection}
|
|
702
772
|
onDocument={handleFileSelection}
|
|
773
|
+
onPickMedia={handleRecentMediaSelection}
|
|
703
774
|
primaryColor={getIconColor(config)}
|
|
704
775
|
/>
|
|
705
776
|
</InputContainer>
|
|
@@ -28,9 +28,15 @@ export const ChatContainerHeader = styled.View`
|
|
|
28
28
|
background-color: #ffffff;
|
|
29
29
|
align-items: center;
|
|
30
30
|
justify-content: space-between;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-
|
|
31
|
+
/* Rounded bottom corners + a soft drop shadow instead of the hairline
|
|
32
|
+
* rule, so the header reads as a card over the conversation. */
|
|
33
|
+
border-bottom-left-radius: 20px;
|
|
34
|
+
border-bottom-right-radius: 20px;
|
|
35
|
+
shadow-color: #101828;
|
|
36
|
+
shadow-offset: 0px 4px;
|
|
37
|
+
shadow-opacity: 0.06;
|
|
38
|
+
shadow-radius: 12px;
|
|
39
|
+
elevation: 4;
|
|
34
40
|
z-index: 1000;
|
|
35
41
|
`;
|
|
36
42
|
|
|
@@ -13,14 +13,21 @@ const colors = {
|
|
|
13
13
|
|
|
14
14
|
export const InputContainer = styled.View<{ isText?: boolean }>`
|
|
15
15
|
flex-direction: column;
|
|
16
|
-
padding:
|
|
17
|
-
|
|
16
|
+
padding: 12px 16px 8px 16px;
|
|
17
|
+
/* Transparent, so the dock's white surface — and its rounded top
|
|
18
|
+
* corners — are what shows. An opaque child painted straight over those
|
|
19
|
+
* corners (a parent's border radius does not clip children without
|
|
20
|
+
* overflow:hidden, and that would clip the dock's shadow too). */
|
|
21
|
+
background-color: transparent;
|
|
18
22
|
z-index: 100;
|
|
19
23
|
width: 100%;
|
|
20
24
|
bottom: 0;
|
|
21
25
|
left: 0;
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
/* No radius or shadow here: the dock this sits in (ChatRoom's
|
|
27
|
+
* InputDockTag) is the composer's outer surface and carries both. Having
|
|
28
|
+
* them on this inner view too drew its shadow onto the dock's white
|
|
29
|
+
* background — the faint seam that made the strip below look like a
|
|
30
|
+
* different colour. */
|
|
24
31
|
`;
|
|
25
32
|
|
|
26
33
|
export const MediaContainer = styled.View`
|
|
@@ -18,6 +18,7 @@ import { ActivityIndicator, View } from 'react-native';
|
|
|
18
18
|
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
19
19
|
import { FileIcon } from '../../assets/icons';
|
|
20
20
|
import { getExtensionForMime } from '../../helpers/mimeToExtension';
|
|
21
|
+
import { getDisplayFileName } from '../../helpers/getDisplayFileName';
|
|
21
22
|
|
|
22
23
|
interface FileDownloadProps {
|
|
23
24
|
fileName: string;
|
|
@@ -47,6 +48,15 @@ const FileDownload: React.FC<FileDownloadProps> = ({
|
|
|
47
48
|
const dispatch = useDispatch();
|
|
48
49
|
const { config } = useChatSettingState();
|
|
49
50
|
|
|
51
|
+
// Bug #40: prefer the sender's original name over the server's stored
|
|
52
|
+
// hash name for both the visible label and the extension badge below.
|
|
53
|
+
const displayName = getDisplayFileName({
|
|
54
|
+
originalName,
|
|
55
|
+
fileName,
|
|
56
|
+
location: fileURL,
|
|
57
|
+
mimetype,
|
|
58
|
+
});
|
|
59
|
+
|
|
50
60
|
const formatFileSize = (sizeInBytes: string): string => {
|
|
51
61
|
const size = parseInt(sizeInBytes, 10);
|
|
52
62
|
|
|
@@ -101,9 +111,9 @@ const FileDownload: React.FC<FileDownloadProps> = ({
|
|
|
101
111
|
};
|
|
102
112
|
|
|
103
113
|
const extensionLabel = (() => {
|
|
104
|
-
const dotIndex =
|
|
105
|
-
if (dotIndex !== -1 && dotIndex <
|
|
106
|
-
return
|
|
114
|
+
const dotIndex = displayName.lastIndexOf('.');
|
|
115
|
+
if (dotIndex !== -1 && dotIndex < displayName.length - 1) {
|
|
116
|
+
return displayName.slice(dotIndex + 1).toUpperCase();
|
|
107
117
|
}
|
|
108
118
|
return getExtensionForMime(mimetype).replace('.', '').toUpperCase();
|
|
109
119
|
})();
|
|
@@ -123,7 +133,7 @@ const FileDownload: React.FC<FileDownloadProps> = ({
|
|
|
123
133
|
isUser={isUser}
|
|
124
134
|
colorIsUser={config?.colors?.primary}
|
|
125
135
|
colorUsers={config?.colors?.secondary}
|
|
126
|
-
>{formatFileName(
|
|
136
|
+
>{formatFileName(displayName, 20)}</FileName>
|
|
127
137
|
{(pending || size) && (
|
|
128
138
|
<FileSizeContainer>
|
|
129
139
|
{pending ? (
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
isSecureFileUrl,
|
|
4
|
+
requestFileTokenRecovery,
|
|
5
|
+
} from '../../helpers/secureFileUrl';
|
|
6
|
+
import { Image, Pressable, StyleSheet, View } from 'react-native';
|
|
4
7
|
import { useDispatch } from 'react-redux';
|
|
5
8
|
import {
|
|
6
9
|
setActiveFile,
|
|
@@ -16,74 +19,148 @@ import {
|
|
|
16
19
|
|
|
17
20
|
interface CustomMessageVideoProps {
|
|
18
21
|
fileName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The sender's original file name (bug #40) - kept alongside `fileName`
|
|
24
|
+
* so the preview modal's save/share/download logic can prefer it over
|
|
25
|
+
* the server's stored/hashed name.
|
|
26
|
+
*/
|
|
27
|
+
originalName?: string;
|
|
19
28
|
fileURL: string;
|
|
20
29
|
mimetype: string;
|
|
30
|
+
/** The backend-generated poster frame (message.locationPreview). */
|
|
31
|
+
previewURL?: string;
|
|
21
32
|
}
|
|
22
33
|
|
|
34
|
+
const PlayBadge: React.FC = () => (
|
|
35
|
+
<View style={styles.overlay} pointerEvents="none">
|
|
36
|
+
<View style={styles.playButton}>
|
|
37
|
+
<PlayIcon width={28} height={28} />
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Poster path — taken whenever the message carries a `locationPreview`.
|
|
44
|
+
*
|
|
45
|
+
* A chat row only ever needs a still and a play affordance; actual
|
|
46
|
+
* playback happens in the full-screen preview. Drawing that still with a
|
|
47
|
+
* plain <Image> keeps the whole bubble inside the RN view hierarchy, so
|
|
48
|
+
* the play badge is guaranteed to composite on top of it.
|
|
49
|
+
*/
|
|
50
|
+
const PosterVideo: React.FC<{
|
|
51
|
+
previewURL: string;
|
|
52
|
+
onOpen: () => void;
|
|
53
|
+
onPosterError: () => void;
|
|
54
|
+
}> = ({ previewURL, onOpen, onPosterError }) => {
|
|
55
|
+
const [dims, setDims] = useState<MediaDims>(defaultMediaDims());
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!previewURL) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let active = true;
|
|
62
|
+
Image.getSize(
|
|
63
|
+
previewURL,
|
|
64
|
+
(w, h) => {
|
|
65
|
+
if (active) {
|
|
66
|
+
setDims(fitMediaDimensions(w, h));
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
() => {
|
|
70
|
+
/* keep the default box if the size probe fails */
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
return () => {
|
|
74
|
+
active = false;
|
|
75
|
+
};
|
|
76
|
+
}, [previewURL]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Pressable
|
|
80
|
+
onPress={onOpen}
|
|
81
|
+
style={[styles.wrapper, { width: dims.width, height: dims.height }]}
|
|
82
|
+
accessibilityRole="button"
|
|
83
|
+
accessibilityLabel="Play video"
|
|
84
|
+
>
|
|
85
|
+
<Image
|
|
86
|
+
source={{ uri: previewURL }}
|
|
87
|
+
style={styles.video}
|
|
88
|
+
resizeMode="cover"
|
|
89
|
+
// Not every backend returns a real still — some set
|
|
90
|
+
// locationPreview to the video URL itself, which decodes to
|
|
91
|
+
// nothing. Rather than show an empty box, fall back to the
|
|
92
|
+
// static placeholder branch.
|
|
93
|
+
onError={onPosterError}
|
|
94
|
+
/>
|
|
95
|
+
<PlayBadge />
|
|
96
|
+
</Pressable>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Fallback for messages with no usable poster frame: a static dark
|
|
102
|
+
* placeholder behind the play badge.
|
|
103
|
+
*
|
|
104
|
+
* This branch used to mount an expo-video player purely to paint the
|
|
105
|
+
* first frame (`VideoView` + `surfaceType="textureView"`). That never
|
|
106
|
+
* composited reliably: on Android (Pixel, Android 16, New Architecture)
|
|
107
|
+
* the native video surface draws ABOVE sibling RN views, swallowing the
|
|
108
|
+
* play badge — the video looked like a plain photo. There is no
|
|
109
|
+
* surfaceType/zIndex combination that guarantees ordering across SDK 54
|
|
110
|
+
* and 57, so we don't fight it: no live surface in the bubble at all.
|
|
111
|
+
* The badge is plain RN views over a plain RN background, which cannot
|
|
112
|
+
* be occluded, and we drop the per-row player instance as a bonus.
|
|
113
|
+
* Actual playback (and the real first frame) happens in the full-screen
|
|
114
|
+
* preview modal.
|
|
115
|
+
*/
|
|
116
|
+
const PlaceholderVideo: React.FC<{
|
|
117
|
+
onOpen: () => void;
|
|
118
|
+
}> = ({ onOpen }) => {
|
|
119
|
+
const dims = defaultMediaDims();
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<Pressable
|
|
123
|
+
onPress={onOpen}
|
|
124
|
+
style={[styles.wrapper, { width: dims.width, height: dims.height }]}
|
|
125
|
+
accessibilityRole="button"
|
|
126
|
+
accessibilityLabel="Play video"
|
|
127
|
+
>
|
|
128
|
+
<PlayBadge />
|
|
129
|
+
</Pressable>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
23
133
|
const CustomMessageVideo: React.FC<CustomMessageVideoProps> = ({
|
|
24
134
|
fileName,
|
|
135
|
+
originalName,
|
|
25
136
|
fileURL,
|
|
26
137
|
mimetype,
|
|
138
|
+
previewURL,
|
|
27
139
|
}) => {
|
|
28
140
|
const dispatch = useDispatch();
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
const player = useVideoPlayer(fileURL, (p) => {
|
|
32
|
-
p.muted = true;
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
const sub = player.addListener('statusChange', () => {
|
|
37
|
-
const size = player.videoTrack?.size;
|
|
38
|
-
if (size?.width && size?.height) {
|
|
39
|
-
setDims(fitMediaDimensions(size.width, size.height));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return () => sub.remove();
|
|
43
|
-
}, [player]);
|
|
141
|
+
const [posterFailed, setPosterFailed] = useState(false);
|
|
44
142
|
|
|
45
143
|
const handleOpen = () => {
|
|
46
|
-
dispatch(setActiveFile({ fileName, fileURL, mimetype }));
|
|
144
|
+
dispatch(setActiveFile({ fileName, fileURL, mimetype, originalName }));
|
|
47
145
|
dispatch(setActiveModal(MODAL_TYPES.FILE_PREVIEW));
|
|
48
146
|
};
|
|
49
147
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
style={[styles.wrapper, { width: dims.width, height: dims.height }]}
|
|
62
|
-
>
|
|
63
|
-
<VideoView
|
|
64
|
-
player={player}
|
|
65
|
-
style={styles.video}
|
|
66
|
-
contentFit="cover"
|
|
67
|
-
nativeControls={false}
|
|
68
|
-
surfaceType="textureView"
|
|
69
|
-
pointerEvents="none"
|
|
148
|
+
if (previewURL && !posterFailed) {
|
|
149
|
+
return (
|
|
150
|
+
<PosterVideo
|
|
151
|
+
previewURL={previewURL}
|
|
152
|
+
onOpen={handleOpen}
|
|
153
|
+
onPosterError={() => {
|
|
154
|
+
if (isSecureFileUrl(previewURL)) {
|
|
155
|
+
requestFileTokenRecovery();
|
|
156
|
+
}
|
|
157
|
+
setPosterFailed(true);
|
|
158
|
+
}}
|
|
70
159
|
/>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</View>
|
|
76
|
-
<Pressable
|
|
77
|
-
onPress={handleOpen}
|
|
78
|
-
// Sits ON TOP of VideoView + the play-button overlay; transparent
|
|
79
|
-
// so the poster + play icon show through. Captures the tap and
|
|
80
|
-
// routes to handleOpen → setActiveModal(FILE_PREVIEW).
|
|
81
|
-
style={StyleSheet.absoluteFill}
|
|
82
|
-
accessibilityRole="button"
|
|
83
|
-
accessibilityLabel="Play video"
|
|
84
|
-
/>
|
|
85
|
-
</View>
|
|
86
|
-
);
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return <PlaceholderVideo onOpen={handleOpen} />;
|
|
87
164
|
};
|
|
88
165
|
|
|
89
166
|
export default CustomMessageVideo;
|