@ethora/chat-component-rn 26.7.4 → 26.7.5
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 +0 -54
- package/README.md +8 -31
- package/lib/commonjs/assets/icons.js +2 -7
- package/lib/commonjs/assets/icons.js.map +1 -1
- package/lib/commonjs/components/Header/HeaderRoomList.js +6 -20
- package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatRoom.js +14 -36
- package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageList.js +23 -7
- package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +32 -62
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -309
- package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +110 -320
- package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +213 -552
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
- package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +104 -202
- package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
- package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
- package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +7 -17
- package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/commonjs/components/styled/SendInput.js +11 -80
- package/lib/commonjs/components/styled/SendInput.js.map +1 -1
- package/lib/commonjs/components/styled/StyledComponents.js +3 -9
- package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/commonjs/context/xmppProvider.js +35 -6
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/updateMessagesTillLast.js +40 -12
- package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/commonjs/hooks/useChatRoomFocus.js +9 -3
- package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +5 -0
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/hooks/useSendMessage.js +50 -23
- package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +1 -121
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +0 -6
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +0 -59
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/networking/outboundQueue.js +18 -0
- package/lib/commonjs/networking/outboundQueue.js.map +1 -1
- package/lib/commonjs/networking/stanzaHandlers.js +10 -1
- package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
- package/lib/commonjs/networking/xmppClient.js +107 -7
- package/lib/commonjs/networking/xmppClient.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +1 -3
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/roomStore/roomsSlice.js +22 -3
- package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
- package/lib/module/assets/icons.js +1 -6
- package/lib/module/assets/icons.js.map +1 -1
- package/lib/module/components/Header/HeaderRoomList.js +6 -20
- package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
- package/lib/module/components/MainComponents/ChatRoom.js +14 -36
- package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
- package/lib/module/components/MainComponents/MessageList.js +24 -8
- package/lib/module/components/MainComponents/MessageList.js.map +1 -1
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
- package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +32 -62
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -311
- package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js +113 -311
- package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +217 -555
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +2 -6
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/Modal/Modal.js +1 -9
- package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
- package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js +106 -205
- package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
- package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
- package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
- package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/components/Modals/styledModalComponents.js +2 -9
- package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
- package/lib/module/components/RoomComponents/ChatRoomItem.js +7 -17
- package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
- package/lib/module/components/styled/SendInput.js +12 -81
- package/lib/module/components/styled/SendInput.js.map +1 -1
- package/lib/module/components/styled/StyledComponents.js +3 -9
- package/lib/module/components/styled/StyledComponents.js.map +1 -1
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
- package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
- package/lib/module/context/xmppProvider.js +35 -6
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/updateMessagesTillLast.js +41 -13
- package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
- package/lib/module/hooks/useChatRoomFocus.js +9 -3
- package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
- package/lib/module/hooks/useLogout.js +5 -0
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/hooks/useSendMessage.js +51 -24
- package/lib/module/hooks/useSendMessage.js.map +1 -1
- package/lib/module/i18n/strings.js +1 -121
- 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 +0 -56
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/networking/outboundQueue.js +17 -0
- package/lib/module/networking/outboundQueue.js.map +1 -1
- package/lib/module/networking/stanzaHandlers.js +10 -1
- package/lib/module/networking/stanzaHandlers.js.map +1 -1
- package/lib/module/networking/xmppClient.js +107 -7
- package/lib/module/networking/xmppClient.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +1 -3
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/roomStore/roomsSlice.js +20 -2
- package/lib/module/roomStore/roomsSlice.js.map +1 -1
- package/lib/typescript/assets/icons.d.ts +0 -16
- 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/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.map +1 -1
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
- package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
- package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
- 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/SelectUsersModal/SelectUsersModal.d.ts +1 -6
- 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 +0 -16
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
- 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/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 +0 -27
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/networking/outboundQueue.d.ts +16 -0
- package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
- package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
- package/lib/typescript/networking/xmppClient.d.ts +33 -1
- 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 +18 -1
- package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
- package/lib/typescript/types/models/room.model.d.ts +15 -0
- package/lib/typescript/types/models/room.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +20 -20
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/package.json +1 -6
- package/src/assets/icons.tsx +9 -48
- package/src/components/Header/HeaderRoomList.tsx +5 -20
- package/src/components/MainComponents/ChatRoom.tsx +20 -38
- package/src/components/MainComponents/MessageList.tsx +24 -8
- package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
- package/src/components/MainComponents/RoomList.tsx +34 -65
- package/src/components/Menu/HeaderRoomListMenu.tsx +71 -310
- package/src/components/Modals/AttachSheet/AttachSheet.tsx +97 -331
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +279 -598
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +2 -4
- package/src/components/Modals/Modal/Modal.tsx +0 -7
- package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
- package/src/components/Modals/NewChatModal/NewChatModal.tsx +117 -219
- package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
- package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
- package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
- package/src/components/Modals/styledModalComponents.tsx +2 -9
- package/src/components/RoomComponents/ChatRoomItem.tsx +7 -14
- package/src/components/styled/SendInput.tsx +12 -83
- package/src/components/styled/StyledComponents.ts +3 -9
- package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
- package/src/context/xmppProvider.tsx +41 -8
- package/src/helpers/updateMessagesTillLast.tsx +42 -17
- package/src/hooks/useChatRoomFocus.ts +11 -3
- package/src/hooks/useLogout.tsx +7 -0
- package/src/hooks/useSendMessage.tsx +60 -24
- package/src/i18n/strings.ts +1 -121
- package/src/main.ts +1 -1
- package/src/networking/api-requests/user.api.ts +0 -71
- package/src/networking/outboundQueue.ts +29 -0
- package/src/networking/stanzaHandlers.ts +9 -1
- package/src/networking/xmppClient.ts +118 -7
- package/src/roomStore/chatSettingsSlice.ts +1 -3
- package/src/roomStore/roomsSlice.ts +20 -2
- package/src/types/models/room.model.ts +15 -0
- package/src/types/types.ts +20 -22
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
- package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/commonjs/helpers/getChatBackground.js +0 -23
- package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
- package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
- package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/commonjs/helpers/pickImageAsset.js +0 -68
- package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
- package/lib/commonjs/helpers/sheetGestures.js +0 -32
- package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
- package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
- package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
- package/lib/module/helpers/getChatBackground.js +0 -18
- package/lib/module/helpers/getChatBackground.js.map +0 -1
- package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
- package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
- package/lib/module/helpers/pickImageAsset.js +0 -63
- package/lib/module/helpers/pickImageAsset.js.map +0 -1
- package/lib/module/helpers/sheetGestures.js +0 -26
- package/lib/module/helpers/sheetGestures.js.map +0 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
- package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
- package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
- package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
- package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
- package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
- package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
- package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
- package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
- package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
- package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
- package/src/helpers/getChatBackground.ts +0 -18
- package/src/helpers/mediaLibraryRuntime.ts +0 -25
- package/src/helpers/pickImageAsset.ts +0 -68
- package/src/helpers/sheetGestures.ts +0 -25
|
@@ -211,6 +211,13 @@ export class XmppClient {
|
|
|
211
211
|
this.devServer = xmppSettings?.devServer;
|
|
212
212
|
}
|
|
213
213
|
this.disableLastRead = this.xmppSettings?.disableLastRead === true;
|
|
214
|
+
// `xmppPingOnSendEnabled` was declared in the public settings type but
|
|
215
|
+
// never read. It now controls the SEND-path liveness probe only; the
|
|
216
|
+
// periodic watchdog and the NetInfo check always run, so turning this
|
|
217
|
+
// off cannot leave a zombie socket undetected — it only removes the
|
|
218
|
+
// extra probe a send would otherwise trigger. Defaults to on
|
|
219
|
+
// (previous behaviour), just throttled and confirmation-gated now.
|
|
220
|
+
this.pingOnSendEnabled = this.xmppSettings?.xmppPingOnSendEnabled !== false;
|
|
214
221
|
|
|
215
222
|
const qos = this.xmppSettings?.historyQoS;
|
|
216
223
|
if (qos) {
|
|
@@ -494,6 +501,10 @@ export class XmppClient {
|
|
|
494
501
|
this.status = 'online';
|
|
495
502
|
this.presencesReady = true;
|
|
496
503
|
this.reconnectAttempts = 0;
|
|
504
|
+
// Fresh stream: forget any probe failures from the dead one, and
|
|
505
|
+
// don't let the throttle suppress the first probe on it.
|
|
506
|
+
this.failedProbeStreak = 0;
|
|
507
|
+
this.lastStreamProbeAt = 0;
|
|
497
508
|
try {
|
|
498
509
|
devPushLog(
|
|
499
510
|
'xmpp',
|
|
@@ -655,8 +666,54 @@ export class XmppClient {
|
|
|
655
666
|
}
|
|
656
667
|
|
|
657
668
|
private streamAliveProbe: Promise<boolean> | null = null;
|
|
669
|
+
/** Wall-clock of the last probe, for throttling. */
|
|
670
|
+
private lastStreamProbeAt = 0;
|
|
671
|
+
/** Consecutive failed probes; a reconnect needs confirmation, not one miss. */
|
|
672
|
+
private failedProbeStreak = 0;
|
|
673
|
+
|
|
674
|
+
// --- liveness-probe tuning -------------------------------------------
|
|
675
|
+
// The probe exists to catch a ZOMBIE socket: the WebSocket still reads
|
|
676
|
+
// `online` but nothing traverses it (iOS suspending a backgrounded
|
|
677
|
+
// socket, the JS debugger pausing the runtime). Without it the client
|
|
678
|
+
// sits "online" forever and every send silently vanishes.
|
|
679
|
+
//
|
|
680
|
+
// The original settings were far too trigger-happy: a 4s budget for a
|
|
681
|
+
// ping round-trip, fired after EVERY send, with a single timeout
|
|
682
|
+
// immediately calling `forceReconnect()` — a full teardown, rebuild,
|
|
683
|
+
// MUC re-join and private-store refetch. On a slow or congested mobile
|
|
684
|
+
// link a perfectly healthy but quiet stream would miss that 4s window
|
|
685
|
+
// and get torn down mid-conversation, repeatedly. (That reconnect is
|
|
686
|
+
// also what used to replay the outbound queue and duplicate a message
|
|
687
|
+
// that had already been delivered — customer-reported #31.)
|
|
688
|
+
//
|
|
689
|
+
// Tuned to: a realistic timeout, a throttle so bursts of sends can't
|
|
690
|
+
// each start a probe, and a required second failure before we tear a
|
|
691
|
+
// connection down. Zombie sockets fail every probe, so they are still
|
|
692
|
+
// caught — just after confirmation rather than on one unlucky RTT.
|
|
693
|
+
/** Per-probe budget. 4s was under a slow-network ping RTT. */
|
|
694
|
+
private streamProbeTimeoutMs = 10_000;
|
|
695
|
+
/** Minimum gap between probes, so a burst of sends probes at most once. */
|
|
696
|
+
private minStreamProbeIntervalMs = 15_000;
|
|
697
|
+
/** Delay before the confirmation probe that a teardown requires. */
|
|
698
|
+
private streamProbeConfirmDelayMs = 2_000;
|
|
699
|
+
/** Failures needed before `forceReconnect()`. */
|
|
700
|
+
private streamProbeFailuresForReconnect = 2;
|
|
701
|
+
/** Host opt-out for the send-path probe (`xmppPingOnSendEnabled`). */
|
|
702
|
+
private pingOnSendEnabled = true;
|
|
658
703
|
|
|
659
|
-
|
|
704
|
+
/**
|
|
705
|
+
* Send-path liveness check. Throttled and skippable by config — unlike
|
|
706
|
+
* the watchdog, this fires from user activity and must not turn a chatty
|
|
707
|
+
* room into a probe storm.
|
|
708
|
+
*/
|
|
709
|
+
ensureStreamAliveAfterSend(): void {
|
|
710
|
+
if (!this.pingOnSendEnabled) {return;}
|
|
711
|
+
this.ensureStreamAlive({ reason: 'send' }).catch(() => {});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
verifyStreamAlive(
|
|
715
|
+
timeoutMs: number = this.streamProbeTimeoutMs
|
|
716
|
+
): Promise<boolean> {
|
|
660
717
|
if (this.status !== 'online' || !this.client) {
|
|
661
718
|
return Promise.resolve(false);
|
|
662
719
|
}
|
|
@@ -688,16 +745,70 @@ export class XmppClient {
|
|
|
688
745
|
return this.streamAliveProbe;
|
|
689
746
|
}
|
|
690
747
|
|
|
691
|
-
|
|
748
|
+
/**
|
|
749
|
+
* Check that the stream is really carrying traffic, and tear it down only
|
|
750
|
+
* if that is confirmed false.
|
|
751
|
+
*
|
|
752
|
+
* `force` skips the throttle — used by the periodic watchdog and the
|
|
753
|
+
* NetInfo "we're reachable again" signal, which are already rare and
|
|
754
|
+
* genuinely want to know right now. Send-path callers leave it off so a
|
|
755
|
+
* burst of messages triggers at most one probe.
|
|
756
|
+
*/
|
|
757
|
+
async ensureStreamAlive(opts?: {
|
|
758
|
+
force?: boolean;
|
|
759
|
+
reason?: string;
|
|
760
|
+
}): Promise<void> {
|
|
692
761
|
if (this.suppressReconnect || this.status !== 'online') {return;}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (
|
|
762
|
+
|
|
763
|
+
const now = Date.now();
|
|
764
|
+
if (
|
|
765
|
+
!opts?.force &&
|
|
766
|
+
now - this.lastStreamProbeAt < this.minStreamProbeIntervalMs
|
|
767
|
+
) {
|
|
768
|
+
// Probed recently — a healthy answer is still fresh, and a dead
|
|
769
|
+
// socket will be caught by the next watchdog tick anyway.
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
this.lastStreamProbeAt = now;
|
|
773
|
+
|
|
774
|
+
const alive = await this.verifyStreamAlive();
|
|
775
|
+
|
|
776
|
+
// Re-check state: a reconnect may have started while we waited.
|
|
777
|
+
if (this.status !== 'online' || this.suppressReconnect) {return;}
|
|
778
|
+
|
|
779
|
+
if (alive) {
|
|
780
|
+
this.failedProbeStreak = 0;
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
this.failedProbeStreak += 1;
|
|
785
|
+
if (this.failedProbeStreak < this.streamProbeFailuresForReconnect) {
|
|
786
|
+
// One missed probe is not proof of a dead socket — a congested link
|
|
787
|
+
// or a busy server can blow the budget on a stream that is fine.
|
|
788
|
+
// Confirm with a second probe shortly, instead of tearing down a
|
|
789
|
+
// working connection on a single unlucky round trip.
|
|
696
790
|
try {
|
|
697
|
-
devPushLog(
|
|
791
|
+
devPushLog(
|
|
792
|
+
'xmpp',
|
|
793
|
+
`stream probe missed (${this.failedProbeStreak}/${this.streamProbeFailuresForReconnect}) — confirming before reconnect`
|
|
794
|
+
);
|
|
698
795
|
} catch {}
|
|
699
|
-
|
|
796
|
+
setTimeout(() => {
|
|
797
|
+
this.ensureStreamAlive({ force: true, reason: 'probe-confirm' }).catch(
|
|
798
|
+
() => {}
|
|
799
|
+
);
|
|
800
|
+
}, this.streamProbeConfirmDelayMs);
|
|
801
|
+
return;
|
|
700
802
|
}
|
|
803
|
+
|
|
804
|
+
this.failedProbeStreak = 0;
|
|
805
|
+
try {
|
|
806
|
+
devPushLog(
|
|
807
|
+
'xmpp',
|
|
808
|
+
'stream is zombie (probe unanswered twice) → forceReconnect'
|
|
809
|
+
);
|
|
810
|
+
} catch {}
|
|
811
|
+
this.forceReconnect();
|
|
701
812
|
}
|
|
702
813
|
|
|
703
814
|
async reconnect() {
|
|
@@ -33,9 +33,7 @@ export interface ChatState {
|
|
|
33
33
|
|
|
34
34
|
export const unpackAndTransform = (input?: User): User => {
|
|
35
35
|
return {
|
|
36
|
-
|
|
37
|
-
// the profile's About section could never show one.
|
|
38
|
-
description: input?.description || '',
|
|
36
|
+
description: '',
|
|
39
37
|
token: input?.token || '',
|
|
40
38
|
profileImage: input?.profileImage || '',
|
|
41
39
|
_id: input?._id || '',
|
|
@@ -317,8 +317,6 @@ const reducers = {
|
|
|
317
317
|
: [];
|
|
318
318
|
state.rooms[roomData.jid] = {
|
|
319
319
|
...roomData,
|
|
320
|
-
icon: roomData.icon !== undefined ? roomData.icon : existing?.icon,
|
|
321
|
-
roomBg: roomData.roomBg !== undefined ? roomData.roomBg : existing?.roomBg,
|
|
322
320
|
messages:
|
|
323
321
|
existingMessages.length > 0 ? existingMessages : incomingMessages,
|
|
324
322
|
lastViewedTimestamp: lastViewed,
|
|
@@ -545,6 +543,25 @@ const reducers = {
|
|
|
545
543
|
) => {
|
|
546
544
|
state.isUnreadSyncing = action.payload;
|
|
547
545
|
},
|
|
546
|
+
/**
|
|
547
|
+
* Records how far the user has actually read in a room: the timestamp
|
|
548
|
+
* of the newest message they had reached when they scrolled away from
|
|
549
|
+
* the bottom, or `null` while they are at the bottom.
|
|
550
|
+
*
|
|
551
|
+
* Written only by MessageList as the user scrolls. Deliberately does
|
|
552
|
+
* NOT touch `unreadMessages` or `lastViewedTimestamp` — it only tells
|
|
553
|
+
* the various "mark this room read" paths what value to stamp instead
|
|
554
|
+
* of `Date.now()`. Customer-reported #33.
|
|
555
|
+
*/
|
|
556
|
+
setReadBoundary: (
|
|
557
|
+
state: WritableDraft<RoomMessagesState>,
|
|
558
|
+
action: PayloadAction<{ chatJID: string; boundaryTs: number | null }>
|
|
559
|
+
) => {
|
|
560
|
+
const { chatJID, boundaryTs } = action.payload;
|
|
561
|
+
if (state.rooms[chatJID]) {
|
|
562
|
+
state.rooms[chatJID].readBoundaryTs = boundaryTs;
|
|
563
|
+
}
|
|
564
|
+
},
|
|
548
565
|
setLastViewedTimestamp: (
|
|
549
566
|
state: WritableDraft<RoomMessagesState>,
|
|
550
567
|
action: PayloadAction<{ chatJID: string; timestamp: number }>
|
|
@@ -901,6 +918,7 @@ export const {
|
|
|
901
918
|
setIsLoading,
|
|
902
919
|
setUnreadSyncing,
|
|
903
920
|
setLastViewedTimestamp,
|
|
921
|
+
setReadBoundary,
|
|
904
922
|
applyPrivateStoreMarkers,
|
|
905
923
|
setRoomNoMessages,
|
|
906
924
|
setCurrentRoom,
|
|
@@ -50,6 +50,21 @@ export interface IRoom {
|
|
|
50
50
|
composingList?: string[];
|
|
51
51
|
lastViewedTimestamp?: number;
|
|
52
52
|
unreadMessages?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Timestamp of the newest message the user had actually reached when
|
|
55
|
+
* they scrolled away from the bottom of this room, or null/undefined
|
|
56
|
+
* while they are at the bottom (everything on screen is read).
|
|
57
|
+
*
|
|
58
|
+
* Lives in the store rather than in ChatRoom's local state because
|
|
59
|
+
* several code paths outside the component mark a room read — the
|
|
60
|
+
* AppState background handler, the `isVisible` consumer signal, the
|
|
61
|
+
* visible-room auto-advance, `useChatRoomFocus` — and all of them must
|
|
62
|
+
* stamp what the user actually saw instead of `Date.now()`. Stamping
|
|
63
|
+
* "now" while they are scrolled up silently destroys unread messages,
|
|
64
|
+
* and because those paths also flush to the server-side private store
|
|
65
|
+
* the loss survives an app restart. Customer-reported #33.
|
|
66
|
+
*/
|
|
67
|
+
readBoundaryTs?: number | null;
|
|
53
68
|
noMessages?: boolean;
|
|
54
69
|
role?: string;
|
|
55
70
|
|
package/src/types/types.ts
CHANGED
|
@@ -33,6 +33,21 @@ export interface IRoom {
|
|
|
33
33
|
composingList?: string[];
|
|
34
34
|
lastViewedTimestamp?: number;
|
|
35
35
|
unreadMessages?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Timestamp of the newest message the user had actually reached when
|
|
38
|
+
* they scrolled away from the bottom of this room; null/undefined while
|
|
39
|
+
* they are at the bottom (everything on screen is read).
|
|
40
|
+
*
|
|
41
|
+
* Written only by MessageList as the user scrolls. Every path that marks
|
|
42
|
+
* a room read must prefer this over `Date.now()` — the AppState
|
|
43
|
+
* background handler, the `isVisible` consumer signal, the visible-room
|
|
44
|
+
* auto-advance, `useChatRoomFocus` and logout all flush to the
|
|
45
|
+
* server-side private store, so stamping "now" while the user is
|
|
46
|
+
* scrolled up destroys unread messages permanently (survives an app
|
|
47
|
+
* restart, because the bad marker comes back from the server).
|
|
48
|
+
* Customer-reported #33.
|
|
49
|
+
*/
|
|
50
|
+
readBoundaryTs?: number | null;
|
|
36
51
|
noMessages?: boolean;
|
|
37
52
|
role?: string;
|
|
38
53
|
createdAt?: string | number | Date;
|
|
@@ -310,16 +325,13 @@ export interface TypographyConfig {
|
|
|
310
325
|
};
|
|
311
326
|
/** Attach (photo/document picker) bottom sheet. */
|
|
312
327
|
attachSheet?: {
|
|
313
|
-
/** "
|
|
328
|
+
/** "Attach" header label. Default 13 / "600". */
|
|
314
329
|
title?: ChatTextStyle;
|
|
315
|
-
/**
|
|
316
|
-
viewLibrary?: ChatTextStyle;
|
|
317
|
-
/** Row labels ("Upload a File"). Default 16 / "500". */
|
|
330
|
+
/** Row labels (Camera / Gallery / Document). Default 16 / "500". */
|
|
318
331
|
rowLabel?: ChatTextStyle;
|
|
319
|
-
/**
|
|
332
|
+
/** Grey hint under each row. Default 12. */
|
|
320
333
|
rowHint?: ChatTextStyle;
|
|
321
|
-
/**
|
|
322
|
-
* the backdrop, dragging it down, or the hardware back gesture. */
|
|
334
|
+
/** Cancel button. Default 16 / "600". */
|
|
323
335
|
cancelButton?: ChatTextStyle;
|
|
324
336
|
};
|
|
325
337
|
|
|
@@ -425,7 +437,7 @@ export interface IConfig {
|
|
|
425
437
|
hideMemberSendMessageAction?: boolean; // hides only "Message"
|
|
426
438
|
hideMemberCopyIdAction?: boolean; // hides only "Copy User Id"
|
|
427
439
|
chatHeaderAdditional?: { enabled: boolean; element: any };
|
|
428
|
-
headerMenu?: (
|
|
440
|
+
headerMenu?: () => void;
|
|
429
441
|
headerChatMenu?: () => void;
|
|
430
442
|
chatHeaderSettings?: {
|
|
431
443
|
hide?: boolean;
|
|
@@ -457,20 +469,6 @@ export interface IConfig {
|
|
|
457
469
|
loginFunction: () => Promise<User | null>;
|
|
458
470
|
};
|
|
459
471
|
defaultLogin?: boolean;
|
|
460
|
-
logout?: {
|
|
461
|
-
enabled: boolean;
|
|
462
|
-
label?: string;
|
|
463
|
-
confirm?:
|
|
464
|
-
| boolean
|
|
465
|
-
| {
|
|
466
|
-
title?: string;
|
|
467
|
-
message?: string;
|
|
468
|
-
confirmText?: string;
|
|
469
|
-
cancelText?: string;
|
|
470
|
-
};
|
|
471
|
-
onBeforeLogout?: () => Promise<boolean | void> | boolean | void;
|
|
472
|
-
onAfterLogout?: () => Promise<void> | void;
|
|
473
|
-
};
|
|
474
472
|
refreshTokens?: {
|
|
475
473
|
enabled: boolean;
|
|
476
474
|
/**
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _reactRedux = require("react-redux");
|
|
10
|
-
var _roomStore = require("../../../roomStore");
|
|
11
|
-
var _rooms = require("../../../networking/api-requests/rooms.api");
|
|
12
|
-
var _ToastContext = require("../../../context/ToastContext");
|
|
13
|
-
var _useT = require("../../../i18n/useT");
|
|
14
|
-
var _getIconColor = require("../../../helpers/getIconColor");
|
|
15
|
-
var _useChatSettingState = require("../../../hooks/useChatSettingState");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
-
/** @format */
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Category ids go to `POST /v1/chats/reports/{chatName}` as-is; the labels
|
|
22
|
-
* come from the i18n table, which already carried `report.category.*`
|
|
23
|
-
* strings in all six locales with nothing rendering them until now.
|
|
24
|
-
*/const CATEGORIES = ['spam', 'violence', 'childAbuse', 'pornography', 'personalDetails', 'illegalDrugs', 'other'];
|
|
25
|
-
const ReportChatModal = ({
|
|
26
|
-
visible,
|
|
27
|
-
onClose
|
|
28
|
-
}) => {
|
|
29
|
-
const t = (0, _useT.useT)();
|
|
30
|
-
const {
|
|
31
|
-
showToast
|
|
32
|
-
} = (0, _ToastContext.useToast)();
|
|
33
|
-
const {
|
|
34
|
-
config
|
|
35
|
-
} = (0, _useChatSettingState.useChatSettingState)();
|
|
36
|
-
const activeRoom = (0, _reactRedux.useSelector)(state => (0, _roomStore.getActiveRoom)(state));
|
|
37
|
-
const [category, setCategory] = (0, _react.useState)(null);
|
|
38
|
-
const [details, setDetails] = (0, _react.useState)('');
|
|
39
|
-
const [sending, setSending] = (0, _react.useState)(false);
|
|
40
|
-
const primary = (0, _getIconColor.getIconColor)(config);
|
|
41
|
-
const close = () => {
|
|
42
|
-
setCategory(null);
|
|
43
|
-
setDetails('');
|
|
44
|
-
onClose();
|
|
45
|
-
};
|
|
46
|
-
const submit = async () => {
|
|
47
|
-
if (!category || sending) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
setSending(true);
|
|
51
|
-
try {
|
|
52
|
-
await (0, _rooms.postReportRoom)({
|
|
53
|
-
chatName: activeRoom?.jid?.split('@')[0] || '',
|
|
54
|
-
category,
|
|
55
|
-
text: details.trim() || undefined
|
|
56
|
-
});
|
|
57
|
-
showToast({
|
|
58
|
-
id: Date.now().toString(),
|
|
59
|
-
title: 'Success',
|
|
60
|
-
message: t('modal.report.chatTitle'),
|
|
61
|
-
type: 'success'
|
|
62
|
-
});
|
|
63
|
-
close();
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.error('Failed to report chat:', error);
|
|
66
|
-
showToast({
|
|
67
|
-
id: Date.now().toString(),
|
|
68
|
-
title: 'Error',
|
|
69
|
-
message: t('modal.report.chatTitle'),
|
|
70
|
-
type: 'error'
|
|
71
|
-
});
|
|
72
|
-
} finally {
|
|
73
|
-
setSending(false);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
77
|
-
transparent: true,
|
|
78
|
-
visible: visible,
|
|
79
|
-
animationType: "fade",
|
|
80
|
-
onRequestClose: close,
|
|
81
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
82
|
-
style: styles.backdrop,
|
|
83
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
84
|
-
testID: "report-backdrop",
|
|
85
|
-
style: _reactNative.StyleSheet.absoluteFill,
|
|
86
|
-
activeOpacity: 1,
|
|
87
|
-
onPress: close
|
|
88
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
89
|
-
style: styles.card,
|
|
90
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
91
|
-
style: styles.title,
|
|
92
|
-
children: t('modal.report.chatTitle')
|
|
93
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
94
|
-
style: styles.categories,
|
|
95
|
-
children: CATEGORIES.map(id => {
|
|
96
|
-
const selected = category === id;
|
|
97
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
98
|
-
testID: `report-category-${id}`,
|
|
99
|
-
activeOpacity: 0.7,
|
|
100
|
-
onPress: () => setCategory(id),
|
|
101
|
-
style: [styles.category, selected && {
|
|
102
|
-
borderColor: primary,
|
|
103
|
-
backgroundColor: primary + '14'
|
|
104
|
-
}],
|
|
105
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
106
|
-
style: [styles.categoryLabel, selected && {
|
|
107
|
-
color: primary
|
|
108
|
-
}],
|
|
109
|
-
children: t(`report.category.${id}`)
|
|
110
|
-
})
|
|
111
|
-
}, id);
|
|
112
|
-
})
|
|
113
|
-
}), category === 'other' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
114
|
-
testID: "report-details",
|
|
115
|
-
style: styles.input,
|
|
116
|
-
placeholder: t('modal.report.otherDetails'),
|
|
117
|
-
placeholderTextColor: "#8C8C8C",
|
|
118
|
-
value: details,
|
|
119
|
-
onChangeText: setDetails,
|
|
120
|
-
multiline: true
|
|
121
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
122
|
-
style: styles.buttons,
|
|
123
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
124
|
-
activeOpacity: 0.7,
|
|
125
|
-
style: [styles.button, styles.cancel],
|
|
126
|
-
onPress: close,
|
|
127
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
128
|
-
style: styles.cancelLabel,
|
|
129
|
-
children: t('action.cancel')
|
|
130
|
-
})
|
|
131
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
132
|
-
testID: "report-submit",
|
|
133
|
-
activeOpacity: 0.7,
|
|
134
|
-
disabled: !category || sending,
|
|
135
|
-
style: [styles.button, {
|
|
136
|
-
backgroundColor: primary,
|
|
137
|
-
opacity: !category || sending ? 0.5 : 1
|
|
138
|
-
}],
|
|
139
|
-
onPress: submit,
|
|
140
|
-
children: sending ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
141
|
-
color: "#FFFFFF"
|
|
142
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
143
|
-
style: styles.submitLabel,
|
|
144
|
-
children: t('action.send')
|
|
145
|
-
})
|
|
146
|
-
})]
|
|
147
|
-
})]
|
|
148
|
-
})]
|
|
149
|
-
})
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
const styles = _reactNative.StyleSheet.create({
|
|
153
|
-
backdrop: {
|
|
154
|
-
flex: 1,
|
|
155
|
-
backgroundColor: 'rgba(15,15,20,0.45)',
|
|
156
|
-
alignItems: 'center',
|
|
157
|
-
justifyContent: 'center',
|
|
158
|
-
padding: 24
|
|
159
|
-
},
|
|
160
|
-
card: {
|
|
161
|
-
width: '100%',
|
|
162
|
-
borderRadius: 16,
|
|
163
|
-
backgroundColor: '#FFFFFF',
|
|
164
|
-
padding: 20
|
|
165
|
-
},
|
|
166
|
-
title: {
|
|
167
|
-
fontSize: 18,
|
|
168
|
-
fontWeight: '600',
|
|
169
|
-
color: '#141414',
|
|
170
|
-
marginBottom: 16
|
|
171
|
-
},
|
|
172
|
-
categories: {
|
|
173
|
-
flexDirection: 'row',
|
|
174
|
-
flexWrap: 'wrap',
|
|
175
|
-
gap: 8
|
|
176
|
-
},
|
|
177
|
-
category: {
|
|
178
|
-
paddingHorizontal: 12,
|
|
179
|
-
paddingVertical: 8,
|
|
180
|
-
borderRadius: 20,
|
|
181
|
-
borderWidth: 1,
|
|
182
|
-
borderColor: '#E4E4E9'
|
|
183
|
-
},
|
|
184
|
-
categoryLabel: {
|
|
185
|
-
fontSize: 14,
|
|
186
|
-
color: '#141414'
|
|
187
|
-
},
|
|
188
|
-
input: {
|
|
189
|
-
marginTop: 16,
|
|
190
|
-
minHeight: 80,
|
|
191
|
-
borderRadius: 12,
|
|
192
|
-
borderWidth: 1,
|
|
193
|
-
borderColor: '#E4E4E9',
|
|
194
|
-
padding: 12,
|
|
195
|
-
fontSize: 14,
|
|
196
|
-
color: '#141414',
|
|
197
|
-
textAlignVertical: 'top'
|
|
198
|
-
},
|
|
199
|
-
buttons: {
|
|
200
|
-
flexDirection: 'row',
|
|
201
|
-
gap: 12,
|
|
202
|
-
marginTop: 20
|
|
203
|
-
},
|
|
204
|
-
button: {
|
|
205
|
-
flex: 1,
|
|
206
|
-
height: 44,
|
|
207
|
-
borderRadius: 12,
|
|
208
|
-
alignItems: 'center',
|
|
209
|
-
justifyContent: 'center'
|
|
210
|
-
},
|
|
211
|
-
cancel: {
|
|
212
|
-
backgroundColor: '#F2F2F7'
|
|
213
|
-
},
|
|
214
|
-
cancelLabel: {
|
|
215
|
-
fontSize: 16,
|
|
216
|
-
fontWeight: '500',
|
|
217
|
-
color: '#141414'
|
|
218
|
-
},
|
|
219
|
-
submitLabel: {
|
|
220
|
-
fontSize: 16,
|
|
221
|
-
fontWeight: '600',
|
|
222
|
-
color: '#FFFFFF'
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
var _default = exports.default = ReportChatModal;
|
|
226
|
-
//# sourceMappingURL=ReportChatModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactRedux","_roomStore","_rooms","_ToastContext","_useT","_getIconColor","_useChatSettingState","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CATEGORIES","ReportChatModal","visible","onClose","useT","showToast","useToast","config","useChatSettingState","activeRoom","useSelector","state","getActiveRoom","category","setCategory","useState","details","setDetails","sending","setSending","primary","getIconColor","close","submit","postReportRoom","chatName","jid","split","text","trim","undefined","id","Date","now","toString","title","message","type","error","console","jsx","Modal","transparent","animationType","onRequestClose","children","jsxs","View","style","styles","backdrop","TouchableOpacity","testID","StyleSheet","absoluteFill","activeOpacity","onPress","card","Text","categories","map","selected","borderColor","backgroundColor","categoryLabel","color","TextInput","input","placeholder","placeholderTextColor","value","onChangeText","multiline","buttons","button","cancel","cancelLabel","disabled","opacity","ActivityIndicator","submitLabel","create","flex","alignItems","justifyContent","padding","width","borderRadius","fontSize","fontWeight","marginBottom","flexDirection","flexWrap","gap","paddingHorizontal","paddingVertical","borderWidth","marginTop","minHeight","textAlignVertical","height","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/Modals/ChatProfileModal/ReportChatModal.tsx"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AAAyE,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAD,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,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