@ethora/chat-component-rn 26.5.5 → 26.5.10

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.
Files changed (420) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/README.md +67 -10
  3. package/index.js +24 -0
  4. package/lib/commonjs/assets/icons.js +5 -1
  5. package/lib/commonjs/assets/icons.js.map +1 -1
  6. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js +11 -5
  7. package/lib/commonjs/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  8. package/lib/commonjs/components/MainComponents/ChatHeader.js +7 -1
  9. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  10. package/lib/commonjs/components/MainComponents/ChatRoom.js +66 -34
  11. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  12. package/lib/commonjs/components/MainComponents/ChatWrapper.js +59 -14
  13. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  14. package/lib/commonjs/components/MainComponents/MediaMessage.js +15 -7
  15. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  16. package/lib/commonjs/components/MainComponents/MessageContainer.js +2 -2
  17. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  18. package/lib/commonjs/components/MainComponents/MessageList.js +175 -30
  19. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  20. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +17 -8
  21. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  22. package/lib/commonjs/components/MainComponents/SystemMessage.js +34 -22
  23. package/lib/commonjs/components/MainComponents/SystemMessage.js.map +1 -1
  24. package/lib/commonjs/components/MessageBubble/Message.js +117 -19
  25. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  26. package/lib/commonjs/components/MessageBubble/MessageInteractions.js +82 -22
  27. package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
  28. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +16 -4
  29. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  30. package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js +104 -0
  31. package/lib/commonjs/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
  32. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +175 -40
  33. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  34. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +29 -1
  35. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  36. package/lib/commonjs/components/Modals/Modal/Modal.js +5 -1
  37. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  38. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js +78 -39
  39. package/lib/commonjs/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  40. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
  41. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  42. package/lib/commonjs/components/Modals/styledModalComponents.js +4 -9
  43. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  44. package/lib/commonjs/components/styled/MediaFilePreview.js +115 -5
  45. package/lib/commonjs/components/styled/MediaFilePreview.js.map +1 -1
  46. package/lib/commonjs/components/styled/MessageImage.js +49 -10
  47. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  48. package/lib/commonjs/components/styled/NewMessageLabel.js +8 -6
  49. package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
  50. package/lib/commonjs/components/styled/SendInput.js +53 -29
  51. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  52. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js +14 -4
  53. package/lib/commonjs/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  54. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
  55. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  56. package/lib/commonjs/components/styled/UnsupportedType.js +5 -1
  57. package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
  58. package/lib/commonjs/components/styled/VideoMessage.js +60 -22
  59. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  60. package/lib/commonjs/context/MessageNotificationContext.js +7 -7
  61. package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
  62. package/lib/commonjs/context/xmppProvider.js +315 -34
  63. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  64. package/lib/commonjs/helpers/chatAutoEnterer.js +2 -7
  65. package/lib/commonjs/helpers/chatAutoEnterer.js.map +1 -1
  66. package/lib/commonjs/helpers/historyPreloadScheduler.js +4 -1
  67. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  68. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +15 -5
  69. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  70. package/lib/commonjs/helpers/keyboardLayout.js +18 -0
  71. package/lib/commonjs/helpers/keyboardLayout.js.map +1 -0
  72. package/lib/commonjs/helpers/mediaDimensions.js +51 -0
  73. package/lib/commonjs/helpers/mediaDimensions.js.map +1 -0
  74. package/lib/commonjs/helpers/mimeToExtension.js +131 -0
  75. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -0
  76. package/lib/commonjs/helpers/normalizeRoomJid.js +20 -0
  77. package/lib/commonjs/helpers/normalizeRoomJid.js.map +1 -0
  78. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +73 -1
  79. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  80. package/lib/commonjs/hooks/useChatRoomFocus.js +87 -0
  81. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -0
  82. package/lib/commonjs/hooks/useChatWrapperInit.js +22 -10
  83. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  84. package/lib/commonjs/hooks/useEventHandlers.js +9 -1
  85. package/lib/commonjs/hooks/useEventHandlers.js.map +1 -1
  86. package/lib/commonjs/hooks/useHeapSender.js +1 -1
  87. package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
  88. package/lib/commonjs/hooks/useLogout.js +3 -3
  89. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  90. package/lib/commonjs/hooks/useMessageHeapState.js +6 -2
  91. package/lib/commonjs/hooks/useMessageHeapState.js.map +1 -1
  92. package/lib/commonjs/hooks/usePushNotifications.js +6 -2
  93. package/lib/commonjs/hooks/usePushNotifications.js.map +1 -1
  94. package/lib/commonjs/hooks/useRoomState.js +2 -0
  95. package/lib/commonjs/hooks/useRoomState.js.map +1 -1
  96. package/lib/commonjs/hooks/useSendMessage.js +249 -14
  97. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  98. package/lib/commonjs/hooks/useUnreadMessagesCounter.js +12 -14
  99. package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
  100. package/lib/commonjs/main.js +7 -0
  101. package/lib/commonjs/main.js.map +1 -1
  102. package/lib/commonjs/networking/api-requests/auth.api.js +74 -1
  103. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  104. package/lib/commonjs/networking/apiClient.js +2 -1
  105. package/lib/commonjs/networking/apiClient.js.map +1 -1
  106. package/lib/commonjs/networking/outboundQueue.js +92 -0
  107. package/lib/commonjs/networking/outboundQueue.js.map +1 -0
  108. package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
  109. package/lib/commonjs/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
  110. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
  111. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  112. package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
  113. package/lib/commonjs/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
  114. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +26 -8
  115. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  116. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +2 -1
  117. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  118. package/lib/commonjs/networking/xmppClient.js +371 -26
  119. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  120. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +22 -6
  121. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  122. package/lib/commonjs/roomStore/roomHeapSlice.js +26 -8
  123. package/lib/commonjs/roomStore/roomHeapSlice.js.map +1 -1
  124. package/lib/commonjs/roomStore/roomsSlice.js +157 -23
  125. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  126. package/lib/commonjs/utils/installPromiseRejectionTracker.js +83 -0
  127. package/lib/commonjs/utils/installPromiseRejectionTracker.js.map +1 -0
  128. package/lib/commonjs/utils/resendMessage.js +1 -1
  129. package/lib/commonjs/utils/resendMessage.js.map +1 -1
  130. package/lib/module/assets/icons.js +5 -1
  131. package/lib/module/assets/icons.js.map +1 -1
  132. package/lib/module/components/ContextMenu/ContextMenuComponents.js +11 -5
  133. package/lib/module/components/ContextMenu/ContextMenuComponents.js.map +1 -1
  134. package/lib/module/components/MainComponents/ChatHeader.js +7 -1
  135. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  136. package/lib/module/components/MainComponents/ChatRoom.js +67 -35
  137. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  138. package/lib/module/components/MainComponents/ChatWrapper.js +59 -14
  139. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  140. package/lib/module/components/MainComponents/MediaMessage.js +15 -7
  141. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  142. package/lib/module/components/MainComponents/MessageContainer.js +2 -2
  143. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  144. package/lib/module/components/MainComponents/MessageList.js +176 -31
  145. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  146. package/lib/module/components/MainComponents/ReduxWrapper.js +18 -8
  147. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  148. package/lib/module/components/MainComponents/SystemMessage.js +33 -21
  149. package/lib/module/components/MainComponents/SystemMessage.js.map +1 -1
  150. package/lib/module/components/MessageBubble/Message.js +118 -20
  151. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  152. package/lib/module/components/MessageBubble/MessageInteractions.js +84 -24
  153. package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
  154. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +15 -3
  155. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  156. package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js +99 -0
  157. package/lib/module/components/Modals/FilePreviewModal/DocumentViewer.js.map +1 -0
  158. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +179 -42
  159. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  160. package/lib/module/components/Modals/FilePreviewModal/PdfView.js +31 -3
  161. package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  162. package/lib/module/components/Modals/Modal/Modal.js +5 -1
  163. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  164. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js +80 -41
  165. package/lib/module/components/Modals/ModalWrapper/ModalWrapper.js.map +1 -1
  166. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +3 -3
  167. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  168. package/lib/module/components/Modals/styledModalComponents.js +4 -9
  169. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  170. package/lib/module/components/styled/MediaFilePreview.js +116 -6
  171. package/lib/module/components/styled/MediaFilePreview.js.map +1 -1
  172. package/lib/module/components/styled/MessageImage.js +51 -12
  173. package/lib/module/components/styled/MessageImage.js.map +1 -1
  174. package/lib/module/components/styled/NewMessageLabel.js +8 -6
  175. package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
  176. package/lib/module/components/styled/SendInput.js +54 -30
  177. package/lib/module/components/styled/SendInput.js.map +1 -1
  178. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js +14 -4
  179. package/lib/module/components/styled/StyledInputComponents/MediaComponents.js.map +1 -1
  180. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +7 -2
  181. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  182. package/lib/module/components/styled/UnsupportedType.js +5 -1
  183. package/lib/module/components/styled/UnsupportedType.js.map +1 -1
  184. package/lib/module/components/styled/VideoMessage.js +61 -23
  185. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  186. package/lib/module/context/MessageNotificationContext.js +7 -7
  187. package/lib/module/context/MessageNotificationContext.js.map +1 -1
  188. package/lib/module/context/xmppProvider.js +319 -37
  189. package/lib/module/context/xmppProvider.js.map +1 -1
  190. package/lib/module/helpers/chatAutoEnterer.js +2 -7
  191. package/lib/module/helpers/chatAutoEnterer.js.map +1 -1
  192. package/lib/module/helpers/historyPreloadScheduler.js +4 -1
  193. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  194. package/lib/module/helpers/insertMessageWithDelimiter.js +15 -5
  195. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  196. package/lib/module/helpers/keyboardLayout.js +12 -0
  197. package/lib/module/helpers/keyboardLayout.js.map +1 -0
  198. package/lib/module/helpers/mediaDimensions.js +46 -0
  199. package/lib/module/helpers/mediaDimensions.js.map +1 -0
  200. package/lib/module/helpers/mimeToExtension.js +124 -0
  201. package/lib/module/helpers/mimeToExtension.js.map +1 -0
  202. package/lib/module/helpers/normalizeRoomJid.js +15 -0
  203. package/lib/module/helpers/normalizeRoomJid.js.map +1 -0
  204. package/lib/module/helpers/resolveInitBeforeLoadUser.js +71 -0
  205. package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  206. package/lib/module/hooks/useChatRoomFocus.js +82 -0
  207. package/lib/module/hooks/useChatRoomFocus.js.map +1 -0
  208. package/lib/module/hooks/useChatWrapperInit.js +22 -10
  209. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  210. package/lib/module/hooks/useEventHandlers.js +9 -1
  211. package/lib/module/hooks/useEventHandlers.js.map +1 -1
  212. package/lib/module/hooks/useHeapSender.js +1 -1
  213. package/lib/module/hooks/useHeapSender.js.map +1 -1
  214. package/lib/module/hooks/useLogout.js +3 -3
  215. package/lib/module/hooks/useLogout.js.map +1 -1
  216. package/lib/module/hooks/useMessageHeapState.js +6 -2
  217. package/lib/module/hooks/useMessageHeapState.js.map +1 -1
  218. package/lib/module/hooks/usePushNotifications.js +6 -2
  219. package/lib/module/hooks/usePushNotifications.js.map +1 -1
  220. package/lib/module/hooks/useRoomState.js +2 -0
  221. package/lib/module/hooks/useRoomState.js.map +1 -1
  222. package/lib/module/hooks/useSendMessage.js +252 -17
  223. package/lib/module/hooks/useSendMessage.js.map +1 -1
  224. package/lib/module/hooks/useUnreadMessagesCounter.js +12 -14
  225. package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
  226. package/lib/module/main.js +1 -0
  227. package/lib/module/main.js.map +1 -1
  228. package/lib/module/networking/api-requests/auth.api.js +74 -2
  229. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  230. package/lib/module/networking/apiClient.js +2 -1
  231. package/lib/module/networking/apiClient.js.map +1 -1
  232. package/lib/module/networking/outboundQueue.js +84 -0
  233. package/lib/module/networking/outboundQueue.js.map +1 -0
  234. package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js +4 -1
  235. package/lib/module/networking/xmpp/createTimeoutPromise.xmpp.js.map +1 -1
  236. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +7 -8
  237. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  238. package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js +26 -3
  239. package/lib/module/networking/xmpp/getRoomsPaged.xmpp.js.map +1 -1
  240. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +26 -8
  241. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  242. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +2 -1
  243. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  244. package/lib/module/networking/xmppClient.js +371 -26
  245. package/lib/module/networking/xmppClient.js.map +1 -1
  246. package/lib/module/roomStore/Middleware/unreadMidlleware.js +22 -6
  247. package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  248. package/lib/module/roomStore/roomHeapSlice.js +24 -7
  249. package/lib/module/roomStore/roomHeapSlice.js.map +1 -1
  250. package/lib/module/roomStore/roomsSlice.js +154 -22
  251. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  252. package/lib/module/utils/installPromiseRejectionTracker.js +78 -0
  253. package/lib/module/utils/installPromiseRejectionTracker.js.map +1 -0
  254. package/lib/module/utils/resendMessage.js +1 -1
  255. package/lib/module/utils/resendMessage.js.map +1 -1
  256. package/lib/typescript/assets/icons.d.ts +8 -4
  257. package/lib/typescript/assets/icons.d.ts.map +1 -1
  258. package/lib/typescript/components/ContextMenu/ContextMenuComponents.d.ts.map +1 -1
  259. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  260. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  261. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  262. package/lib/typescript/components/MainComponents/MediaMessage.d.ts +1 -0
  263. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  264. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  265. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  266. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts +1 -0
  267. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  268. package/lib/typescript/components/MainComponents/SystemMessage.d.ts +0 -7
  269. package/lib/typescript/components/MainComponents/SystemMessage.d.ts.map +1 -1
  270. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  271. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +4 -2
  272. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
  273. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  274. package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts +29 -0
  275. package/lib/typescript/components/Modals/FilePreviewModal/DocumentViewer.d.ts.map +1 -0
  276. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +0 -1
  277. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  278. package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
  279. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  280. package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts +6 -0
  281. package/lib/typescript/components/Modals/ModalWrapper/ModalWrapper.d.ts.map +1 -1
  282. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  283. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  284. package/lib/typescript/components/styled/MediaFilePreview.d.ts.map +1 -1
  285. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  286. package/lib/typescript/components/styled/NewMessageLabel.d.ts +1 -5
  287. package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
  288. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  289. package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts +9 -1
  290. package/lib/typescript/components/styled/StyledInputComponents/MediaComponents.d.ts.map +1 -1
  291. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  292. package/lib/typescript/components/styled/UnsupportedType.d.ts +1 -0
  293. package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
  294. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  295. package/lib/typescript/context/xmppProvider.d.ts +1 -0
  296. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  297. package/lib/typescript/helpers/chatAutoEnterer.d.ts.map +1 -1
  298. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  299. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  300. package/lib/typescript/helpers/keyboardLayout.d.ts +9 -0
  301. package/lib/typescript/helpers/keyboardLayout.d.ts.map +1 -0
  302. package/lib/typescript/helpers/mediaDimensions.d.ts +9 -0
  303. package/lib/typescript/helpers/mediaDimensions.d.ts.map +1 -0
  304. package/lib/typescript/helpers/mimeToExtension.d.ts +37 -0
  305. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -0
  306. package/lib/typescript/helpers/normalizeRoomJid.d.ts +2 -0
  307. package/lib/typescript/helpers/normalizeRoomJid.d.ts.map +1 -0
  308. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts +18 -0
  309. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
  310. package/lib/typescript/hooks/useChatRoomFocus.d.ts +42 -0
  311. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -0
  312. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  313. package/lib/typescript/hooks/useEventHandlers.d.ts +6 -0
  314. package/lib/typescript/hooks/useEventHandlers.d.ts.map +1 -1
  315. package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
  316. package/lib/typescript/hooks/useMessageHeapState.d.ts +2 -0
  317. package/lib/typescript/hooks/useMessageHeapState.d.ts.map +1 -1
  318. package/lib/typescript/hooks/usePushNotifications.d.ts.map +1 -1
  319. package/lib/typescript/hooks/useRoomState.d.ts +1 -0
  320. package/lib/typescript/hooks/useRoomState.d.ts.map +1 -1
  321. package/lib/typescript/hooks/useSendMessage.d.ts +2 -1
  322. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  323. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
  324. package/lib/typescript/main.d.ts +1 -0
  325. package/lib/typescript/main.d.ts.map +1 -1
  326. package/lib/typescript/networking/api-requests/auth.api.d.ts +3 -0
  327. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  328. package/lib/typescript/networking/apiClient.d.ts.map +1 -1
  329. package/lib/typescript/networking/outboundQueue.d.ts +57 -0
  330. package/lib/typescript/networking/outboundQueue.d.ts.map +1 -0
  331. package/lib/typescript/networking/xmpp/createTimeoutPromise.xmpp.d.ts.map +1 -1
  332. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +1 -1
  333. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
  334. package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts +1 -1
  335. package/lib/typescript/networking/xmpp/getRoomsPaged.xmpp.d.ts.map +1 -1
  336. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  337. package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
  338. package/lib/typescript/networking/xmppClient.d.ts +58 -5
  339. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  340. package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
  341. package/lib/typescript/roomStore/roomHeapSlice.d.ts +22 -1
  342. package/lib/typescript/roomStore/roomHeapSlice.d.ts.map +1 -1
  343. package/lib/typescript/roomStore/roomsSlice.d.ts +8 -1
  344. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  345. package/lib/typescript/types/models/media.model.d.ts +1 -0
  346. package/lib/typescript/types/models/media.model.d.ts.map +1 -1
  347. package/lib/typescript/types/models/xmpp.model.d.ts +1 -1
  348. package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
  349. package/lib/typescript/types/types.d.ts +10 -0
  350. package/lib/typescript/types/types.d.ts.map +1 -1
  351. package/lib/typescript/utils/installPromiseRejectionTracker.d.ts +20 -0
  352. package/lib/typescript/utils/installPromiseRejectionTracker.d.ts.map +1 -0
  353. package/lib/typescript/utils/resendMessage.d.ts.map +1 -1
  354. package/package.json +18 -2
  355. package/src/assets/icons.tsx +23 -14
  356. package/src/components/ContextMenu/ContextMenuComponents.tsx +10 -5
  357. package/src/components/MainComponents/ChatHeader.tsx +5 -1
  358. package/src/components/MainComponents/ChatRoom.tsx +81 -61
  359. package/src/components/MainComponents/ChatWrapper.tsx +100 -21
  360. package/src/components/MainComponents/MediaMessage.tsx +18 -8
  361. package/src/components/MainComponents/MessageContainer.tsx +4 -2
  362. package/src/components/MainComponents/MessageList.tsx +185 -31
  363. package/src/components/MainComponents/ReduxWrapper.tsx +19 -9
  364. package/src/components/MainComponents/SystemMessage.tsx +38 -26
  365. package/src/components/MessageBubble/Message.tsx +110 -27
  366. package/src/components/MessageBubble/MessageInteractions.tsx +98 -29
  367. package/src/components/Modals/AttachSheet/AttachSheet.tsx +17 -3
  368. package/src/components/Modals/FilePreviewModal/DocumentViewer.tsx +93 -0
  369. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +182 -37
  370. package/src/components/Modals/FilePreviewModal/PdfView.tsx +32 -4
  371. package/src/components/Modals/Modal/Modal.tsx +4 -1
  372. package/src/components/Modals/ModalWrapper/ModalWrapper.tsx +77 -44
  373. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +19 -15
  374. package/src/components/Modals/styledModalComponents.tsx +4 -9
  375. package/src/components/styled/MediaFilePreview.tsx +111 -5
  376. package/src/components/styled/MessageImage.tsx +58 -14
  377. package/src/components/styled/NewMessageLabel.tsx +8 -5
  378. package/src/components/styled/SendInput.tsx +67 -29
  379. package/src/components/styled/StyledInputComponents/MediaComponents.tsx +15 -5
  380. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +7 -2
  381. package/src/components/styled/UnsupportedType.tsx +7 -1
  382. package/src/components/styled/VideoMessage.tsx +59 -18
  383. package/src/context/MessageNotificationContext.tsx +8 -8
  384. package/src/context/xmppProvider.tsx +337 -32
  385. package/src/helpers/chatAutoEnterer.ts +2 -8
  386. package/src/helpers/historyPreloadScheduler.ts +4 -1
  387. package/src/helpers/insertMessageWithDelimiter.ts +22 -15
  388. package/src/helpers/keyboardLayout.ts +18 -0
  389. package/src/helpers/mediaDimensions.ts +47 -0
  390. package/src/helpers/mimeToExtension.ts +135 -0
  391. package/src/helpers/normalizeRoomJid.ts +6 -0
  392. package/src/helpers/resolveInitBeforeLoadUser.ts +79 -0
  393. package/src/hooks/useChatRoomFocus.ts +95 -0
  394. package/src/hooks/useChatWrapperInit.ts +51 -46
  395. package/src/hooks/useEventHandlers.tsx +24 -1
  396. package/src/hooks/useHeapSender.tsx +2 -1
  397. package/src/hooks/useLogout.tsx +3 -3
  398. package/src/hooks/useMessageHeapState.tsx +6 -2
  399. package/src/hooks/usePushNotifications.ts +21 -8
  400. package/src/hooks/useRoomState.tsx +4 -0
  401. package/src/hooks/useSendMessage.tsx +333 -17
  402. package/src/hooks/useUnreadMessagesCounter.ts +13 -16
  403. package/src/main.ts +1 -0
  404. package/src/networking/api-requests/auth.api.ts +60 -2
  405. package/src/networking/apiClient.ts +2 -1
  406. package/src/networking/outboundQueue.ts +98 -0
  407. package/src/networking/xmpp/createTimeoutPromise.xmpp.ts +5 -1
  408. package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +11 -13
  409. package/src/networking/xmpp/getRoomsPaged.xmpp.ts +27 -3
  410. package/src/networking/xmpp/presenceInRoom.xmpp.ts +24 -9
  411. package/src/networking/xmpp/sendTextMessage.xmpp.ts +2 -1
  412. package/src/networking/xmppClient.ts +399 -31
  413. package/src/roomStore/Middleware/unreadMidlleware.tsx +23 -5
  414. package/src/roomStore/roomHeapSlice.ts +47 -4
  415. package/src/roomStore/roomsSlice.ts +177 -27
  416. package/src/types/models/media.model.ts +3 -0
  417. package/src/types/models/xmpp.model.ts +2 -1
  418. package/src/types/types.ts +25 -0
  419. package/src/utils/installPromiseRejectionTracker.ts +91 -0
  420. package/src/utils/resendMessage.ts +2 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Returns the conventional extension (including the leading dot) for a
