@ethora/chat-component-rn 26.7.5 → 26.7.6
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 +59 -0
- package/README.md +31 -8
- package/lib/commonjs/assets/icons.js +7 -2
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +26 -7
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +5 -2
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +36 -14
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +7 -23
- 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 +320 -110
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +552 -213
- 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 +6 -2
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.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 -104
- 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 +556 -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 +17 -7
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.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/context/xmppProvider.js +23 -38
- package/lib/commonjs/context/xmppProvider.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/mediaLibraryRuntime.js +31 -0
- package/lib/commonjs/helpers/mediaLibraryRuntime.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/sheetGestures.js +32 -0
- package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
- package/lib/commonjs/helpers/updateMessagesTillLast.js +12 -40
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useChatRoomFocus.js +3 -9
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +0 -5
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +23 -50
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +121 -1
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +6 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +59 -0
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/authRefresh.js +12 -2
- package/lib/commonjs/networking/authRefresh.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +0 -18
- package/lib/commonjs/networking/outboundQueue.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +1 -10
- package/lib/commonjs/networking/stanzaHandlers.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/xmppClient.js +7 -107
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +3 -22
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/assets/icons.js +6 -1
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +26 -7
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +5 -2
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +36 -14
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +8 -24
- 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 +311 -113
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +555 -217
- 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 +6 -2
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.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 -106
- 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 +548 -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 +17 -7
- package/lib/module/components/RoomComponents/ChatRoomItem.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/context/xmppProvider.js +23 -38
- package/lib/module/context/xmppProvider.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/mediaLibraryRuntime.js +25 -0
- package/lib/module/helpers/mediaLibraryRuntime.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/sheetGestures.js +26 -0
- package/lib/module/helpers/sheetGestures.js.map +1 -0
- package/lib/module/helpers/updateMessagesTillLast.js +13 -41
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useChatRoomFocus.js +3 -9
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useLogout.js +0 -5
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +24 -51
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +121 -1
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +1 -1
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +56 -0
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/authRefresh.js +12 -2
- package/lib/module/networking/authRefresh.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +0 -17
- package/lib/module/networking/outboundQueue.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +1 -10
- package/lib/module/networking/stanzaHandlers.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/xmppClient.js +7 -107
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +3 -1
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +2 -20
- package/lib/module/roomStore/roomsSlice.js.map +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/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/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/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/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/context/xmppProvider.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/mediaLibraryRuntime.d.ts +3 -0
- package/lib/typescript/helpers/mediaLibraryRuntime.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/sheetGestures.d.ts +20 -0
- package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
- package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
- package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +1 -1
- package/lib/typescript/main.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/authRefresh.d.ts +4 -1
- package/lib/typescript/networking/authRefresh.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +0 -16
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +1 -33
- package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts +1 -18
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +0 -15
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +30 -20
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/assets/icons.tsx +48 -9
- package/src/components/Header/HeaderRoomList.tsx +24 -6
- package/src/components/MainComponents/ChatHeader.tsx +5 -2
- package/src/components/MainComponents/ChatRoom.tsx +38 -20
- package/src/components/MainComponents/MessageList.tsx +8 -24
- 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 +331 -97
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +598 -279
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
- 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 -117
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -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 +14 -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/context/xmppProvider.tsx +27 -46
- package/src/helpers/getChatBackground.ts +18 -0
- package/src/helpers/mediaLibraryRuntime.ts +25 -0
- package/src/helpers/pickImageAsset.ts +68 -0
- package/src/helpers/sheetGestures.ts +25 -0
- package/src/helpers/updateMessagesTillLast.tsx +17 -42
- package/src/hooks/useChatRoomFocus.ts +3 -11
- package/src/hooks/useLogout.tsx +0 -7
- package/src/hooks/useSendMessage.tsx +24 -60
- package/src/i18n/strings.ts +121 -1
- package/src/main.ts +1 -1
- package/src/networking/api-requests/user.api.ts +71 -0
- package/src/networking/authRefresh.ts +25 -4
- package/src/networking/outboundQueue.ts +0 -29
- package/src/networking/stanzaHandlers.ts +1 -9
- package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
- package/src/networking/xmppClient.ts +7 -118
- package/src/roomStore/chatSettingsSlice.ts +3 -1
- package/src/roomStore/roomsSlice.ts +2 -20
- package/src/types/models/room.model.ts +0 -15
- package/src/types/types.ts +32 -20
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Alert, Linking } from 'react-native';
|
|
2
|
+
import * as ImagePicker from 'expo-image-picker';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A picked image in the shape React Native's FormData understands.
|
|
6
|
+
*
|
|
7
|
+
* NOT a web `File`: RN streams a multipart part straight from a `file://`
|
|
8
|
+
* uri and has no usable Blob/File/atob path. Screens ported from the web
|
|
9
|
+
* client used to carry base64 -> Blob -> File helpers that could never
|
|
10
|
+
* have run here.
|
|
11
|
+
*/
|
|
12
|
+
export interface PickedImage {
|
|
13
|
+
uri: string;
|
|
14
|
+
type: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Ask for library permission, open the picker, and normalise the result.
|
|
20
|
+
*
|
|
21
|
+
* Returns `null` for every non-error outcome — permission refused, user
|
|
22
|
+
* cancelled — so call sites can simply keep their current value.
|
|
23
|
+
*
|
|
24
|
+
* Exists because the avatar pickers are wired to `onPress`, which hands
|
|
25
|
+
* the callback a SyntheticEvent. Storing that event as "the image" (what
|
|
26
|
+
* two screens used to do) rendered a pooled event as an <Image source>
|
|
27
|
+
* and then crashed with "Property is not configurable" when React tried
|
|
28
|
+
* to release it — on top of never letting the user pick anything.
|
|
29
|
+
*/
|
|
30
|
+
export const pickImageAsset = async (): Promise<PickedImage | null> => {
|
|
31
|
+
try {
|
|
32
|
+
// expo-image-picker owns the permission prompt internally and
|
|
33
|
+
// returns a `granted` flag.
|
|
34
|
+
const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
|
|
35
|
+
if (!perm.granted) {
|
|
36
|
+
Alert.alert(
|
|
37
|
+
'Permission required',
|
|
38
|
+
'Photo library permission is needed to select images.',
|
|
39
|
+
[
|
|
40
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
41
|
+
{ text: 'Open Settings', onPress: () => Linking.openSettings() },
|
|
42
|
+
]
|
|
43
|
+
);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const result = await ImagePicker.launchImageLibraryAsync({
|
|
48
|
+
mediaTypes: ['images'],
|
|
49
|
+
allowsEditing: true,
|
|
50
|
+
aspect: [1, 1],
|
|
51
|
+
quality: 0.8,
|
|
52
|
+
});
|
|
53
|
+
if (result.canceled || !result.assets?.[0]) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const asset = result.assets[0];
|
|
58
|
+
const originalName = asset.fileName || asset.uri.split('/').pop();
|
|
59
|
+
return {
|
|
60
|
+
uri: asset.uri,
|
|
61
|
+
type: asset.mimeType || 'image/jpeg',
|
|
62
|
+
name: originalName || `image_${Date.now()}.jpg`,
|
|
63
|
+
};
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error('Failed to pick an image:', error);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared thresholds for the drag-to-dismiss gesture on bottom sheets (the
|
|
5
|
+
* attach sheet, the profile headers, the room-list menu). Kept in one
|
|
6
|
+
* place so a pull feels identical wherever the user does it — and so the
|
|
7
|
+
* numbers are unit-testable without a touch event.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Drag past this many points and letting go dismisses the sheet. */
|
|
11
|
+
export const DISMISS_DISTANCE = 90;
|
|
12
|
+
/** …or flick faster than this, however short the drag. */
|
|
13
|
+
export const DISMISS_VELOCITY = 0.8;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Claim a drag only once it is clearly a downward pull, so a tap on a row
|
|
17
|
+
* still registers and a horizontal swipe stays with whatever scrolls
|
|
18
|
+
* sideways inside the sheet.
|
|
19
|
+
*/
|
|
20
|
+
export const shouldClaimVerticalDrag = (dy: number, dx: number) =>
|
|
21
|
+
dy > 6 && Math.abs(dy) > Math.abs(dx) * 1.5;
|
|
22
|
+
|
|
23
|
+
/** Far enough / fast enough to let go of the sheet. */
|
|
24
|
+
export const shouldDismissOnDrag = (dy: number, vy: number) =>
|
|
25
|
+
dy > DISMISS_DISTANCE || vy > DISMISS_VELOCITY;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XmppClient from '../networking/xmppClient';
|
|
2
2
|
import { store } from '../roomStore';
|
|
3
|
-
import {
|
|
3
|
+
import { setRoomMessages } from '../roomStore/roomsSlice';
|
|
4
4
|
import { IMessage, IRoom } from '../types/types';
|
|
5
5
|
import { checkUniqueUsers } from './checkUniqueUsers';
|
|
6
6
|
|
|
@@ -76,47 +76,22 @@ export const updateMessagesTillLast = async (
|
|
|
76
76
|
Number(message.id) === Number(lastCachedMessagesTimeStamp)
|
|
77
77
|
);
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// unread count — the "wrong sender + no unread after reconnect,
|
|
96
|
-
// both correct after restart" symptom, because only a fresh
|
|
97
|
-
// start re-runs the preload scheduler that overwrites it.
|
|
98
|
-
//
|
|
99
|
-
// Dispatching through `applyRoomsPreloadBatch` (rather than the
|
|
100
|
-
// previous `setRoomMessages` array-replace) reuses
|
|
101
|
-
// mergeHistoryIntoCache: it dedupes by id with "fetched wins",
|
|
102
|
-
// preserves locally-pending sends and older cached history, and
|
|
103
|
-
// is already a trigger for the unread middleware — exactly what
|
|
104
|
-
// the startup path does, so reconnect and cold start now agree.
|
|
105
|
-
// Customer-reported #32.
|
|
106
|
-
if (currentJidNewMessages.length > 0) {
|
|
107
|
-
// Fire-and-forget — checkUniqueUsers resolves to an
|
|
108
|
-
// updated RoomMember list, but there's no slice
|
|
109
|
-
// action wired to receive it on RN yet (the web SDK
|
|
110
|
-
// has one; the port left a TODO). Keep the call so
|
|
111
|
-
// the API request goes out (it warms the cache for
|
|
112
|
-
// later renders) but stop short of dispatching.
|
|
113
|
-
await checkUniqueUsers(currentJidNewMessages);
|
|
114
|
-
|
|
115
|
-
store.dispatch(
|
|
116
|
-
applyRoomsPreloadBatch({
|
|
117
|
-
rooms: [{ jid, messages: currentJidNewMessages }],
|
|
118
|
-
})
|
|
119
|
-
);
|
|
79
|
+
if (!isMessageFound && !(counter <= maxFetchAttempts - 1)) {
|
|
80
|
+
// Fire-and-forget — checkUniqueUsers resolves to an
|
|
81
|
+
// updated RoomMember list, but there's no slice
|
|
82
|
+
// action wired to receive it on RN yet (the web SDK
|
|
83
|
+
// has one; the port left a TODO). Keep the call so
|
|
84
|
+
// the API request goes out (it warms the cache for
|
|
85
|
+
// later renders) but stop short of dispatching.
|
|
86
|
+
await checkUniqueUsers(currentJidNewMessages);
|
|
87
|
+
|
|
88
|
+
store.dispatch(
|
|
89
|
+
setRoomMessages({
|
|
90
|
+
roomJID: jid,
|
|
91
|
+
messages: currentJidNewMessages,
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
120
95
|
}
|
|
121
96
|
} catch (error) {
|
|
122
97
|
console.error(`Error processing room ${jid}:`, error);
|
|
@@ -59,20 +59,12 @@ export const useChatRoomFocus = ({
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const leaveRoom = (jid: string) => {
|
|
62
|
-
const
|
|
63
|
-
// Only mark read as far as the user actually scrolled. Blindly
|
|
64
|
-
// stamping `Date.now()` here clears messages they never reached, and
|
|
65
|
-
// the server flush below makes that permanent across a restart.
|
|
66
|
-
// Customer-reported #33.
|
|
67
|
-
const boundaryTs = rooms?.[jid]?.readBoundaryTs ?? null;
|
|
68
|
-
const timestamp = boundaryTs ?? Date.now();
|
|
62
|
+
const timestamp = Date.now();
|
|
69
63
|
dispatch(setLastViewedTimestamp({ chatJID: jid, timestamp }));
|
|
70
64
|
dispatch(clearVisibleRoom());
|
|
65
|
+
const rooms = store.getState().rooms?.rooms;
|
|
71
66
|
(store.getState().chatSettingStore as any)?.client
|
|
72
|
-
?.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
73
|
-
visibleRoomJID: jid,
|
|
74
|
-
visibleRoomTs: boundaryTs,
|
|
75
|
-
})
|
|
67
|
+
?.flushLastViewedToPrivateStoreStanza(rooms, { visibleRoomJID: jid })
|
|
76
68
|
.catch(() => {});
|
|
77
69
|
};
|
|
78
70
|
|
package/src/hooks/useLogout.tsx
CHANGED
|
@@ -63,13 +63,6 @@ const logoutService = {
|
|
|
63
63
|
await Promise.race([
|
|
64
64
|
client.flushLastViewedToPrivateStoreStanza(rooms, {
|
|
65
65
|
visibleRoomJID,
|
|
66
|
-
// `onlyIfNoUnread` deliberately exempts the visible room, so
|
|
67
|
-
// without this the open-but-scrolled-up room would still be
|
|
68
|
-
// stamped "read up to now" on logout and come back read on
|
|
69
|
-
// the next login. Customer-reported #33.
|
|
70
|
-
visibleRoomTs: visibleRoomJID
|
|
71
|
-
? rooms?.[visibleRoomJID]?.readBoundaryTs ?? null
|
|
72
|
-
: null,
|
|
73
66
|
onlyIfNoUnread: true,
|
|
74
67
|
}),
|
|
75
68
|
new Promise((res) => setTimeout(res, 2000)),
|
|
@@ -10,11 +10,7 @@ import {
|
|
|
10
10
|
markMessageFailed,
|
|
11
11
|
} from '../roomStore/roomHeapSlice';
|
|
12
12
|
import { uploadFileV2 } from '../networking/api-requests/auth.api';
|
|
13
|
-
import {
|
|
14
|
-
enqueueOutboundSend,
|
|
15
|
-
markOutboundSentLive,
|
|
16
|
-
removeOutboundSend,
|
|
17
|
-
} from '../networking/outboundQueue';
|
|
13
|
+
import { enqueueOutboundSend, removeOutboundSend } from '../networking/outboundQueue';
|
|
18
14
|
import { RootState, store } from '../roomStore';
|
|
19
15
|
import { getGlobalXmppClient } from '../utils/clientRegistry';
|
|
20
16
|
import { useEventHandlers } from './useEventHandlers';
|
|
@@ -308,36 +304,15 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
308
304
|
}
|
|
309
305
|
|
|
310
306
|
replaySend(effectiveClient);
|
|
311
|
-
// The stanza is on the wire from here on. Mark the buffered copy
|
|
312
|
-
// so a later reconnect flush won't blind-replay it — see
|
|
313
|
-
// markOutboundSentLive / flushOutboundSends. Customer-reported #31.
|
|
314
|
-
markOutboundSentLive(optimisticId);
|
|
315
307
|
try {
|
|
316
|
-
|
|
317
|
-
// probe, and a single missed probe no longer tears the stream
|
|
318
|
-
// down. See ensureStreamAliveAfterSend / ensureStreamAlive.
|
|
319
|
-
effectiveClient.ensureStreamAliveAfterSend?.();
|
|
308
|
+
effectiveClient.ensureStreamAlive?.();
|
|
320
309
|
} catch {}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
// Customer-reported #31 ("delivered but shows as failed").
|
|
328
|
-
try {
|
|
329
|
-
await handleMessageSent({
|
|
330
|
-
message,
|
|
331
|
-
roomJID: activeRoomJID,
|
|
332
|
-
user,
|
|
333
|
-
messageType: 'text',
|
|
334
|
-
});
|
|
335
|
-
} catch (notifyError) {
|
|
336
|
-
console.warn(
|
|
337
|
-
'onMessageSent handler threw after a successful send; not failing the message',
|
|
338
|
-
notifyError
|
|
339
|
-
);
|
|
340
|
-
}
|
|
310
|
+
await handleMessageSent({
|
|
311
|
+
message,
|
|
312
|
+
roomJID: activeRoomJID,
|
|
313
|
+
user,
|
|
314
|
+
messageType: 'text',
|
|
315
|
+
});
|
|
341
316
|
} catch (error) {
|
|
342
317
|
clearTimeout(watchdogTimer);
|
|
343
318
|
// Same reasoning as the watchdog: once the bubble shows failed,
|
|
@@ -605,7 +580,7 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
605
580
|
id
|
|
606
581
|
);
|
|
607
582
|
try {
|
|
608
|
-
effectiveMediaClient.
|
|
583
|
+
effectiveMediaClient.ensureStreamAlive?.();
|
|
609
584
|
} catch {}
|
|
610
585
|
} else {
|
|
611
586
|
const anyMediaClient: any =
|
|
@@ -628,32 +603,21 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
628
603
|
}
|
|
629
604
|
}
|
|
630
605
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
fileType: type,
|
|
647
|
-
messageId: id,
|
|
648
|
-
uploadResults: response.data.results,
|
|
649
|
-
},
|
|
650
|
-
});
|
|
651
|
-
} catch (notifyError) {
|
|
652
|
-
console.warn(
|
|
653
|
-
'onMessageSent handler threw after a successful media send; not failing the message',
|
|
654
|
-
notifyError
|
|
655
|
-
);
|
|
656
|
-
}
|
|
606
|
+
await handleMessageSent({
|
|
607
|
+
message: 'media',
|
|
608
|
+
roomJID: activeRoomJID,
|
|
609
|
+
user,
|
|
610
|
+
messageType: 'media',
|
|
611
|
+
metadata: {
|
|
612
|
+
isReply,
|
|
613
|
+
isChecked,
|
|
614
|
+
mainMessage,
|
|
615
|
+
fileData: data,
|
|
616
|
+
fileType: type,
|
|
617
|
+
messageId: id,
|
|
618
|
+
uploadResults: response.data.results,
|
|
619
|
+
},
|
|
620
|
+
});
|
|
657
621
|
} catch (error: any) {
|
|
658
622
|
// Upload (or stanza send) threw an explicit error. Clear the
|
|
659
623
|
// watchdog so it doesn't double-fire `markMessageFailed`.
|