@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
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
markMessageFailed,
|
|
11
11
|
} from '../roomStore/roomHeapSlice';
|
|
12
12
|
import { uploadFileV2 } from '../networking/api-requests/auth.api';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
enqueueOutboundSend,
|
|
15
|
+
markOutboundSentLive,
|
|
16
|
+
removeOutboundSend,
|
|
17
|
+
} from '../networking/outboundQueue';
|
|
14
18
|
import { RootState, store } from '../roomStore';
|
|
15
19
|
import { getGlobalXmppClient } from '../utils/clientRegistry';
|
|
16
20
|
import { useEventHandlers } from './useEventHandlers';
|
|
@@ -304,15 +308,36 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
304
308
|
}
|
|
305
309
|
|
|
306
310
|
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);
|
|
307
315
|
try {
|
|
308
|
-
|
|
316
|
+
// Throttled + config-gated: a burst of sends starts at most one
|
|
317
|
+
// probe, and a single missed probe no longer tears the stream
|
|
318
|
+
// down. See ensureStreamAliveAfterSend / ensureStreamAlive.
|
|
319
|
+
effectiveClient.ensureStreamAliveAfterSend?.();
|
|
309
320
|
} catch {}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
321
|
+
// Post-send notification ONLY. Deliberately outside the try below:
|
|
322
|
+
// `handleMessageSent` re-throws whatever the host app's
|
|
323
|
+
// `eventHandlers.onMessageSent` callback throws, and this runs
|
|
324
|
+
// AFTER the stanza was already delivered — letting that reach the
|
|
325
|
+
// catch marked a delivered message "Failed → tap to retry" purely
|
|
326
|
+
// because a consumer's analytics/webhook hook was slow or errored.
|
|
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
|
+
}
|
|
316
341
|
} catch (error) {
|
|
317
342
|
clearTimeout(watchdogTimer);
|
|
318
343
|
// Same reasoning as the watchdog: once the bubble shows failed,
|
|
@@ -580,7 +605,7 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
580
605
|
id
|
|
581
606
|
);
|
|
582
607
|
try {
|
|
583
|
-
effectiveMediaClient.
|
|
608
|
+
effectiveMediaClient.ensureStreamAliveAfterSend?.();
|
|
584
609
|
} catch {}
|
|
585
610
|
} else {
|
|
586
611
|
const anyMediaClient: any =
|
|
@@ -603,21 +628,32 @@ export const useSendMessage = (_configOverride?: IConfig) => {
|
|
|
603
628
|
}
|
|
604
629
|
}
|
|
605
630
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
631
|
+
// Post-send notification ONLY — see the text path: the upload and
|
|
632
|
+
// stanza send have already succeeded here, so a throw from the
|
|
633
|
+
// host's `onMessageSent` callback must not flip this to "Failed".
|
|
634
|
+
// Customer-reported #31.
|
|
635
|
+
try {
|
|
636
|
+
await handleMessageSent({
|
|
637
|
+
message: 'media',
|
|
638
|
+
roomJID: activeRoomJID,
|
|
639
|
+
user,
|
|
640
|
+
messageType: 'media',
|
|
641
|
+
metadata: {
|
|
642
|
+
isReply,
|
|
643
|
+
isChecked,
|
|
644
|
+
mainMessage,
|
|
645
|
+
fileData: data,
|
|
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
|
+
}
|
|
621
657
|
} catch (error: any) {
|
|
622
658
|
// Upload (or stanza send) threw an explicit error. Clear the
|
|
623
659
|
// watchdog so it doesn't double-fire `markMessageFailed`.
|
package/src/i18n/strings.ts
CHANGED
|
@@ -15,8 +15,6 @@ export type UiStringTable = Record<string, string>;
|
|
|
15
15
|
|
|
16
16
|
const en: UiStringTable = {
|
|
17
17
|
'search.placeholder': 'Search...',
|
|
18
|
-
'search.members': 'Search members',
|
|
19
|
-
'search.noResults': 'Nobody found',
|
|
20
18
|
'input.placeholder': 'Type message',
|
|
21
19
|
'room.created': 'Room created',
|
|
22
20
|
'room.empty': 'This chat is empty',
|
|
@@ -91,10 +89,6 @@ const en: UiStringTable = {
|
|
|
91
89
|
'action.add': 'Add',
|
|
92
90
|
'action.backToCreation': 'Back to creation',
|
|
93
91
|
'action.report': 'Report',
|
|
94
|
-
'action.search': 'Search',
|
|
95
|
-
'action.edit': 'Edit',
|
|
96
|
-
'action.deleteAndLeave': 'Delete and Leave',
|
|
97
|
-
'status.banned': 'banned',
|
|
98
92
|
'status.connecting': 'Connecting…',
|
|
99
93
|
'status.noInternet': 'No internet connection',
|
|
100
94
|
'translation.translating': 'Translating…',
|
|
@@ -106,10 +100,7 @@ const en: UiStringTable = {
|
|
|
106
100
|
'translation.modeManual': 'Manual',
|
|
107
101
|
'language.select': 'Select language',
|
|
108
102
|
'modal.newChat.title': 'Create New Chat',
|
|
109
|
-
'modal.newChat.roomNamePlaceholder': '
|
|
110
|
-
'modal.newChat.descriptionPlaceholder': 'Description (optional)',
|
|
111
|
-
'modal.newChat.createButton': 'Create new chat',
|
|
112
|
-
'modal.newChat.nameTooShort': 'Chat name must be at least 3 characters.',
|
|
103
|
+
'modal.newChat.roomNamePlaceholder': 'Enter Room Name',
|
|
113
104
|
'modal.newChat.chatTypePlaceholder': 'Select chat type',
|
|
114
105
|
'modal.newChat.selectUsersTitle': 'Select users to add to Chat',
|
|
115
106
|
'modal.selectUsers.title': 'Select Users (max 20)',
|
|
@@ -151,8 +142,6 @@ const en: UiStringTable = {
|
|
|
151
142
|
'action.call': 'Call',
|
|
152
143
|
'action.audioCall': 'Audio call',
|
|
153
144
|
'action.copyUserId': 'Copy User Id',
|
|
154
|
-
'action.account': 'Account',
|
|
155
|
-
'action.share': 'Share',
|
|
156
145
|
'action.deleteChat': 'Delete chat',
|
|
157
146
|
'action.appointAsAdmin': 'Appoint as an admin',
|
|
158
147
|
'action.moreOptions': 'More Options',
|
|
@@ -171,21 +160,12 @@ const en: UiStringTable = {
|
|
|
171
160
|
'auth.anonymousLoginMessage': 'You are logged in anonymously!',
|
|
172
161
|
'modal.profile.title': 'Profile',
|
|
173
162
|
'modal.profile.about': 'About',
|
|
174
|
-
'modal.profile.language': 'Language',
|
|
175
|
-
'modal.profile.media': 'Media',
|
|
176
|
-
'modal.profile.documents': 'Documents',
|
|
177
|
-
'modal.profile.noFiles': 'Nothing here yet',
|
|
178
163
|
'modal.profile.noDescription': 'No description',
|
|
179
164
|
'modal.chatProfile.title': 'Chat Profile',
|
|
180
165
|
'modal.chatProfile.description': 'Description',
|
|
181
166
|
'modal.chatProfile.chatType': 'Chat type',
|
|
182
167
|
'modal.chatProfile.memberCountSingular': '{count} member',
|
|
183
168
|
'modal.chatProfile.memberCountPlural': '{count} members',
|
|
184
|
-
'modal.chatProfile.addMembers': 'Add Members',
|
|
185
|
-
'modal.chatProfile.removePhoto': 'Remove photo',
|
|
186
|
-
'modal.chatProfile.membersLabel': 'Members: {count}',
|
|
187
|
-
'modal.chatProfile.membersUnavailable': 'Member list unavailable',
|
|
188
|
-
'modal.chatProfile.removeMember': 'Remove from this chat?',
|
|
189
169
|
'modal.deleteChat.title': 'Delete this chat ?',
|
|
190
170
|
'modal.addMembers.title': 'Add New Member',
|
|
191
171
|
'modal.addMembers.userIdPlaceholder': 'Enter User Id',
|
|
@@ -243,8 +223,6 @@ const en: UiStringTable = {
|
|
|
243
223
|
|
|
244
224
|
const fr: UiStringTable = {
|
|
245
225
|
'search.placeholder': 'Rechercher...',
|
|
246
|
-
'search.members': 'Rechercher des membres',
|
|
247
|
-
'search.noResults': 'Personne trouvée',
|
|
248
226
|
'input.placeholder': 'Écrire un message',
|
|
249
227
|
'room.created': 'Salon créé',
|
|
250
228
|
'room.empty': 'Ce salon est vide',
|
|
@@ -319,10 +297,6 @@ const fr: UiStringTable = {
|
|
|
319
297
|
'action.add': 'Ajouter',
|
|
320
298
|
'action.backToCreation': 'Retour à la création',
|
|
321
299
|
'action.report': 'Signaler',
|
|
322
|
-
'action.search': 'Rechercher',
|
|
323
|
-
'action.edit': 'Modifier',
|
|
324
|
-
'action.deleteAndLeave': 'Supprimer et quitter',
|
|
325
|
-
'status.banned': 'banni',
|
|
326
300
|
'status.connecting': 'Connexion…',
|
|
327
301
|
'status.noInternet': 'Pas de connexion internet',
|
|
328
302
|
'translation.translating': 'Traduction…',
|
|
@@ -335,9 +309,6 @@ const fr: UiStringTable = {
|
|
|
335
309
|
'language.select': 'Choisir la langue',
|
|
336
310
|
'modal.newChat.title': 'Créer une discussion',
|
|
337
311
|
'modal.newChat.roomNamePlaceholder': 'Nom du salon',
|
|
338
|
-
'modal.newChat.descriptionPlaceholder': 'Description (facultatif)',
|
|
339
|
-
'modal.newChat.createButton': 'Créer la discussion',
|
|
340
|
-
'modal.newChat.nameTooShort': 'Le nom doit contenir au moins 3 caractères.',
|
|
341
312
|
'modal.newChat.chatTypePlaceholder': 'Choisir le type de discussion',
|
|
342
313
|
'modal.newChat.selectUsersTitle': 'Sélectionner des utilisateurs à ajouter',
|
|
343
314
|
'modal.selectUsers.title': 'Sélectionner des utilisateurs (max 20)',
|
|
@@ -379,8 +350,6 @@ const fr: UiStringTable = {
|
|
|
379
350
|
'action.call': 'Appeler',
|
|
380
351
|
'action.audioCall': 'Appel audio',
|
|
381
352
|
'action.copyUserId': "Copier l'ID utilisateur",
|
|
382
|
-
'action.account': 'Compte',
|
|
383
|
-
'action.share': 'Partager',
|
|
384
353
|
'action.deleteChat': 'Supprimer la discussion',
|
|
385
354
|
'action.appointAsAdmin': 'Nommer administrateur',
|
|
386
355
|
'action.moreOptions': "Plus d'options",
|
|
@@ -399,21 +368,12 @@ const fr: UiStringTable = {
|
|
|
399
368
|
'auth.anonymousLoginMessage': 'Vous êtes connecté anonymement !',
|
|
400
369
|
'modal.profile.title': 'Profil',
|
|
401
370
|
'modal.profile.about': 'À propos',
|
|
402
|
-
'modal.profile.language': 'Langue',
|
|
403
|
-
'modal.profile.media': 'Médias',
|
|
404
|
-
'modal.profile.documents': 'Documents',
|
|
405
|
-
'modal.profile.noFiles': 'Rien pour le moment',
|
|
406
371
|
'modal.profile.noDescription': 'Aucune description',
|
|
407
372
|
'modal.chatProfile.title': 'Profil de la discussion',
|
|
408
373
|
'modal.chatProfile.description': 'Description',
|
|
409
374
|
'modal.chatProfile.chatType': 'Type de discussion',
|
|
410
375
|
'modal.chatProfile.memberCountSingular': '{count} membre',
|
|
411
376
|
'modal.chatProfile.memberCountPlural': '{count} membres',
|
|
412
|
-
'modal.chatProfile.addMembers': 'Ajouter des membres',
|
|
413
|
-
'modal.chatProfile.removePhoto': 'Supprimer la photo',
|
|
414
|
-
'modal.chatProfile.membersLabel': 'Membres : {count}',
|
|
415
|
-
'modal.chatProfile.membersUnavailable': 'Liste des membres indisponible',
|
|
416
|
-
'modal.chatProfile.removeMember': 'Retirer de cette discussion ?',
|
|
417
377
|
'modal.deleteChat.title': 'Supprimer cette discussion ?',
|
|
418
378
|
'modal.addMembers.title': 'Ajouter un nouveau membre',
|
|
419
379
|
'modal.addMembers.userIdPlaceholder': "Entrez l'ID utilisateur",
|
|
@@ -471,8 +431,6 @@ const fr: UiStringTable = {
|
|
|
471
431
|
|
|
472
432
|
const es: UiStringTable = {
|
|
473
433
|
'search.placeholder': 'Buscar...',
|
|
474
|
-
'search.members': 'Buscar miembros',
|
|
475
|
-
'search.noResults': 'No se encontró a nadie',
|
|
476
434
|
'input.placeholder': 'Escribe un mensaje',
|
|
477
435
|
'room.created': 'Sala creada',
|
|
478
436
|
'room.empty': 'Este chat está vacío',
|
|
@@ -547,10 +505,6 @@ const es: UiStringTable = {
|
|
|
547
505
|
'action.add': 'Añadir',
|
|
548
506
|
'action.backToCreation': 'Volver a la creación',
|
|
549
507
|
'action.report': 'Reportar',
|
|
550
|
-
'action.search': 'Buscar',
|
|
551
|
-
'action.edit': 'Editar',
|
|
552
|
-
'action.deleteAndLeave': 'Eliminar y salir',
|
|
553
|
-
'status.banned': 'bloqueado',
|
|
554
508
|
'status.connecting': 'Conectando…',
|
|
555
509
|
'status.noInternet': 'Sin conexión a internet',
|
|
556
510
|
'translation.translating': 'Traduciendo…',
|
|
@@ -563,9 +517,6 @@ const es: UiStringTable = {
|
|
|
563
517
|
'language.select': 'Seleccionar idioma',
|
|
564
518
|
'modal.newChat.title': 'Crear nuevo chat',
|
|
565
519
|
'modal.newChat.roomNamePlaceholder': 'Nombre de la sala',
|
|
566
|
-
'modal.newChat.descriptionPlaceholder': 'Descripción (opcional)',
|
|
567
|
-
'modal.newChat.createButton': 'Crear chat',
|
|
568
|
-
'modal.newChat.nameTooShort': 'El nombre debe tener al menos 3 caracteres.',
|
|
569
520
|
'modal.newChat.chatTypePlaceholder': 'Selecciona el tipo de chat',
|
|
570
521
|
'modal.newChat.selectUsersTitle': 'Selecciona usuarios para añadir al chat',
|
|
571
522
|
'modal.selectUsers.title': 'Seleccionar usuarios (máx. 20)',
|
|
@@ -607,8 +558,6 @@ const es: UiStringTable = {
|
|
|
607
558
|
'action.call': 'Llamar',
|
|
608
559
|
'action.audioCall': 'Llamada de audio',
|
|
609
560
|
'action.copyUserId': 'Copiar ID de usuario',
|
|
610
|
-
'action.account': 'Cuenta',
|
|
611
|
-
'action.share': 'Compartir',
|
|
612
561
|
'action.deleteChat': 'Eliminar chat',
|
|
613
562
|
'action.appointAsAdmin': 'Nombrar administrador',
|
|
614
563
|
'action.moreOptions': 'Más opciones',
|
|
@@ -627,21 +576,12 @@ const es: UiStringTable = {
|
|
|
627
576
|
'auth.anonymousLoginMessage': '¡Has iniciado sesión de forma anónima!',
|
|
628
577
|
'modal.profile.title': 'Perfil',
|
|
629
578
|
'modal.profile.about': 'Acerca de',
|
|
630
|
-
'modal.profile.language': 'Idioma',
|
|
631
|
-
'modal.profile.media': 'Multimedia',
|
|
632
|
-
'modal.profile.documents': 'Documentos',
|
|
633
|
-
'modal.profile.noFiles': 'Todavía no hay nada',
|
|
634
579
|
'modal.profile.noDescription': 'Sin descripción',
|
|
635
580
|
'modal.chatProfile.title': 'Perfil del chat',
|
|
636
581
|
'modal.chatProfile.description': 'Descripción',
|
|
637
582
|
'modal.chatProfile.chatType': 'Tipo de chat',
|
|
638
583
|
'modal.chatProfile.memberCountSingular': '{count} miembro',
|
|
639
584
|
'modal.chatProfile.memberCountPlural': '{count} miembros',
|
|
640
|
-
'modal.chatProfile.addMembers': 'Añadir miembros',
|
|
641
|
-
'modal.chatProfile.removePhoto': 'Quitar la foto',
|
|
642
|
-
'modal.chatProfile.membersLabel': 'Miembros: {count}',
|
|
643
|
-
'modal.chatProfile.membersUnavailable': 'Lista de miembros no disponible',
|
|
644
|
-
'modal.chatProfile.removeMember': '¿Quitar de este chat?',
|
|
645
585
|
'modal.deleteChat.title': '¿Eliminar este chat?',
|
|
646
586
|
'modal.addMembers.title': 'Añadir nuevo miembro',
|
|
647
587
|
'modal.addMembers.userIdPlaceholder': 'Introduce el ID de usuario',
|
|
@@ -699,8 +639,6 @@ const es: UiStringTable = {
|
|
|
699
639
|
|
|
700
640
|
const pt: UiStringTable = {
|
|
701
641
|
'search.placeholder': 'Pesquisar...',
|
|
702
|
-
'search.members': 'Pesquisar membros',
|
|
703
|
-
'search.noResults': 'Ninguém encontrado',
|
|
704
642
|
'input.placeholder': 'Escreva uma mensagem',
|
|
705
643
|
'room.created': 'Sala criada',
|
|
706
644
|
'room.empty': 'Este chat está vazio',
|
|
@@ -775,10 +713,6 @@ const pt: UiStringTable = {
|
|
|
775
713
|
'action.add': 'Adicionar',
|
|
776
714
|
'action.backToCreation': 'Voltar à criação',
|
|
777
715
|
'action.report': 'Denunciar',
|
|
778
|
-
'action.search': 'Pesquisar',
|
|
779
|
-
'action.edit': 'Editar',
|
|
780
|
-
'action.deleteAndLeave': 'Eliminar e sair',
|
|
781
|
-
'status.banned': 'banido',
|
|
782
716
|
'status.connecting': 'A ligar…',
|
|
783
717
|
'status.noInternet': 'Sem ligação à internet',
|
|
784
718
|
'translation.translating': 'A traduzir…',
|
|
@@ -791,9 +725,6 @@ const pt: UiStringTable = {
|
|
|
791
725
|
'language.select': 'Selecionar idioma',
|
|
792
726
|
'modal.newChat.title': 'Criar novo chat',
|
|
793
727
|
'modal.newChat.roomNamePlaceholder': 'Nome da sala',
|
|
794
|
-
'modal.newChat.descriptionPlaceholder': 'Descrição (opcional)',
|
|
795
|
-
'modal.newChat.createButton': 'Criar conversa',
|
|
796
|
-
'modal.newChat.nameTooShort': 'O nome deve ter pelo menos 3 caracteres.',
|
|
797
728
|
'modal.newChat.chatTypePlaceholder': 'Selecione o tipo de chat',
|
|
798
729
|
'modal.newChat.selectUsersTitle': 'Selecione utilizadores para adicionar ao chat',
|
|
799
730
|
'modal.selectUsers.title': 'Selecionar utilizadores (máx. 20)',
|
|
@@ -835,8 +766,6 @@ const pt: UiStringTable = {
|
|
|
835
766
|
'action.call': 'Ligar',
|
|
836
767
|
'action.audioCall': 'Chamada de áudio',
|
|
837
768
|
'action.copyUserId': 'Copiar ID do utilizador',
|
|
838
|
-
'action.account': 'Conta',
|
|
839
|
-
'action.share': 'Partilhar',
|
|
840
769
|
'action.deleteChat': 'Eliminar chat',
|
|
841
770
|
'action.appointAsAdmin': 'Nomear administrador',
|
|
842
771
|
'action.moreOptions': 'Mais opções',
|
|
@@ -855,21 +784,12 @@ const pt: UiStringTable = {
|
|
|
855
784
|
'auth.anonymousLoginMessage': 'Iniciou sessão anonimamente!',
|
|
856
785
|
'modal.profile.title': 'Perfil',
|
|
857
786
|
'modal.profile.about': 'Sobre',
|
|
858
|
-
'modal.profile.language': 'Idioma',
|
|
859
|
-
'modal.profile.media': 'Multimédia',
|
|
860
|
-
'modal.profile.documents': 'Documentos',
|
|
861
|
-
'modal.profile.noFiles': 'Ainda não há nada aqui',
|
|
862
787
|
'modal.profile.noDescription': 'Sem descrição',
|
|
863
788
|
'modal.chatProfile.title': 'Perfil do chat',
|
|
864
789
|
'modal.chatProfile.description': 'Descrição',
|
|
865
790
|
'modal.chatProfile.chatType': 'Tipo de chat',
|
|
866
791
|
'modal.chatProfile.memberCountSingular': '{count} membro',
|
|
867
792
|
'modal.chatProfile.memberCountPlural': '{count} membros',
|
|
868
|
-
'modal.chatProfile.addMembers': 'Adicionar membros',
|
|
869
|
-
'modal.chatProfile.removePhoto': 'Remover foto',
|
|
870
|
-
'modal.chatProfile.membersLabel': 'Membros: {count}',
|
|
871
|
-
'modal.chatProfile.membersUnavailable': 'Lista de membros indisponível',
|
|
872
|
-
'modal.chatProfile.removeMember': 'Remover deste chat?',
|
|
873
793
|
'modal.deleteChat.title': 'Eliminar este chat?',
|
|
874
794
|
'modal.addMembers.title': 'Adicionar novo membro',
|
|
875
795
|
'modal.addMembers.userIdPlaceholder': 'Introduza o ID do utilizador',
|
|
@@ -927,8 +847,6 @@ const pt: UiStringTable = {
|
|
|
927
847
|
|
|
928
848
|
const ht: UiStringTable = {
|
|
929
849
|
'search.placeholder': 'Chèche...',
|
|
930
|
-
'search.members': 'Chèche manm',
|
|
931
|
-
'search.noResults': 'Pa jwenn pèsonn',
|
|
932
850
|
'input.placeholder': 'Ekri yon mesaj',
|
|
933
851
|
'room.created': 'Sal la kreye',
|
|
934
852
|
'room.empty': 'Chat sa a vid',
|
|
@@ -1003,10 +921,6 @@ const ht: UiStringTable = {
|
|
|
1003
921
|
'action.add': 'Ajoute',
|
|
1004
922
|
'action.backToCreation': 'Retounen nan kreyasyon',
|
|
1005
923
|
'action.report': 'Rapòte',
|
|
1006
|
-
'action.search': 'Chèche',
|
|
1007
|
-
'action.edit': 'Modifye',
|
|
1008
|
-
'action.deleteAndLeave': 'Efase epi kite',
|
|
1009
|
-
'status.banned': 'bloke',
|
|
1010
924
|
'status.connecting': 'Koneksyon…',
|
|
1011
925
|
'status.noInternet': 'Pa gen koneksyon entènèt',
|
|
1012
926
|
'translation.translating': 'Ap tradui…',
|
|
@@ -1019,9 +933,6 @@ const ht: UiStringTable = {
|
|
|
1019
933
|
'language.select': 'Chwazi lang',
|
|
1020
934
|
'modal.newChat.title': 'Kreye yon nouvo chat',
|
|
1021
935
|
'modal.newChat.roomNamePlaceholder': 'Antre non sal la',
|
|
1022
|
-
'modal.newChat.descriptionPlaceholder': 'Deskripsyon (opsyonèl)',
|
|
1023
|
-
'modal.newChat.createButton': 'Kreye chat la',
|
|
1024
|
-
'modal.newChat.nameTooShort': 'Non an dwe gen omwen 3 karaktè.',
|
|
1025
936
|
'modal.newChat.chatTypePlaceholder': 'Chwazi tip chat la',
|
|
1026
937
|
'modal.newChat.selectUsersTitle': 'Chwazi itilizatè pou ajoute nan chat la',
|
|
1027
938
|
'modal.selectUsers.title': 'Chwazi itilizatè (maksimòm 20)',
|
|
@@ -1063,8 +974,6 @@ const ht: UiStringTable = {
|
|
|
1063
974
|
'action.call': 'Rele',
|
|
1064
975
|
'action.audioCall': 'Apèl odyo',
|
|
1065
976
|
'action.copyUserId': 'Kopye ID itilizatè a',
|
|
1066
|
-
'action.account': 'Kont',
|
|
1067
|
-
'action.share': 'Pataje',
|
|
1068
977
|
'action.deleteChat': 'Efase chat la',
|
|
1069
978
|
'action.appointAsAdmin': 'Nonmen kòm administratè',
|
|
1070
979
|
'action.moreOptions': 'Plis opsyon',
|
|
@@ -1083,21 +992,12 @@ const ht: UiStringTable = {
|
|
|
1083
992
|
'auth.anonymousLoginMessage': 'Ou konekte anonim!',
|
|
1084
993
|
'modal.profile.title': 'Pwofil',
|
|
1085
994
|
'modal.profile.about': 'Konsènan',
|
|
1086
|
-
'modal.profile.language': 'Lang',
|
|
1087
|
-
'modal.profile.media': 'Medya',
|
|
1088
|
-
'modal.profile.documents': 'Dokiman',
|
|
1089
|
-
'modal.profile.noFiles': 'Poko gen anyen',
|
|
1090
995
|
'modal.profile.noDescription': 'Pa gen deskripsyon',
|
|
1091
996
|
'modal.chatProfile.title': 'Pwofil chat la',
|
|
1092
997
|
'modal.chatProfile.description': 'Deskripsyon',
|
|
1093
998
|
'modal.chatProfile.chatType': 'Tip chat',
|
|
1094
999
|
'modal.chatProfile.memberCountSingular': '{count} manm',
|
|
1095
1000
|
'modal.chatProfile.memberCountPlural': '{count} manm',
|
|
1096
|
-
'modal.chatProfile.addMembers': 'Ajoute manm',
|
|
1097
|
-
'modal.chatProfile.removePhoto': 'Retire foto a',
|
|
1098
|
-
'modal.chatProfile.membersLabel': 'Manm: {count}',
|
|
1099
|
-
'modal.chatProfile.membersUnavailable': 'Lis manm yo pa disponib',
|
|
1100
|
-
'modal.chatProfile.removeMember': 'Retire nan chat sa a?',
|
|
1101
1001
|
'modal.deleteChat.title': 'Efase chat sa a?',
|
|
1102
1002
|
'modal.addMembers.title': 'Ajoute yon nouvo manm',
|
|
1103
1003
|
'modal.addMembers.userIdPlaceholder': 'Antre ID itilizatè a',
|
|
@@ -1155,8 +1055,6 @@ const ht: UiStringTable = {
|
|
|
1155
1055
|
|
|
1156
1056
|
const zh: UiStringTable = {
|
|
1157
1057
|
'search.placeholder': '搜索...',
|
|
1158
|
-
'search.members': '搜索成员',
|
|
1159
|
-
'search.noResults': '未找到成员',
|
|
1160
1058
|
'input.placeholder': '输入消息',
|
|
1161
1059
|
'room.created': '聊天室已创建',
|
|
1162
1060
|
'room.empty': '此聊天为空',
|
|
@@ -1231,10 +1129,6 @@ const zh: UiStringTable = {
|
|
|
1231
1129
|
'action.add': '添加',
|
|
1232
1130
|
'action.backToCreation': '返回创建',
|
|
1233
1131
|
'action.report': '举报',
|
|
1234
|
-
'action.search': '搜索',
|
|
1235
|
-
'action.edit': '编辑',
|
|
1236
|
-
'action.deleteAndLeave': '删除并退出',
|
|
1237
|
-
'status.banned': '已封禁',
|
|
1238
1132
|
'status.connecting': '连接中…',
|
|
1239
1133
|
'status.noInternet': '无网络连接',
|
|
1240
1134
|
'translation.translating': '翻译中…',
|
|
@@ -1247,9 +1141,6 @@ const zh: UiStringTable = {
|
|
|
1247
1141
|
'language.select': '选择语言',
|
|
1248
1142
|
'modal.newChat.title': '创建新聊天',
|
|
1249
1143
|
'modal.newChat.roomNamePlaceholder': '输入聊天室名称',
|
|
1250
|
-
'modal.newChat.descriptionPlaceholder': '描述(可选)',
|
|
1251
|
-
'modal.newChat.createButton': '创建聊天',
|
|
1252
|
-
'modal.newChat.nameTooShort': '名称至少需要 3 个字符。',
|
|
1253
1144
|
'modal.newChat.chatTypePlaceholder': '选择聊天类型',
|
|
1254
1145
|
'modal.newChat.selectUsersTitle': '选择要添加到聊天的用户',
|
|
1255
1146
|
'modal.selectUsers.title': '选择用户(最多 20 个)',
|
|
@@ -1291,8 +1182,6 @@ const zh: UiStringTable = {
|
|
|
1291
1182
|
'action.call': '通话',
|
|
1292
1183
|
'action.audioCall': '语音通话',
|
|
1293
1184
|
'action.copyUserId': '复制用户 ID',
|
|
1294
|
-
'action.account': '账户',
|
|
1295
|
-
'action.share': '分享',
|
|
1296
1185
|
'action.deleteChat': '删除聊天',
|
|
1297
1186
|
'action.appointAsAdmin': '设为管理员',
|
|
1298
1187
|
'action.moreOptions': '更多选项',
|
|
@@ -1311,21 +1200,12 @@ const zh: UiStringTable = {
|
|
|
1311
1200
|
'auth.anonymousLoginMessage': '您已匿名登录!',
|
|
1312
1201
|
'modal.profile.title': '个人资料',
|
|
1313
1202
|
'modal.profile.about': '简介',
|
|
1314
|
-
'modal.profile.language': '语言',
|
|
1315
|
-
'modal.profile.media': '媒体',
|
|
1316
|
-
'modal.profile.documents': '文件',
|
|
1317
|
-
'modal.profile.noFiles': '这里还没有内容',
|
|
1318
1203
|
'modal.profile.noDescription': '暂无简介',
|
|
1319
1204
|
'modal.chatProfile.title': '聊天资料',
|
|
1320
1205
|
'modal.chatProfile.description': '描述',
|
|
1321
1206
|
'modal.chatProfile.chatType': '聊天类型',
|
|
1322
1207
|
'modal.chatProfile.memberCountSingular': '{count} 位成员',
|
|
1323
1208
|
'modal.chatProfile.memberCountPlural': '{count} 位成员',
|
|
1324
|
-
'modal.chatProfile.addMembers': '添加成员',
|
|
1325
|
-
'modal.chatProfile.removePhoto': '移除图片',
|
|
1326
|
-
'modal.chatProfile.membersLabel': '成员:{count}',
|
|
1327
|
-
'modal.chatProfile.membersUnavailable': '成员列表不可用',
|
|
1328
|
-
'modal.chatProfile.removeMember': '将其移出该聊天?',
|
|
1329
1209
|
'modal.deleteChat.title': '删除此聊天?',
|
|
1330
1210
|
'modal.addMembers.title': '添加新成员',
|
|
1331
1211
|
'modal.addMembers.userIdPlaceholder': '输入用户 ID',
|
package/src/main.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { XmppProvider } from './context/xmppProvider';
|
|
|
32
32
|
// Hooks that consumers usually need (badge counts, logout, push, etc.).
|
|
33
33
|
export { useUnread } from './hooks/useUnreadMessagesCounter';
|
|
34
34
|
export { useChatRoomFocus } from './hooks/useChatRoomFocus';
|
|
35
|
-
export { logoutService
|
|
35
|
+
export { logoutService } from './hooks/useLogout';
|
|
36
36
|
export { useQRCodeChat, handleQRChatId } from './hooks/useQRCodeChatHandler';
|
|
37
37
|
export { resendMessage } from './utils/resendMessage';
|
|
38
38
|
// Font loader, exposed so hosts can also load the font outside <Chat> if needed.
|
|
@@ -74,74 +74,3 @@ export async function updateProfile(fd: FormData): Promise<{ user: User }> {
|
|
|
74
74
|
throw new Error('Error updating profile');
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
/** One entry of `GET /v2/files/`, normalised for the UI. */
|
|
79
|
-
export interface UserFile {
|
|
80
|
-
id: string;
|
|
81
|
-
name: string;
|
|
82
|
-
url: string;
|
|
83
|
-
mimetype: string;
|
|
84
|
-
createdAt?: string;
|
|
85
|
-
size?: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Files uploaded by the signed-in user (the JWT owner) — the profile
|
|
90
|
-
* screen's Media and Documents tabs.
|
|
91
|
-
*
|
|
92
|
-
* v2 answers `{ results, pagination }` and, for backward compatibility,
|
|
93
|
-
* also `{ limit, offset, total, items }`; older deployments only have the
|
|
94
|
-
* legacy shape. Read whichever is there instead of betting on one. Field
|
|
95
|
-
* names vary the same way between deployments (`location` vs `locations[]`,
|
|
96
|
-
* `originalname` vs `filename`), so each one falls through its aliases and
|
|
97
|
-
* anything without a usable URL is dropped rather than rendered as a dead
|
|
98
|
-
* row.
|
|
99
|
-
*/
|
|
100
|
-
export async function getUserFiles(options?: {
|
|
101
|
-
limit?: number;
|
|
102
|
-
offset?: number;
|
|
103
|
-
}): Promise<UserFile[]> {
|
|
104
|
-
const token = store.getState().chatSettingStore.user.token || '';
|
|
105
|
-
const response = await http.get('/v2/files/', {
|
|
106
|
-
params: {
|
|
107
|
-
limit: options?.limit ?? 100,
|
|
108
|
-
offset: options?.offset ?? 0,
|
|
109
|
-
},
|
|
110
|
-
headers: { Authorization: token },
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
const payload = response?.data ?? {};
|
|
114
|
-
const rows: any[] = payload.results ?? payload.items ?? [];
|
|
115
|
-
|
|
116
|
-
return rows
|
|
117
|
-
.map((row: any): UserFile | null => {
|
|
118
|
-
const url = row?.location || row?.locations?.[0] || row?.url || '';
|
|
119
|
-
if (!url) {return null;}
|
|
120
|
-
return {
|
|
121
|
-
id: String(row?._id ?? row?.id ?? url),
|
|
122
|
-
name:
|
|
123
|
-
row?.originalname ||
|
|
124
|
-
row?.filename ||
|
|
125
|
-
row?.documentName ||
|
|
126
|
-
row?.name ||
|
|
127
|
-
url.split('/').pop() ||
|
|
128
|
-
'file',
|
|
129
|
-
url,
|
|
130
|
-
mimetype: row?.mimetype || row?.mimeType || row?.type || '',
|
|
131
|
-
createdAt: row?.createdAt || row?.updatedAt,
|
|
132
|
-
size: typeof row?.size === 'number' ? row.size : undefined,
|
|
133
|
-
};
|
|
134
|
-
})
|
|
135
|
-
.filter(Boolean) as UserFile[];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/** Images and video go to the Media tab, everything else to Documents. */
|
|
139
|
-
export const isMediaFile = (file: UserFile): boolean => {
|
|
140
|
-
const mime = (file.mimetype || '').toLowerCase();
|
|
141
|
-
if (mime.startsWith('image/') || mime.startsWith('video/')) {return true;}
|
|
142
|
-
if (mime) {return false;}
|
|
143
|
-
// Deployments that don't store a mimetype still name the file.
|
|
144
|
-
return /\.(jpe?g|png|gif|webp|heic|heif|mp4|mov|m4v|3gp|avi|mkv)$/i.test(
|
|
145
|
-
file.name
|
|
146
|
-
);
|
|
147
|
-
};
|
|
@@ -46,6 +46,21 @@ export interface QueuedSend {
|
|
|
46
46
|
* OUTBOUND_QUEUE_TTL_MS when omitted.
|
|
47
47
|
*/
|
|
48
48
|
ttlMs?: number;
|
|
49
|
+
/**
|
|
50
|
+
* True once the stanza was actually written to a live, online stream.
|
|
51
|
+
*
|
|
52
|
+
* Such a send has most likely reached the server already — only its
|
|
53
|
+
* echo may still be in flight. Blind-replaying it on the next 'online'
|
|
54
|
+
* event is what produced real duplicates on the recipient side: a send
|
|
55
|
+
* is followed by a liveness probe which, at the time, force-reconnected
|
|
56
|
+
* a perfectly healthy but quiet stream on a single missed 4s round trip
|
|
57
|
+
* — and the resulting reconnect flushed the queue. (That probe has since
|
|
58
|
+
* been throttled and confirmation-gated, but this guard is the one that
|
|
59
|
+
* actually makes a duplicate impossible.) The queue exists for
|
|
60
|
+
* sends that never made it onto the wire, so those are the only ones
|
|
61
|
+
* safe to replay unattended. Customer-reported #31.
|
|
62
|
+
*/
|
|
63
|
+
sentLive?: boolean;
|
|
49
64
|
/** Replays the original send against a live, online client. */
|
|
50
65
|
send: (client: OutboundQueueClient) => void;
|
|
51
66
|
}
|
|
@@ -88,6 +103,14 @@ export function flushOutboundSends(
|
|
|
88
103
|
// Stale — the send watchdog owns the failure; don't duplicate.
|
|
89
104
|
continue;
|
|
90
105
|
}
|
|
106
|
+
if (item.sentLive) {
|
|
107
|
+
// Already written to a live stream: the server very likely has it
|
|
108
|
+
// and we'd be sending a second copy. Let the pending watchdog own
|
|
109
|
+
// this one — if no echo ever arrives it surfaces as "Failed → tap
|
|
110
|
+
// to retry" and the USER decides, which is what the customer asked
|
|
111
|
+
// for ("a message the server accepted is never sent again").
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
91
114
|
try {
|
|
92
115
|
item.send(client);
|
|
93
116
|
} catch (err) {
|
|
@@ -103,6 +126,12 @@ export function flushOutboundSends(
|
|
|
103
126
|
* the send went through, so the buffered replay is no longer needed and must
|
|
104
127
|
* not fire on a later reconnect. No-op if the id isn't queued.
|
|
105
128
|
*/
|
|
129
|
+
export function markOutboundSentLive(optimisticId: string): void {
|
|
130
|
+
if (!optimisticId) {return;}
|
|
131
|
+
const item = queue.find((q) => q.optimisticId === optimisticId);
|
|
132
|
+
if (item) {item.sentLive = true;}
|
|
133
|
+
}
|
|
134
|
+
|
|
106
135
|
export function removeOutboundSend(optimisticId: string): void {
|
|
107
136
|
if (!optimisticId) {return;}
|
|
108
137
|
const idx = queue.findIndex((q) => q.optimisticId === optimisticId);
|
|
@@ -246,7 +246,15 @@ const onMessageHistory = async (stanza: any) => {
|
|
|
246
246
|
mergedAttrs,
|
|
247
247
|
body,
|
|
248
248
|
id,
|
|
249
|
-
|
|
249
|
+
// `innerFrom` (the forwarded message's own `room@conference/nick`),
|
|
250
|
+
// NOT the outer MAM envelope's `from` — for an archive query the
|
|
251
|
+
// envelope is the BARE room jid with no resource, so passing it here
|
|
252
|
+
// stripped the sender out of `xmppFrom` and left `roomJid` derived
|
|
253
|
+
// from a value that carries no occupant identity. The correct
|
|
254
|
+
// occupant jid is already computed above for the senderJID fallback;
|
|
255
|
+
// use the same one so the archived copy carries the same sender
|
|
256
|
+
// identity the realtime path produces. Customer-reported #32.
|
|
257
|
+
innerFrom,
|
|
250
258
|
!!deleted
|
|
251
259
|
);
|
|
252
260
|
|