3
+ * MIME type, or `.bin` as a last-resort fallback so callers never end up
4
+ * with an extension-less filename.
5
+ */
6
+ export declare function getExtensionForMime(mime: string | undefined | null): string;
7
+ /**
8
+ * Parses a URL or file path and returns the last segment, URL-decoded,
9
+ * stripped of query/hash. Returns `''` when nothing usable is present.
10
+ */
11
+ export declare function filenameFromUrl(url: string | undefined | null): string;
12
+ /**
13
+ * Ensures `fileName` ends with a valid extension. Strategy:
14
+ * 1. If the input already has an extension, return it unchanged.
15
+ * 2. Otherwise, derive the extension from `mime` and append it.
16
+ * 3. If `mime` is unknown, append `.bin`.
17
+ *
18
+ * Empty/falsy filenames get a `media_<timestamp>` base before the
19
+ * extension is appended so callers always get a usable filename.
20
+ */
21
+ export declare function ensureFilenameHasExtension(fileName: string | undefined | null, mime: string | undefined | null): string;
22
+ /**
23
+ * Best-effort filename derivation for a message bubble:
24
+ * - server-provided `fileName`
25
+ * - server-provided `originalName`
26
+ * - URL pathname
27
+ * - generic `media_<timestamp>` so we never render an empty label
28
+ *
29
+ * Always returns a string with a valid extension.
30
+ */
31
+ export declare function deriveDisplayFilename(opts: {
32
+ fileName?: string | null;
33
+ originalName?: string | null;
34
+ url?: string | null;
35
+ mime?: string | null;
36
+ }): string;
37
+ //# sourceMappingURL=mimeToExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mimeToExtension.d.ts","sourceRoot":"","sources":["../../../src/helpers/mimeToExtension.ts"],"names":[],"mappings":"AAkEA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI3E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAWtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACnC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC9B,MAAM,CAKR;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GAAG,MAAM,CAOT"}
@@ -0,0 +1,2 @@
1
+ export declare const normalizeRoomJid: (roomJID: string, conference?: string) => string;
2
+ //# sourceMappingURL=normalizeRoomJid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeRoomJid.d.ts","sourceRoot":"","sources":["../../../src/helpers/normalizeRoomJid.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,EAAE,aAAa,MAAM,WAKpE,CAAC"}
@@ -5,5 +5,23 @@ interface ResolveInitBeforeLoadUserOptions {
5
5
  }
6
6
  export declare const resolveInitBeforeLoadUser: (options?: ResolveInitBeforeLoadUserOptions) => Promise<User | null>;
7
7
  export declare const applyResolvedUserToStore: (user?: User | null) => void;
8
+ /**
9
+ * Re-mints a User with a fresh xmppPassword for the XMPP credentials-
10
+ * provider path (bug #17). Unlike `resolveInitBeforeLoadUser` this
11
+ * ALWAYS hydrates via the chosen auth path even if the cached user
12
+ * already had xmppCredentials — that's the whole point, the old ones
13
+ * are stale.
14
+ *
15
+ * Selection order:
16
+ * 1. `jwtLogin` — re-exchange the JWT via `/users/client`.
17
+ * 2. Anything else (`userLogin` / `customLogin` / store / persisted)
18
+ * — `tryHydrateViaMy` on the current user, which calls
19
+ * `/users/my` and, on 401, refreshes the access token via
20
+ * `/users/login/refresh` and retries.
21
+ *
22
+ * Returns `null` only when nothing usable is available — the caller
23
+ * (xmppProvider) falls back to the cached creds in that case.
24
+ */
25
+ export declare const refreshUserCredentialsForXmpp: (config?: IConfig, signal?: AbortSignal) => Promise<User | null>;
8
26
  export default resolveInitBeforeLoadUser;
9
27
  //# sourceMappingURL=resolveInitBeforeLoadUser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveInitBeforeLoadUser.d.ts","sourceRoot":"","sources":["../../../src/helpers/resolveInitBeforeLoadUser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAO/C,UAAU,gCAAgC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AA6ID,eAAO,MAAM,yBAAyB,GACpC,UAAU,gCAAgC,KACzC,OAAO,CAAC,IAAI,GAAG,IAAI,CA4ErB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,IAAI,GAAG,IAAI,SAG1D,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"resolveInitBeforeLoadUser.d.ts","sourceRoot":"","sources":["../../../src/helpers/resolveInitBeforeLoadUser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAO/C,UAAU,gCAAgC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AA6ID,eAAO,MAAM,yBAAyB,GACpC,UAAU,gCAAgC,KACzC,OAAO,CAAC,IAAI,GAAG,IAAI,CA4ErB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,IAAI,GAAG,IAAI,SAG1D,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,6BAA6B,GACxC,SAAS,OAAO,EAChB,SAAS,WAAW,KACnB,OAAO,CAAC,IAAI,GAAG,IAAI,CAyDrB,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,42 @@
1
+ interface UseChatRoomFocusOptions {
2
+ /** The room JID that the consumer's tab/screen is currently showing. */
3
+ roomJID: string | null | undefined;
4
+ /**
5
+ * Whether the chat tab/screen is currently focused. In tab-based
6
+ * navigators where `<ChatRoom>` never unmounts, the SDK can't tell
7
+ * "user is looking at this tab" from "user is on a different tab"
8
+ * — pass this from `useFocusEffect` (React Navigation) or a similar
9
+ * focus signal so the unread counter clears on focus and starts
10
+ * counting again on blur.
11
+ */
12
+ isFocused: boolean;
13
+ }
14
+ /**
15
+ * Public hook for consumers embedding `<ChatRoom>` inside a tab-based
16
+ * navigator. Mirrors the mount/unmount unread-tracking that ChatRoom
17
+ * does internally — but driven by an explicit focus signal so the
18
+ * unread counter behaves correctly when the chat tab is not focused
19
+ * but the component is still mounted.
20
+ *
21
+ * Without this hook, `useUnread()` will always return 0 for the chat
22
+ * room because the SDK assumes "mounted == active". With this hook,
23
+ * focus marks the room visible (clearing the badge) and blur stamps
24
+ * `lastViewedTimestamp = Date.now()` so future messages count as unread.
25
+ *
26
+ * Usage with React Navigation:
27
+ *
28
+ * ```tsx
29
+ * import { useIsFocused } from '@react-navigation/native';
30
+ *
31
+ * function ChatTab() {
32
+ * const isFocused = useIsFocused();
33
+ * useChatRoomFocus({ roomJID: 'general@conference.host', isFocused });
34
+ * return <Chat config={...} />;
35
+ * }
36
+ * ```
37
+ *
38
+ * Bug #18-adjacent / unread-tracking bug from sdk-bug-tracker.md.
39
+ */
40
+ export declare const useChatRoomFocus: ({ roomJID, isFocused, }: UseChatRoomFocusOptions) => void;
41
+ export default useChatRoomFocus;
42
+ //# sourceMappingURL=useChatRoomFocus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChatRoomFocus.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatRoomFocus.ts"],"names":[],"mappings":"AAUA,UAAU,uBAAuB;IAC/B,wEAAwE;IACxE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;;;;;;OAOG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,uBAAuB,SAuCzB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useChatWrapperInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatWrapperInit.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAgBlD,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,wBAAwB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;IACnE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,kBAAkB,GAAI,uCAIzB,uBAAuB,KAAG,wBA4N5B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"useChatWrapperInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatWrapperInit.ts"],"names":[],"mappings":"AAAA,cAAc;AAId,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAgBlD,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,wBAAwB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;IACnE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,kBAAkB,GAAI,uCAIzB,uBAAuB,KAAG,wBAiO5B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -18,10 +18,16 @@ interface MessageEditedEvent {
18
18
  roomJID: string;
19
19
  user: any;
20
20
  }
21
+ interface MessageRetryEvent {
22
+ messageId: string;
23
+ roomJID: string;
24
+ messageType: 'text' | 'media';
25
+ }
21
26
  export interface EventHandlersHook {
22
27
  handleMessageSent: (event: MessageSentEvent) => Promise<void>;
23
28
  handleMessageFailed: (event: MessageFailedEvent) => void;
24
29
  handleMessageEdited: (event: MessageEditedEvent) => void;
30
+ handleMessageRetry: (event: MessageRetryEvent) => void;
25
31
  }
26
32
  export declare const useEventHandlers: (config?: IConfig) => EventHandlersHook;
27
33
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEventHandlers.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;IACV,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED,UAAU,kBAAkB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,mBAAmB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,iBAiDnD,CAAC"}
1
+ {"version":3,"file":"useEventHandlers.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEventHandlers.tsx"],"names":[],"mappings":"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UAAU,GAAG,IAAI;;CAiFtD,CAAC"}
1
+ {"version":3,"file":"useHeapSender.d.ts","sourceRoot":"","sources":["../../../src/hooks/useHeapSender.tsx"],"names":[],"mappings":"AAIA,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,eAAO,MAAM,aAAa,GAAI,QAAQ,UAAU,GAAG,IAAI;;CAkFtD,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export declare const useMessageHeapState: () => {
2
2
  queue: import("../main").IMessage[];
3
3
  idSet: Set<string>;
4
+ failedMessages: Record<string, import("../roomStore/roomHeapSlice").FailedMessagePayload>;
5
+ failedIdSet: Set<string>;
4
6
  };
5
7
  //# sourceMappingURL=useMessageHeapState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMessageHeapState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMessageHeapState.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;CAO/B,CAAC"}
1
+ {"version":3,"file":"useMessageHeapState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMessageHeapState.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;CAW/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePushNotifications.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePushNotifications.ts"],"names":[],"mappings":"AAcA,wBAAgB,oBAAoB;;;EA2FnC"}
1
+ {"version":3,"file":"usePushNotifications.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePushNotifications.ts"],"names":[],"mappings":"AAcA,wBAAgB,oBAAoB;;;EAwGnC"}
@@ -5,6 +5,7 @@ export declare const useRoomState: (roomJID?: string) => {
5
5
  [jid: string]: import("../main").IRoom;
6
6
  };
7
7
  activeRoomJID: string | null;
8
+ visibleRoomJID: string | null;
8
9
  editAction: import("../types/types").EditAction | undefined;
9
10
  globalLoading: boolean;
10
11
  loadingText: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useRoomState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRoomState.tsx"],"names":[],"mappings":"AAAA,cAAc;AAMd,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM;;;;;;;;;;;;CAwC5C,CAAC"}
1
+ {"version":3,"file":"useRoomState.d.ts","sourceRoot":"","sources":["../../../src/hooks/useRoomState.tsx"],"names":[],"mappings":"AAAA,cAAc;AAMd,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM;;;;;;;;;;;;;CA4C5C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import type { IConfig } from '../types/types';
2
2
  export declare const useSendMessage: (_configOverride?: IConfig) => {
3
3
  sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
4
- sendMedia: (data: any, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
4
+ sendMedia: (data: any, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string, existingId?: string) => Promise<void>;
5
5
  sendEditMessage: (message: string, _activeRoomJID?: string) => Promise<void>;
6
+ retryMessage: (failedId: string) => Promise<void>;
6
7
  isLastMessageFromUserAndProcessing: (roomJID: string) => boolean;
7
8
  };
8
9
  //# sourceMappingURL=useSendMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSendMessage.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,gBAAgB,CAAC;AAYxD,eAAO,MAAM,cAAc,GAAI,kBAAkB,OAAO;2BAuBzC,MAAM,iBACA,MAAM,YACX,OAAO,cACL,OAAO,gBACL,MAAM;sBA2Gd,GAAG,QACH,MAAM,iBACG,MAAM,YACZ,OAAO,cACL,OAAO,gBACL,MAAM;+BAmJL,MAAM,mBAAmB,MAAM;kDAiCrC,MAAM,KAAG,OAAO;CAmB7B,CAAC"}
1
+ {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSendMessage.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,gBAAgB,CAAC;AA0BxD,eAAO,MAAM,cAAc,GAAI,kBAAkB,OAAO;2BAgCzC,MAAM,iBACA,MAAM,YACX,OAAO,cACL,OAAO,gBACL,MAAM;sBA4Ld,GAAG,QACH,MAAM,iBACG,MAAM,YACZ,OAAO,cACL,OAAO,gBACL,MAAM,eACN,MAAM;+BA8VL,MAAM,mBAAmB,MAAM;6BApC9B,MAAM;kDAqEb,MAAM,KAAG,OAAO;CAoB7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUnreadMessagesCounter.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUnreadMessagesCounter.ts"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,wBAAwB,QAAO,mBAsC3C,CAAC;AAEF,OAAO,EAAE,wBAAwB,IAAI,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"useUnreadMessagesCounter.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUnreadMessagesCounter.ts"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,wBAAwB,QAAO,mBAmC3C,CAAC;AAEF,OAAO,EAAE,wBAAwB,IAAI,SAAS,EAAE,CAAC"}
@@ -23,6 +23,7 @@ import 'react-native-get-random-values';
23
23
  export { ReduxWrapper as Chat } from './components/MainComponents/ReduxWrapper';
24
24
  export { XmppProvider } from './context/xmppProvider';
25
25
  export { useUnread } from './hooks/useUnreadMessagesCounter';
26
+ export { useChatRoomFocus } from './hooks/useChatRoomFocus';
26
27
  export { logoutService } from './hooks/useLogout';
27
28
  export { useQRCodeChat, handleQRChatId } from './hooks/useQRCodeChatHandler';
28
29
  export { resendMessage } from './utils/resendMessage';
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,gCAAgC,CAAC;AAGxC,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,YAAY,EACV,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,UAAU,EACV,YAAY,GACb,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,gCAAgC,CAAC;AAGxC,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,YAAY,EACV,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,UAAU,EACV,YAAY,GACb,MAAM,eAAe,CAAC"}
@@ -9,4 +9,7 @@ export declare function registerSocial(idToken: string, accessToken: string, aut
9
9
  export declare function checkEmailExist(email: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
10
10
  export declare function loginViaJwt(clientToken: string): Promise<User>;
11
11
  export declare function uploadFile(formData: FormData): Promise<import("axios").AxiosResponse<any, any, {}>>;
12
+ export declare function uploadFileViaFetch(formData: FormData): Promise<{
13
+ data: any;
14
+ }>;
12
15
  //# sourceMappingURL=auth.api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.api.d.ts","sourceRoot":"","sources":["../../../../src/networking/api-requests/auth.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAczC,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;UAEtD,IAAI;kBACI,MAAM;WACb,MAAM;aAahB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,MAAoB,wDAYhC;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,wDAapB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,wDAM5C;AAED,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BpE;AAuBD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,wDAS5C"}
1
+ {"version":3,"file":"auth.api.d.ts","sourceRoot":"","sources":["../../../../src/networking/api-requests/auth.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAezC,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;UAEtD,IAAI;kBACI,MAAM;WACb,MAAM;aAahB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,MAAoB,wDAYhC;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,wDAapB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,wDAM5C;AAED,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BpE;AAuBD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,wDAa5C;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAmDnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../src/networking/apiClient.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,IAAI,+BAER,CAAC;AAMH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,QAQ7D;AAED,wBAAgB,kBAAkB,WAEjC;AAED,wBAAgB,iBAAiB,WAEhC;AAED,wBAAgB,OAAO,IAAI,OAAO,CAAC;IACjC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C,CAAC,CAmCD;AA8GD,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../src/networking/apiClient.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,IAAI,+BAER,CAAC;AAMH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,QAQ7D;AAED,wBAAgB,kBAAkB,WAEjC;AAED,wBAAgB,iBAAiB,WAEhC;AAED,wBAAgB,OAAO,IAAI,OAAO,CAAC;IACjC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C,CAAC,CAmCD;AA+GD,eAAe,IAAI,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Outbound-send queue — buffers message stanzas that can't reach the wire
3
+ * because there is no live XMPP stream at send time, and replays them once
4
+ * a stream comes (back) online.
5
+ *
6
+ * Lives at MODULE scope on purpose, NOT on the XmppClient instance: the
7
+ * exact windows we need to cover are the ones where the instance itself is
8
+ * gone or being swapped —
9
+ * 1. start race — a send fires before the provider's bootstrap has run
10
+ * `setClient(created)`, so `useSendMessage` sees `client === null` and
11
+ * used to throw "No XMPP client".
12
+ * 2. full-reinit race — after 3 failed reconnects the provider does
13
+ * `setClient(null)` then re-`initializeClient`s; sends in that gap
14
+ * also saw `client === null`.
15
+ * 3. reconnect window — the instance survives but its underlying stream
16
+ * is `connecting`/`offline`; a fire-and-forget stanza is silently lost
17
+ * and only the 30s watchdog notices.
18
+ *
19
+ * Each queued item carries a `send(client)` closure that captures the
20
+ * original args (text or media), so flush is type-agnostic.
21
+ *
22
+ * TTL is deliberately aligned with the 30s pending-send watchdog in
23
+ * useSendMessage (PENDING_WATCHDOG_MS): a queued item older than that has
24
+ * already been — or is about to be — flipped to "Failed → tap to retry" by
25
+ * the watchdog, so replaying it on a late reconnect would duplicate the
26
+ * bubble. We drop those on flush and let the watchdog own the failure.
27
+ */
28
+ export interface OutboundQueueClient {
29
+ sendMessage: (...args: any[]) => any;
30
+ sendMediaMessageStanza: (...args: any[]) => any;
31
+ }
32
+ export interface QueuedSend {
33
+ /** Optimistic/stanza id — used to dedupe re-enqueues (e.g. media retry). */
34
+ optimisticId: string;
35
+ roomJID: string;
36
+ /** Wall-clock ms when first queued; drives the TTL drop on flush. */
37
+ enqueuedAt: number;
38
+ /** Replays the original send against a live, online client. */
39
+ send: (client: OutboundQueueClient) => void;
40
+ }
41
+ export declare const OUTBOUND_QUEUE_TTL_MS = 30000;
42
+ /**
43
+ * Append (or, if the id is already queued, replace in place) a pending
44
+ * send. Order is preserved for FIFO flush.
45
+ */
46
+ export declare function enqueueOutboundSend(item: QueuedSend): void;
47
+ /**
48
+ * Replay every queued send (in order) against a now-online client. Items
49
+ * older than the TTL are dropped — the send watchdog has already failed
50
+ * them, so re-sending would duplicate. The queue is emptied either way.
51
+ */
52
+ export declare function flushOutboundSends(client: OutboundQueueClient, now: number): void;
53
+ /** Drop everything — called on permanent teardown (logout / close). */
54
+ export declare function clearOutboundSends(): void;
55
+ /** Current depth — for tests and diagnostics. */
56
+ export declare function outboundQueueLength(): number;
57
+ //# sourceMappingURL=outboundQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outboundQueue.d.ts","sourceRoot":"","sources":["../../../src/networking/outboundQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IACrC,sBAAsB,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CACjD;AAED,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,IAAI,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC7C;AAGD,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAI5C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAS1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,MAAM,GACV,IAAI,CAgBN;AAED,uEAAuE;AACvE,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"createTimeoutPromise.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/createTimeoutPromise.xmpp.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,WAAW,CAAC,EAAE,MAAM,IAAI,oBAYzB"}
1
+ {"version":3,"file":"createTimeoutPromise.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/createTimeoutPromise.xmpp.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,WAAW,CAAC,EAAE,MAAM,IAAI,oBAgBzB"}
@@ -4,7 +4,7 @@ interface RoomLike {
4
4
  unreadMessages?: number;
5
5
  }
6
6
  interface FlushOpts {
7
- activeRoomJID?: string | null;
7
+ visibleRoomJID?: string | null;
8
8
  onlyIfNoUnread?: boolean;
9
9
  }
10
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flushLastViewedToPrivateStore.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/flushLastViewedToPrivateStore.ts"],"names":[],"mappings":"AAGA,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,SAAS;IAKjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI9B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,EAClD,IAAI,GAAE,SAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAkDlB"}
1
+ {"version":3,"file":"flushLastViewedToPrivateStore.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/flushLastViewedToPrivateStore.ts"],"names":[],"mappings":"AAGA,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,SAAS;IAIjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI/B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,EAClD,IAAI,GAAE,SAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAiDlB"}
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@xmpp/client';
2
- export declare const getRoomsPaged: (client: Client, maxResults?: number, before?: null) => Promise<unknown>;
2
+ export declare const getRoomsPaged: (client: Client, maxResults?: number, before?: null) => Promise<any>;
3
3
  //# sourceMappingURL=getRoomsPaged.xmpp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRoomsPaged.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/getRoomsPaged.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,mBAAc,EACd,aAAa,qBAmDd,CAAC"}
1
+ {"version":3,"file":"getRoomsPaged.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/getRoomsPaged.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,mBAAc,EACd,aAAa,iBA2Ed,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"presenceInRoom.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/presenceInRoom.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,cAAY,KACX,OAAO,CAAC,OAAO,CAiDjB,CAAC"}
1
+ {"version":3,"file":"presenceInRoom.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/presenceInRoom.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,cAAY,KACX,OAAO,CAAC,OAAO,CAgEjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sendTextMessage.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/sendTextMessage.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AA2B3C,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,OAAO,MAAM,EACb,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,oBAAoB,MAAM,EAC1B,UAAU,OAAO,EACjB,gBAAgB,OAAO,EACvB,cAAc,MAAM,EACpB,YAAY,MAAM,EAClB,WAAW,MAAM,SA0DlB,CAAC"}
1
+ {"version":3,"file":"sendTextMessage.xmpp.d.ts","sourceRoot":"","sources":["../../../../src/networking/xmpp/sendTextMessage.xmpp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,cAAc,CAAC;AA2B3C,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,SAAS,MAAM,EACf,WAAW,MAAM,EACjB,UAAU,MAAM,EAChB,OAAO,MAAM,EACb,eAAe,MAAM,EACrB,aAAa,MAAM,EACnB,oBAAoB,MAAM,EAC1B,UAAU,OAAO,EACjB,gBAAgB,OAAO,EACvB,cAAc,MAAM,EACpB,YAAY,MAAM,EAClB,WAAW,MAAM,SA2DlB,CAAC"}
@@ -6,6 +6,10 @@ interface HistoryOptions {
6
6
  skipIfPreloaded?: boolean;
7
7
  source?: HistorySource;
8
8
  }
9
+ export type XmppCredentialsProvider = () => Promise<{
10
+ username: string;
11
+ password: string;
12
+ }>;
9
13
  export declare class XmppClient {
10
14
  client: Client;
11
15
  xmppSettings?: xmppSettingsInterface;
@@ -19,7 +23,15 @@ export declare class XmppClient {
19
23
  reconnectAttempts: number;
20
24
  maxReconnectAttempts: number;
21
25
  reconnectDelay: number;
26
+ maxReconnectDelay: number;
27
+ private lastReconnectAt;
22
28
  suppressReconnect: boolean;
29
+ private reconnectTimer;
30
+ private reconnecting;
31
+ lastAuthError: 'not-authorized' | null;
32
+ private credentialsProvider;
33
+ private credentialsRefreshInFlight;
34
+ private onOnlineCallback;
23
35
  presencesReady: boolean;
24
36
  disableLastRead: boolean;
25
37
  private activeRoomJID;
@@ -31,6 +43,19 @@ export declare class XmppClient {
31
43
  private activeRoomBoostTtlMs;
32
44
  private alwaysPrioritizeActiveRoom;
33
45
  checkOnline(): any;
46
+ /**
47
+ * Inject (or replace) the callback used by reconnect() to fetch fresh
48
+ * XMPP credentials after a `not-authorized` SASL failure. The provider
49
+ * is responsible for refreshing whatever upstream token is needed
50
+ * (REST JWT, /users/client, etc.) and returning the resulting
51
+ * username + password.
52
+ */
53
+ setCredentialsProvider(provider: XmppCredentialsProvider | null): void;
54
+ /** Install a callback invoked on every successful 'online'. The provider
55
+ * uses it to re-join MUC rooms after a reconnect. */
56
+ setOnOnline(cb: (() => void) | null): void;
57
+ /** Swap in fresh credentials before the next reconnect. */
58
+ updateCredentials(username: string, password: string): void;
34
59
  constructor(username: string, password: string, xmppSettings?: xmppSettingsInterface | string);
35
60
  setActiveRoomJid(roomJID: string | null): void;
36
61
  promoteRoomHistory(_roomJID: string): void;
@@ -61,7 +86,12 @@ export declare class XmppClient {
61
86
  }): Promise<any>;
62
87
  private sourceRank;
63
88
  initializeClient(): void;
89
+ private onDisconnect?;
90
+ private onOnline?;
91
+ private onError?;
92
+ private onStanza?;
64
93
  attachEventListeners(): void;
94
+ detachEventListeners(): void;
65
95
  /**
66
96
  * Resolves once status === 'online' or rejects when status === 'error'.
67
97
  * Mirrors the web client's `ensureConnected` helper.
@@ -69,7 +99,21 @@ export declare class XmppClient {
69
99
  waitForOnline(timeoutMs?: number): Promise<void>;
70
100
  ensureConnected(timeout?: number): Promise<void>;
71
101
  scheduleReconnect(): void;
72
- reconnect(): void;
102
+ /**
103
+ * Force an immediate reconnect, resetting the backoff counter. Called
104
+ * by the provider when NetInfo reports the network came back or the app
105
+ * returned to the foreground — we don't want to wait out the existing
106
+ * exponential delay (or a maxed-out attempt count) in those cases.
107
+ */
108
+ forceReconnect(): void;
109
+ reconnect(): Promise<void>;
110
+ /**
111
+ * Single-flight wrapper around credentialsProvider. Multiple concurrent
112
+ * reconnect() calls (e.g. from the provider's reconnect effect firing
113
+ * twice quickly) share one in-flight request and update `this.password`
114
+ * exactly once.
115
+ */
116
+ private refreshCredentialsOnce;
73
117
  disconnect(options?: {
74
118
  suppressReconnect?: boolean;
75
119
  }): Promise<void>;
@@ -84,21 +128,30 @@ export declare class XmppClient {
84
128
  setRoomImageStanza: (roomJid: string, roomThumbnail: string, type: string, roomBackground?: string) => void;
85
129
  getRoomInfoStanza: (roomJID: string) => void;
86
130
  getRoomMembersStanza: (roomJID: string) => void;
87
- sendMessage: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, customId?: string) => void;
131
+ /**
132
+ * True when the underlying stream is live enough to actually put a
133
+ * stanza on the wire. Used to gate sends: when false we buffer instead
134
+ * of firing a fire-and-forget stanza into a dead/half-open socket
135
+ * (which is silently dropped and only caught by the 30s watchdog).
136
+ */
137
+ private isStreamReady;
138
+ /** Replay buffered sends against this (now-online) client, in order. */
139
+ flushPendingSends(): void;
140
+ sendMessage: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, customId?: string) => boolean;
88
141
  deleteMessageStanza(room: string, msgId: string): void;
89
142
  editMessageStanza(room: string, msgId: string, text: string): void;
90
143
  sendTypingRequestStanza(chatId: string, fullName: string, start: boolean): void;
91
144
  getChatsPrivateStoreRequestStanza: () => Promise<unknown>;
92
145
  actionSetTimestampToPrivateStoreStanza(chatId: string, timestamp: number, chats?: string[]): Promise<void>;
93
146
  flushLastViewedToPrivateStoreStanza(rooms: Record<string, any> | null | undefined, opts?: {
94
- activeRoomJID?: string | null;
147
+ visibleRoomJID?: string | null;
95
148
  onlyIfNoUnread?: boolean;
96
149
  }): Promise<boolean>;
97
- sendMediaMessageStanza(roomJID: string, data: any, customId?: string): string;
150
+ sendMediaMessageStanza(roomJID: string, data: any, customId?: string): string | undefined;
98
151
  setVCardStanza(_xmppUsername: string): void;
99
152
  createPrivateRoomStanza(title: string, description: string, to: string): Promise<string>;
100
153
  sendMessageReactionStanza(_messageId: string, _roomJid: string, _reactionsList: string[], _reactionSymbol?: string): void;
101
- sendTextMessageWithTranslateTagStanza(roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, _langSource?: string): void;
154
+ sendTextMessageWithTranslateTagStanza(roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, _langSource?: string, customId?: string): void;
102
155
  }
103
156
  export default XmppClient;
104
157
  //# sourceMappingURL=xmppClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"xmppClient.d.ts","sourceRoot":"","sources":["../../../src/networking/xmppClient.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AA0BvD,KAAK,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;AAEtE,UAAU,cAAc;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAQD,qBAAa,UAAU;IACrB,MAAM,EAAG,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAM;IAClB,OAAO,EAAE,MAAM,CAAM;IACrB,UAAU,EAAE,MAAM,CAAM;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,YAA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C,EAAE,OAAO,EACvB,WAAW,CAAC,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM;CAsBpB;AAED,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unreadMidlleware.d.ts","sourceRoot":"","sources":["../../../../src/roomStore/Middleware/unreadMidlleware.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuE9C,eAAO,MAAM,gBAAgB,EAAE,UAgF5B,CAAC"}
1
+ {"version":3,"file":"unreadMidlleware.d.ts","sourceRoot":"","sources":["../../../../src/roomStore/Middleware/unreadMidlleware.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA8E9C,eAAO,MAAM,gBAAgB,EAAE,UA2F5B,CAAC"}
@@ -1,16 +1,37 @@
1
1
  import { PayloadAction, type Slice } from '@reduxjs/toolkit';
2
2
  import type { WritableDraft } from 'immer';
3
3
  import { IMessage } from '../types/types';
4
+ export type FailedMessagePayload = {
5
+ kind: 'text';
6
+ id: string;
7
+ roomJID: string;
8
+ body: string;
9
+ isReply?: boolean;
10
+ isChecked?: boolean;
11
+ mainMessage?: string;
12
+ } | {
13
+ kind: 'media';
14
+ id: string;
15
+ roomJID: string;
16
+ data: any;
17
+ type: string;
18
+ isReply?: boolean;
19
+ isChecked?: boolean;
20
+ mainMessage?: string;
21
+ };
4
22
  export interface roomHeapSliceState {
5
23
  messageHeap: IMessage[];
24
+ failedMessages: Record<string, FailedMessagePayload>;
6
25
  }
7
26
  declare const reducers: {
8
27
  addMessageToHeap: (state: WritableDraft<roomHeapSliceState>, action: PayloadAction<IMessage>) => void;
9
28
  removeMessageFromHeapById: (state: WritableDraft<roomHeapSliceState>, action: PayloadAction<string>) => void;
10
29
  clearHeap: (state: WritableDraft<roomHeapSliceState>) => void;
30
+ markMessageFailed: (state: WritableDraft<roomHeapSliceState>, action: PayloadAction<FailedMessagePayload>) => void;
31
+ clearMessageFailure: (state: WritableDraft<roomHeapSliceState>, action: PayloadAction<string>) => void;
11
32
  };
12
33
  export declare const roomHeapSlice: Slice<roomHeapSliceState, typeof reducers, 'roomHeapStore'>;
13
- export declare const addMessageToHeap: import("@reduxjs/toolkit").ActionCreatorWithPayload<IMessage, "roomHeapStore/addMessageToHeap">, clearHeap: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"roomHeapStore/clearHeap">, removeMessageFromHeapById: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "roomHeapStore/removeMessageFromHeapById">;
34
+ export declare const addMessageToHeap: import("@reduxjs/toolkit").ActionCreatorWithPayload<IMessage, "roomHeapStore/addMessageToHeap">, clearHeap: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"roomHeapStore/clearHeap">, removeMessageFromHeapById: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "roomHeapStore/removeMessageFromHeapById">, markMessageFailed: import("@reduxjs/toolkit").ActionCreatorWithPayload<FailedMessagePayload, "roomHeapStore/markMessageFailed">, clearMessageFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "roomHeapStore/clearMessageFailure">;
14
35
  declare const _default: import("redux").Reducer<roomHeapSliceState>;
15
36
  export default _default;
16
37
  //# sourceMappingURL=roomHeapSlice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"roomHeapSlice.d.ts","sourceRoot":"","sources":["../../../src/roomStore/roomHeapSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,QAAQ,EAAE,CAAC;CACzB;AAUD,QAAA,MAAM,QAAQ;8BACc,aAAa,CAAC,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C,MAAM,EAAE,oBAAoB,CAAC,CAAC;CACtD;AAOD,QAAA,MAAM,QAAQ;8BACc,aAAa,CAAC,kBAAkB,CAAC,UAAU,aAAa,CAAC,QAAQ,CAAC;uCAGzD,aAAa,CAAC,kBAAkB,CAAC,UAAU,aAAa,CAAC,MAAM,CAAC;uBAMhF,aAAa,CAAC,kBAAkB,CAAC;+BAK3C,aAAa,CAAC,kBAAkB,CAAC,UAChC,aAAa,CAAC,oBAAoB,CAAC;iCAUhB,aAAa,CAAC,kBAAkB,CAAC,UAAU,aAAa,CAAC,MAAM,CAAC;CAG9F,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,QAAQ,EAAE,eAAe,CAIpF,CAAC;AAEH,eAAO,MACL,gBAAgB,mGAChB,SAAS,qFACT,yBAAyB,0GACzB,iBAAiB,gHACjB,mBAAmB,kGACI,CAAC;;AAE1B,wBAAqC"}
@@ -14,6 +14,7 @@ export interface RoomMessagesState {
14
14
  [jid: string]: IRoom;
15
15
  };
16
16
  activeRoomJID: string | null;
17
+ visibleRoomJID: string | null;
17
18
  editAction?: EditAction;
18
19
  isLoading: boolean;
19
20
  loadingText?: string;
@@ -80,6 +81,10 @@ declare const reducers: {
80
81
  setCurrentRoom: (state: WritableDraft<RoomMessagesState>, action: PayloadAction<{
81
82
  roomJID: string | null;
82
83
  }>) => void;
84
+ setVisibleRoom: (state: WritableDraft<RoomMessagesState>, action: PayloadAction<{
85
+ roomJID: string | null;
86
+ }>) => void;
87
+ clearVisibleRoom: (state: WritableDraft<RoomMessagesState>) => void;
83
88
  /**
84
89
  * Stash a JID that a push notification asked us to open before
85
90
  * the rooms list has loaded. The Chat component clears this once
@@ -154,7 +159,9 @@ export declare const addRoom: import("@reduxjs/toolkit").ActionCreatorWithPayloa
154
159
  chatJID?: string;
155
160
  }, "roomMessages/setRoomNoMessages">, setCurrentRoom: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
156
161
  roomJID: string | null;
157
- }, "roomMessages/setCurrentRoom">, setRoomRole: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
162
+ }, "roomMessages/setCurrentRoom">, setVisibleRoom: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
163
+ roomJID: string | null;
164
+ }, "roomMessages/setVisibleRoom">, clearVisibleRoom: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"roomMessages/clearVisibleRoom">, setRoomRole: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
158
165
  chatJID: string;
159
166
  role: string;
160
167
  }, "roomMessages/setRoomRole">, setLogoutState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"roomMessages/setLogoutState">, setActiveMessage: import("@reduxjs/toolkit").ActionCreatorWithPayload<{