@ethora/chat-component-rn 26.7.9 → 26.8.1

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 (652) hide show
  1. package/CHANGELOG.md +0 -93
  2. package/README.md +10 -33
  3. package/lib/commonjs/assets/icons.js +2 -7
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/AuthForms/Login.js +4 -4
  6. package/lib/commonjs/components/AuthForms/Login.js.map +1 -1
  7. package/lib/commonjs/components/Header/HeaderRoomList.js +7 -26
  8. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/ChatHeader.js +3 -9
  10. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/ChatRoom.js +13 -101
  12. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/ChatWrapper.js +38 -34
  14. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  15. package/lib/commonjs/components/MainComponents/LoginWrapper.js +1 -2
  16. package/lib/commonjs/components/MainComponents/LoginWrapper.js.map +1 -1
  17. package/lib/commonjs/components/MainComponents/MediaMessage.js +9 -29
  18. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  19. package/lib/commonjs/components/MainComponents/MessageContainer.js +1 -5
  20. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  21. package/lib/commonjs/components/MainComponents/MessageList.js +5 -13
  22. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  23. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  24. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  25. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +24 -3
  26. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  27. package/lib/commonjs/components/MainComponents/RoomList.js +35 -208
  28. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  29. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +98 -317
  30. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  31. package/lib/commonjs/components/MessageBubble/MessageTranslate.js +16 -7
  32. package/lib/commonjs/components/MessageBubble/MessageTranslate.js.map +1 -1
  33. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +112 -320
  34. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  35. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +215 -556
  36. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  37. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  38. package/lib/commonjs/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +27 -69
  40. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  41. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js +1 -2
  42. package/lib/commonjs/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  43. package/lib/commonjs/components/Modals/Modal/Modal.js +0 -8
  44. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  45. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +1 -2
  46. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  47. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +109 -205
  48. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  49. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  50. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  51. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  52. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  53. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +21 -7
  54. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  55. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +244 -507
  56. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  57. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +46 -74
  58. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  59. package/lib/commonjs/components/Modals/styledModalComponents.js +2 -9
  60. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  61. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +39 -23
  62. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  63. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js +3 -22
  64. package/lib/commonjs/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  65. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  66. package/lib/commonjs/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  67. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  68. package/lib/commonjs/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  69. package/lib/commonjs/components/VideoCalls/VideoCallSession.js +3 -6
  70. package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
  71. package/lib/commonjs/components/styled/AudioMessage.js +1 -2
  72. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  73. package/lib/commonjs/components/styled/DateLabel.js +10 -3
  74. package/lib/commonjs/components/styled/DateLabel.js.map +1 -1
  75. package/lib/commonjs/components/styled/MessageImage.js +9 -37
  76. package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
  77. package/lib/commonjs/components/styled/NewMessageLabel.js +3 -1
  78. package/lib/commonjs/components/styled/NewMessageLabel.js.map +1 -1
  79. package/lib/commonjs/components/styled/SendInput.js +17 -86
  80. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  81. package/lib/commonjs/components/styled/StyledComponents.js +3 -9
  82. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  83. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  84. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  85. package/lib/commonjs/components/styled/UnsupportedType.js +4 -14
  86. package/lib/commonjs/components/styled/UnsupportedType.js.map +1 -1
  87. package/lib/commonjs/components/styled/VideoMessage.js +61 -119
  88. package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
  89. package/lib/commonjs/context/xmppProvider.js +54 -128
  90. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  91. package/lib/commonjs/helpers/createMessageFromXml.js +1 -19
  92. package/lib/commonjs/helpers/createMessageFromXml.js.map +1 -1
  93. package/lib/commonjs/helpers/ensureScopedChatCache.js +2 -2
  94. package/lib/commonjs/helpers/ensureScopedChatCache.js.map +1 -1
  95. package/lib/commonjs/helpers/getDataFromXml.js +24 -1
  96. package/lib/commonjs/helpers/getDataFromXml.js.map +1 -1
  97. package/lib/commonjs/helpers/historyPreloadScheduler.js +2 -65
  98. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  99. package/lib/commonjs/helpers/initXmppRooms.js +8 -14
  100. package/lib/commonjs/helpers/initXmppRooms.js.map +1 -1
  101. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +13 -0
  102. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  103. package/lib/commonjs/helpers/isUnresolvedSenderId.js +6 -1
  104. package/lib/commonjs/helpers/isUnresolvedSenderId.js.map +1 -1
  105. package/lib/commonjs/helpers/mimeToExtension.js +14 -6
  106. package/lib/commonjs/helpers/mimeToExtension.js.map +1 -1
  107. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js +17 -130
  108. package/lib/commonjs/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  109. package/lib/commonjs/helpers/resolveLangSource.js +38 -0
  110. package/lib/commonjs/helpers/resolveLangSource.js.map +1 -0
  111. package/lib/commonjs/helpers/xmppUsername.js +39 -0
  112. package/lib/commonjs/helpers/xmppUsername.js.map +1 -0
  113. package/lib/commonjs/hooks/useChatRoomFocus.js +8 -17
  114. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
  115. package/lib/commonjs/hooks/useChatWrapperInit.js +14 -32
  116. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  117. package/lib/commonjs/hooks/useComposing.js +0 -27
  118. package/lib/commonjs/hooks/useComposing.js.map +1 -1
  119. package/lib/commonjs/hooks/useLogout.js +7 -15
  120. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  121. package/lib/commonjs/hooks/usePendingNotification.js +11 -8
  122. package/lib/commonjs/hooks/usePendingNotification.js.map +1 -1
  123. package/lib/commonjs/hooks/useSendMessage.js +14 -50
  124. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  125. package/lib/commonjs/hooks/useUnreadMessagesCounter.js +1 -6
  126. package/lib/commonjs/hooks/useUnreadMessagesCounter.js.map +1 -1
  127. package/lib/commonjs/i18n/strings.js +133 -121
  128. package/lib/commonjs/i18n/strings.js.map +1 -1
  129. package/lib/commonjs/i18n/useT.js +1 -1
  130. package/lib/commonjs/main.js +0 -44
  131. package/lib/commonjs/main.js.map +1 -1
  132. package/lib/commonjs/networking/api-requests/auth.api.js +60 -134
  133. package/lib/commonjs/networking/api-requests/auth.api.js.map +1 -1
  134. package/lib/commonjs/networking/api-requests/roomMembers.api.js +1 -1
  135. package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
  136. package/lib/commonjs/networking/api-requests/rooms.api.js +9 -9
  137. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  138. package/lib/commonjs/networking/api-requests/user.api.js +9 -68
  139. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  140. package/lib/commonjs/networking/apiClient.js +112 -62
  141. package/lib/commonjs/networking/apiClient.js.map +1 -1
  142. package/lib/commonjs/networking/stanzaHandlers.js +51 -93
  143. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  144. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  145. package/lib/commonjs/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  146. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  147. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  148. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  149. package/lib/commonjs/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  150. package/lib/commonjs/networking/xmppClient.js +8 -124
  151. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  152. package/lib/commonjs/roomStore/chatSettingsSlice.js +7 -26
  153. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  154. package/lib/commonjs/roomStore/index.js +2 -35
  155. package/lib/commonjs/roomStore/index.js.map +1 -1
  156. package/lib/commonjs/roomStore/persistence.js +39 -226
  157. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  158. package/lib/commonjs/roomStore/roomsSlice.js +8 -87
  159. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  160. package/lib/commonjs/services/pushSubscriptionService.js +13 -15
  161. package/lib/commonjs/services/pushSubscriptionService.js.map +1 -1
  162. package/lib/commonjs/version.js +3 -1
  163. package/lib/commonjs/version.js.map +1 -1
  164. package/lib/module/assets/icons.js +1 -6
  165. package/lib/module/assets/icons.js.map +1 -1
  166. package/lib/module/components/AuthForms/Login.js +4 -4
  167. package/lib/module/components/AuthForms/Login.js.map +1 -1
  168. package/lib/module/components/Header/HeaderRoomList.js +7 -26
  169. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  170. package/lib/module/components/MainComponents/ChatHeader.js +3 -9
  171. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  172. package/lib/module/components/MainComponents/ChatRoom.js +14 -102
  173. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  174. package/lib/module/components/MainComponents/ChatWrapper.js +40 -36
  175. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  176. package/lib/module/components/MainComponents/LoginWrapper.js +1 -2
  177. package/lib/module/components/MainComponents/LoginWrapper.js.map +1 -1
  178. package/lib/module/components/MainComponents/MediaMessage.js +10 -30
  179. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  180. package/lib/module/components/MainComponents/MessageContainer.js +1 -5
  181. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  182. package/lib/module/components/MainComponents/MessageList.js +5 -13
  183. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  184. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +13 -14
  185. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  186. package/lib/module/components/MainComponents/ReduxWrapper.js +26 -5
  187. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  188. package/lib/module/components/MainComponents/RoomList.js +35 -207
  189. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  190. package/lib/module/components/Menu/HeaderRoomListMenu.js +101 -319
  191. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  192. package/lib/module/components/MessageBubble/MessageTranslate.js +16 -7
  193. package/lib/module/components/MessageBubble/MessageTranslate.js.map +1 -1
  194. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +115 -311
  195. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  196. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +219 -559
  197. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  198. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js +9 -7
  199. package/lib/module/components/Modals/ChatProfileModal/DeleteChatModal.js.map +1 -1
  200. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +28 -70
  201. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  202. package/lib/module/components/Modals/FilePreviewModal/PdfView.js +1 -2
  203. package/lib/module/components/Modals/FilePreviewModal/PdfView.js.map +1 -1
  204. package/lib/module/components/Modals/Modal/Modal.js +1 -9
  205. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  206. package/lib/module/components/Modals/NewChatModal/ModalContent.js +1 -2
  207. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  208. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +111 -208
  209. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  210. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +0 -8
  211. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  212. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +2 -4
  213. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  214. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +23 -9
  215. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  216. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +248 -509
  217. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  218. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +48 -76
  219. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  220. package/lib/module/components/Modals/styledModalComponents.js +2 -9
  221. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  222. package/lib/module/components/RoomComponents/ChatRoomItem.js +40 -24
  223. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  224. package/lib/module/components/RoomComponents/styled/LastMessageFile.js +3 -22
  225. package/lib/module/components/RoomComponents/styled/LastMessageFile.js.map +1 -1
  226. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js +3 -17
  227. package/lib/module/components/RoomComponents/styled/LastMessagePhoto.js.map +1 -1
  228. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js +3 -17
  229. package/lib/module/components/RoomComponents/styled/LastMessageVideo.js.map +1 -1
  230. package/lib/module/components/VideoCalls/VideoCallSession.js +3 -6
  231. package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
  232. package/lib/module/components/styled/AudioMessage.js +1 -2
  233. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  234. package/lib/module/components/styled/DateLabel.js +10 -3
  235. package/lib/module/components/styled/DateLabel.js.map +1 -1
  236. package/lib/module/components/styled/MessageImage.js +9 -37
  237. package/lib/module/components/styled/MessageImage.js.map +1 -1
  238. package/lib/module/components/styled/NewMessageLabel.js +3 -1
  239. package/lib/module/components/styled/NewMessageLabel.js.map +1 -1
  240. package/lib/module/components/styled/SendInput.js +18 -87
  241. package/lib/module/components/styled/SendInput.js.map +1 -1
  242. package/lib/module/components/styled/StyledComponents.js +3 -9
  243. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  244. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +4 -11
  245. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  246. package/lib/module/components/styled/UnsupportedType.js +4 -14
  247. package/lib/module/components/styled/UnsupportedType.js.map +1 -1
  248. package/lib/module/components/styled/VideoMessage.js +62 -120
  249. package/lib/module/components/styled/VideoMessage.js.map +1 -1
  250. package/lib/module/context/xmppProvider.js +55 -128
  251. package/lib/module/context/xmppProvider.js.map +1 -1
  252. package/lib/module/helpers/createMessageFromXml.js +1 -19
  253. package/lib/module/helpers/createMessageFromXml.js.map +1 -1
  254. package/lib/module/helpers/ensureScopedChatCache.js +2 -2
  255. package/lib/module/helpers/ensureScopedChatCache.js.map +1 -1
  256. package/lib/module/helpers/getDataFromXml.js +23 -1
  257. package/lib/module/helpers/getDataFromXml.js.map +1 -1
  258. package/lib/module/helpers/historyPreloadScheduler.js +3 -66
  259. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  260. package/lib/module/helpers/initXmppRooms.js +8 -14
  261. package/lib/module/helpers/initXmppRooms.js.map +1 -1
  262. package/lib/module/helpers/insertMessageWithDelimiter.js +13 -0
  263. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  264. package/lib/module/helpers/isUnresolvedSenderId.js +6 -1
  265. package/lib/module/helpers/isUnresolvedSenderId.js.map +1 -1
  266. package/lib/module/helpers/mimeToExtension.js +13 -6
  267. package/lib/module/helpers/mimeToExtension.js.map +1 -1
  268. package/lib/module/helpers/resolveInitBeforeLoadUser.js +16 -130
  269. package/lib/module/helpers/resolveInitBeforeLoadUser.js.map +1 -1
  270. package/lib/module/helpers/resolveLangSource.js +32 -0
  271. package/lib/module/helpers/resolveLangSource.js.map +1 -0
  272. package/lib/module/helpers/xmppUsername.js +35 -0
  273. package/lib/module/helpers/xmppUsername.js.map +1 -0
  274. package/lib/module/hooks/useChatRoomFocus.js +8 -17
  275. package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
  276. package/lib/module/hooks/useChatWrapperInit.js +14 -32
  277. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  278. package/lib/module/hooks/useComposing.js +1 -28
  279. package/lib/module/hooks/useComposing.js.map +1 -1
  280. package/lib/module/hooks/useLogout.js +7 -15
  281. package/lib/module/hooks/useLogout.js.map +1 -1
  282. package/lib/module/hooks/usePendingNotification.js +11 -8
  283. package/lib/module/hooks/usePendingNotification.js.map +1 -1
  284. package/lib/module/hooks/useSendMessage.js +16 -52
  285. package/lib/module/hooks/useSendMessage.js.map +1 -1
  286. package/lib/module/hooks/useUnreadMessagesCounter.js +1 -6
  287. package/lib/module/hooks/useUnreadMessagesCounter.js.map +1 -1
  288. package/lib/module/i18n/strings.js +133 -121
  289. package/lib/module/i18n/strings.js.map +1 -1
  290. package/lib/module/i18n/useT.js +1 -1
  291. package/lib/module/main.js +2 -14
  292. package/lib/module/main.js.map +1 -1
  293. package/lib/module/networking/api-requests/auth.api.js +59 -131
  294. package/lib/module/networking/api-requests/auth.api.js.map +1 -1
  295. package/lib/module/networking/api-requests/roomMembers.api.js +1 -1
  296. package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
  297. package/lib/module/networking/api-requests/rooms.api.js +9 -9
  298. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  299. package/lib/module/networking/api-requests/user.api.js +7 -64
  300. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  301. package/lib/module/networking/apiClient.js +113 -61
  302. package/lib/module/networking/apiClient.js.map +1 -1
  303. package/lib/module/networking/stanzaHandlers.js +52 -94
  304. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  305. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js +8 -46
  306. package/lib/module/networking/xmpp/flushLastViewedToPrivateStore.js.map +1 -1
  307. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +1 -8
  308. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  309. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js +1 -5
  310. package/lib/module/networking/xmpp/subscribeToRoomMessages.xmpp.js.map +1 -1
  311. package/lib/module/networking/xmppClient.js +8 -124
  312. package/lib/module/networking/xmppClient.js.map +1 -1
  313. package/lib/module/roomStore/chatSettingsSlice.js +7 -26
  314. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  315. package/lib/module/roomStore/index.js +4 -37
  316. package/lib/module/roomStore/index.js.map +1 -1
  317. package/lib/module/roomStore/persistence.js +38 -223
  318. package/lib/module/roomStore/persistence.js.map +1 -1
  319. package/lib/module/roomStore/roomsSlice.js +7 -86
  320. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  321. package/lib/module/services/pushSubscriptionService.js +13 -15
  322. package/lib/module/services/pushSubscriptionService.js.map +1 -1
  323. package/lib/module/version.js +3 -1
  324. package/lib/module/version.js.map +1 -1
  325. package/lib/typescript/assets/icons.d.ts +0 -16
  326. package/lib/typescript/assets/icons.d.ts.map +1 -1
  327. package/lib/typescript/components/AuthForms/Login.d.ts.map +1 -1
  328. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  329. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  330. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  331. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  332. package/lib/typescript/components/MainComponents/LoginWrapper.d.ts.map +1 -1
  333. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  334. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  335. package/lib/typescript/components/MainComponents/MessageList.d.ts +1 -10
  336. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  337. package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
  338. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  339. package/lib/typescript/components/MainComponents/RoomList.d.ts +0 -7
  340. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  341. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +0 -3
  342. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  343. package/lib/typescript/components/MessageBubble/MessageTranslate.d.ts.map +1 -1
  344. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +0 -9
  345. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  346. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +0 -10
  347. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  348. package/lib/typescript/components/Modals/ChatProfileModal/DeleteChatModal.d.ts.map +1 -1
  349. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  350. package/lib/typescript/components/Modals/FilePreviewModal/PdfView.d.ts.map +1 -1
  351. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  352. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +2 -4
  353. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  354. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  355. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  356. package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
  357. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +1 -6
  358. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  359. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  360. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +0 -16
  361. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  362. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +0 -1
  363. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  364. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  365. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  366. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts +1 -1
  367. package/lib/typescript/components/RoomComponents/styled/LastMessageFile.d.ts.map +1 -1
  368. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts +1 -1
  369. package/lib/typescript/components/RoomComponents/styled/LastMessagePhoto.d.ts.map +1 -1
  370. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts +1 -1
  371. package/lib/typescript/components/RoomComponents/styled/LastMessageVideo.d.ts.map +1 -1
  372. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
  373. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  374. package/lib/typescript/components/styled/DateLabel.d.ts.map +1 -1
  375. package/lib/typescript/components/styled/MessageImage.d.ts +0 -14
  376. package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
  377. package/lib/typescript/components/styled/NewMessageLabel.d.ts.map +1 -1
  378. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  379. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  380. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  381. package/lib/typescript/components/styled/UnsupportedType.d.ts.map +1 -1
  382. package/lib/typescript/components/styled/VideoMessage.d.ts +0 -8
  383. package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
  384. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  385. package/lib/typescript/helpers/createMessageFromXml.d.ts.map +1 -1
  386. package/lib/typescript/helpers/getDataFromXml.d.ts.map +1 -1
  387. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  388. package/lib/typescript/helpers/initXmppRooms.d.ts.map +1 -1
  389. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  390. package/lib/typescript/helpers/isUnresolvedSenderId.d.ts.map +1 -1
  391. package/lib/typescript/helpers/mimeToExtension.d.ts +15 -0
  392. package/lib/typescript/helpers/mimeToExtension.d.ts.map +1 -1
  393. package/lib/typescript/helpers/resolveInitBeforeLoadUser.d.ts.map +1 -1
  394. package/lib/typescript/helpers/resolveLangSource.d.ts +30 -0
  395. package/lib/typescript/helpers/resolveLangSource.d.ts.map +1 -0
  396. package/lib/typescript/helpers/xmppUsername.d.ts +13 -0
  397. package/lib/typescript/helpers/xmppUsername.d.ts.map +1 -0
  398. package/lib/typescript/hooks/useChatRoomFocus.d.ts +1 -4
  399. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
  400. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  401. package/lib/typescript/hooks/useComposing.d.ts.map +1 -1
  402. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  403. package/lib/typescript/hooks/usePendingNotification.d.ts.map +1 -1
  404. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  405. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts +0 -1
  406. package/lib/typescript/hooks/useUnreadMessagesCounter.d.ts.map +1 -1
  407. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  408. package/lib/typescript/i18n/useT.d.ts +1 -1
  409. package/lib/typescript/main.d.ts +2 -9
  410. package/lib/typescript/main.d.ts.map +1 -1
  411. package/lib/typescript/networking/api-requests/auth.api.d.ts +1 -3
  412. package/lib/typescript/networking/api-requests/auth.api.d.ts.map +1 -1
  413. package/lib/typescript/networking/api-requests/user.api.d.ts +0 -27
  414. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  415. package/lib/typescript/networking/apiClient.d.ts +6 -12
  416. package/lib/typescript/networking/apiClient.d.ts.map +1 -1
  417. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  418. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts +2 -10
  419. package/lib/typescript/networking/xmpp/flushLastViewedToPrivateStore.d.ts.map +1 -1
  420. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  421. package/lib/typescript/networking/xmpp/subscribeToRoomMessages.xmpp.d.ts.map +1 -1
  422. package/lib/typescript/networking/xmppClient.d.ts +0 -14
  423. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  424. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +0 -16
  425. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  426. package/lib/typescript/roomStore/index.d.ts.map +1 -1
  427. package/lib/typescript/roomStore/persistence.d.ts +1 -18
  428. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  429. package/lib/typescript/roomStore/roomsSlice.d.ts +1 -14
  430. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  431. package/lib/typescript/services/pushSubscriptionService.d.ts +1 -1
  432. package/lib/typescript/services/pushSubscriptionService.d.ts.map +1 -1
  433. package/lib/typescript/types/types.d.ts +5 -49
  434. package/lib/typescript/types/types.d.ts.map +1 -1
  435. package/lib/typescript/version.d.ts +1 -1
  436. package/lib/typescript/version.d.ts.map +1 -1
  437. package/package.json +29 -41
  438. package/src/assets/icons.tsx +9 -48
  439. package/src/components/AuthForms/Login.tsx +3 -3
  440. package/src/components/Header/HeaderRoomList.tsx +6 -24
  441. package/src/components/MainComponents/ChatHeader.tsx +3 -9
  442. package/src/components/MainComponents/ChatRoom.tsx +16 -111
  443. package/src/components/MainComponents/ChatWrapper.tsx +53 -36
  444. package/src/components/MainComponents/LoginWrapper.tsx +0 -1
  445. package/src/components/MainComponents/MediaMessage.tsx +8 -26
  446. package/src/components/MainComponents/MessageContainer.tsx +1 -5
  447. package/src/components/MainComponents/MessageList.tsx +4 -23
  448. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +14 -21
  449. package/src/components/MainComponents/ReduxWrapper.tsx +18 -1
  450. package/src/components/MainComponents/RoomList.tsx +39 -236
  451. package/src/components/Menu/HeaderRoomListMenu.tsx +75 -328
  452. package/src/components/MessageBubble/MessageTranslate.tsx +17 -12
  453. package/src/components/Modals/AttachSheet/AttachSheet.tsx +99 -331
  454. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +293 -611
  455. package/src/components/Modals/ChatProfileModal/DeleteChatModal.tsx +9 -7
  456. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +38 -79
  457. package/src/components/Modals/FilePreviewModal/PdfView.tsx +1 -2
  458. package/src/components/Modals/Modal/Modal.tsx +0 -7
  459. package/src/components/Modals/NewChatModal/ModalContent.tsx +3 -6
  460. package/src/components/Modals/NewChatModal/NewChatModal.tsx +126 -223
  461. package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +1 -12
  462. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +4 -14
  463. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +25 -9
  464. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +307 -617
  465. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +58 -75
  466. package/src/components/Modals/styledModalComponents.tsx +2 -9
  467. package/src/components/RoomComponents/ChatRoomItem.tsx +50 -21
  468. package/src/components/RoomComponents/styled/LastMessageFile.tsx +4 -28
  469. package/src/components/RoomComponents/styled/LastMessagePhoto.tsx +3 -18
  470. package/src/components/RoomComponents/styled/LastMessageVideo.tsx +3 -18
  471. package/src/components/VideoCalls/VideoCallSession.tsx +3 -8
  472. package/src/components/styled/AudioMessage.tsx +1 -2
  473. package/src/components/styled/DateLabel.tsx +10 -3
  474. package/src/components/styled/MessageImage.tsx +7 -53
  475. package/src/components/styled/NewMessageLabel.tsx +3 -1
  476. package/src/components/styled/SendInput.tsx +18 -91
  477. package/src/components/styled/StyledComponents.ts +3 -9
  478. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +4 -11
  479. package/src/components/styled/UnsupportedType.tsx +4 -14
  480. package/src/components/styled/VideoMessage.tsx +54 -131
  481. package/src/context/xmppProvider.tsx +51 -134
  482. package/src/helpers/createMessageFromXml.ts +1 -20
  483. package/src/helpers/ensureScopedChatCache.ts +2 -2
  484. package/src/helpers/getDataFromXml.ts +25 -1
  485. package/src/helpers/historyPreloadScheduler.ts +3 -80
  486. package/src/helpers/initXmppRooms.tsx +10 -14
  487. package/src/helpers/insertMessageWithDelimiter.ts +13 -0
  488. package/src/helpers/isUnresolvedSenderId.ts +9 -1
  489. package/src/helpers/mimeToExtension.ts +22 -6
  490. package/src/helpers/resolveInitBeforeLoadUser.ts +18 -125
  491. package/src/helpers/resolveLangSource.ts +40 -0
  492. package/src/helpers/xmppUsername.ts +38 -0
  493. package/src/hooks/useChatRoomFocus.ts +5 -14
  494. package/src/hooks/useChatWrapperInit.ts +16 -32
  495. package/src/hooks/useComposing.tsx +1 -37
  496. package/src/hooks/useLogout.tsx +9 -15
  497. package/src/hooks/usePendingNotification.ts +11 -5
  498. package/src/hooks/useSendMessage.tsx +15 -60
  499. package/src/hooks/useUnreadMessagesCounter.ts +0 -11
  500. package/src/i18n/strings.ts +133 -121
  501. package/src/i18n/useT.ts +1 -1
  502. package/src/main.ts +2 -26
  503. package/src/networking/api-requests/auth.api.ts +48 -156
  504. package/src/networking/api-requests/roomMembers.api.ts +1 -1
  505. package/src/networking/api-requests/rooms.api.ts +9 -9
  506. package/src/networking/api-requests/user.api.ts +7 -79
  507. package/src/networking/apiClient.ts +123 -68
  508. package/src/networking/stanzaHandlers.ts +51 -92
  509. package/src/networking/xmpp/flushLastViewedToPrivateStore.ts +10 -71
  510. package/src/networking/xmpp/presenceInRoom.xmpp.ts +1 -6
  511. package/src/networking/xmpp/subscribeToRoomMessages.xmpp.ts +1 -12
  512. package/src/networking/xmppClient.ts +9 -141
  513. package/src/roomStore/chatSettingsSlice.ts +10 -34
  514. package/src/roomStore/index.ts +4 -40
  515. package/src/roomStore/persistence.ts +40 -234
  516. package/src/roomStore/roomsSlice.ts +7 -87
  517. package/src/services/pushSubscriptionService.ts +13 -18
  518. package/src/types/types.ts +5 -58
  519. package/src/version.ts +3 -1
  520. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +0 -226
  521. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  522. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +0 -556
  523. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  524. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +0 -210
  525. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  526. package/lib/commonjs/helpers/getChatBackground.js +0 -23
  527. package/lib/commonjs/helpers/getChatBackground.js.map +0 -1
  528. package/lib/commonjs/helpers/getDisplayFileName.js +0 -79
  529. package/lib/commonjs/helpers/getDisplayFileName.js.map +0 -1
  530. package/lib/commonjs/helpers/getServerReadTimestamp.js +0 -125
  531. package/lib/commonjs/helpers/getServerReadTimestamp.js.map +0 -1
  532. package/lib/commonjs/helpers/isOwnMessage.js +0 -75
  533. package/lib/commonjs/helpers/isOwnMessage.js.map +0 -1
  534. package/lib/commonjs/helpers/mediaLibraryRuntime.js +0 -31
  535. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +0 -1
  536. package/lib/commonjs/helpers/persistCrypto.js +0 -122
  537. package/lib/commonjs/helpers/persistCrypto.js.map +0 -1
  538. package/lib/commonjs/helpers/pickImageAsset.js +0 -68
  539. package/lib/commonjs/helpers/pickImageAsset.js.map +0 -1
  540. package/lib/commonjs/helpers/pushPayload.js +0 -71
  541. package/lib/commonjs/helpers/pushPayload.js.map +0 -1
  542. package/lib/commonjs/helpers/secureFileUrl.js +0 -101
  543. package/lib/commonjs/helpers/secureFileUrl.js.map +0 -1
  544. package/lib/commonjs/helpers/secureKeyValue.js +0 -83
  545. package/lib/commonjs/helpers/secureKeyValue.js.map +0 -1
  546. package/lib/commonjs/helpers/secureStoreRuntime.js +0 -59
  547. package/lib/commonjs/helpers/secureStoreRuntime.js.map +0 -1
  548. package/lib/commonjs/helpers/secureUserStorage.js +0 -75
  549. package/lib/commonjs/helpers/secureUserStorage.js.map +0 -1
  550. package/lib/commonjs/helpers/shallowEqual.js +0 -36
  551. package/lib/commonjs/helpers/shallowEqual.js.map +0 -1
  552. package/lib/commonjs/helpers/sheetGestures.js +0 -32
  553. package/lib/commonjs/helpers/sheetGestures.js.map +0 -1
  554. package/lib/commonjs/hooks/useFileToken.js +0 -10
  555. package/lib/commonjs/hooks/useFileToken.js.map +0 -1
  556. package/lib/commonjs/networking/authRefresh.js +0 -332
  557. package/lib/commonjs/networking/authRefresh.js.map +0 -1
  558. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +0 -223
  559. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +0 -1
  560. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +0 -548
  561. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +0 -1
  562. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +0 -205
  563. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +0 -1
  564. package/lib/module/helpers/getChatBackground.js +0 -18
  565. package/lib/module/helpers/getChatBackground.js.map +0 -1
  566. package/lib/module/helpers/getDisplayFileName.js +0 -73
  567. package/lib/module/helpers/getDisplayFileName.js.map +0 -1
  568. package/lib/module/helpers/getServerReadTimestamp.js +0 -120
  569. package/lib/module/helpers/getServerReadTimestamp.js.map +0 -1
  570. package/lib/module/helpers/isOwnMessage.js +0 -70
  571. package/lib/module/helpers/isOwnMessage.js.map +0 -1
  572. package/lib/module/helpers/mediaLibraryRuntime.js +0 -25
  573. package/lib/module/helpers/mediaLibraryRuntime.js.map +0 -1
  574. package/lib/module/helpers/persistCrypto.js +0 -115
  575. package/lib/module/helpers/persistCrypto.js.map +0 -1
  576. package/lib/module/helpers/pickImageAsset.js +0 -63
  577. package/lib/module/helpers/pickImageAsset.js.map +0 -1
  578. package/lib/module/helpers/pushPayload.js +0 -63
  579. package/lib/module/helpers/pushPayload.js.map +0 -1
  580. package/lib/module/helpers/secureFileUrl.js +0 -91
  581. package/lib/module/helpers/secureFileUrl.js.map +0 -1
  582. package/lib/module/helpers/secureKeyValue.js +0 -75
  583. package/lib/module/helpers/secureKeyValue.js.map +0 -1
  584. package/lib/module/helpers/secureStoreRuntime.js +0 -52
  585. package/lib/module/helpers/secureStoreRuntime.js.map +0 -1
  586. package/lib/module/helpers/secureUserStorage.js +0 -72
  587. package/lib/module/helpers/secureUserStorage.js.map +0 -1
  588. package/lib/module/helpers/shallowEqual.js +0 -31
  589. package/lib/module/helpers/shallowEqual.js.map +0 -1
  590. package/lib/module/helpers/sheetGestures.js +0 -26
  591. package/lib/module/helpers/sheetGestures.js.map +0 -1
  592. package/lib/module/hooks/useFileToken.js +0 -5
  593. package/lib/module/hooks/useFileToken.js.map +0 -1
  594. package/lib/module/networking/authRefresh.js +0 -321
  595. package/lib/module/networking/authRefresh.js.map +0 -1
  596. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +0 -9
  597. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +0 -1
  598. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +0 -75
  599. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +0 -1
  600. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +0 -25
  601. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +0 -1
  602. package/lib/typescript/helpers/getChatBackground.d.ts +0 -15
  603. package/lib/typescript/helpers/getChatBackground.d.ts.map +0 -1
  604. package/lib/typescript/helpers/getDisplayFileName.d.ts +0 -49
  605. package/lib/typescript/helpers/getDisplayFileName.d.ts.map +0 -1
  606. package/lib/typescript/helpers/getServerReadTimestamp.d.ts +0 -69
  607. package/lib/typescript/helpers/getServerReadTimestamp.d.ts.map +0 -1
  608. package/lib/typescript/helpers/isOwnMessage.d.ts +0 -36
  609. package/lib/typescript/helpers/isOwnMessage.d.ts.map +0 -1
  610. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +0 -3
  611. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +0 -1
  612. package/lib/typescript/helpers/persistCrypto.d.ts +0 -13
  613. package/lib/typescript/helpers/persistCrypto.d.ts.map +0 -1
  614. package/lib/typescript/helpers/pickImageAsset.d.ts +0 -27
  615. package/lib/typescript/helpers/pickImageAsset.d.ts.map +0 -1
  616. package/lib/typescript/helpers/pushPayload.d.ts +0 -7
  617. package/lib/typescript/helpers/pushPayload.d.ts.map +0 -1
  618. package/lib/typescript/helpers/secureFileUrl.d.ts +0 -7
  619. package/lib/typescript/helpers/secureFileUrl.d.ts.map +0 -1
  620. package/lib/typescript/helpers/secureKeyValue.d.ts +0 -13
  621. package/lib/typescript/helpers/secureKeyValue.d.ts.map +0 -1
  622. package/lib/typescript/helpers/secureStoreRuntime.d.ts +0 -29
  623. package/lib/typescript/helpers/secureStoreRuntime.d.ts.map +0 -1
  624. package/lib/typescript/helpers/secureUserStorage.d.ts +0 -23
  625. package/lib/typescript/helpers/secureUserStorage.d.ts.map +0 -1
  626. package/lib/typescript/helpers/shallowEqual.d.ts +0 -11
  627. package/lib/typescript/helpers/shallowEqual.d.ts.map +0 -1
  628. package/lib/typescript/helpers/sheetGestures.d.ts +0 -20
  629. package/lib/typescript/helpers/sheetGestures.d.ts.map +0 -1
  630. package/lib/typescript/hooks/useFileToken.d.ts +0 -2
  631. package/lib/typescript/hooks/useFileToken.d.ts.map +0 -1
  632. package/lib/typescript/networking/authRefresh.d.ts +0 -95
  633. package/lib/typescript/networking/authRefresh.d.ts.map +0 -1
  634. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +0 -244
  635. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +0 -615
  636. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +0 -217
  637. package/src/helpers/getChatBackground.ts +0 -18
  638. package/src/helpers/getDisplayFileName.ts +0 -87
  639. package/src/helpers/getServerReadTimestamp.ts +0 -120
  640. package/src/helpers/isOwnMessage.ts +0 -90
  641. package/src/helpers/mediaLibraryRuntime.ts +0 -25
  642. package/src/helpers/persistCrypto.ts +0 -127
  643. package/src/helpers/pickImageAsset.ts +0 -68
  644. package/src/helpers/pushPayload.ts +0 -62
  645. package/src/helpers/secureFileUrl.ts +0 -103
  646. package/src/helpers/secureKeyValue.ts +0 -80
  647. package/src/helpers/secureStoreRuntime.ts +0 -62
  648. package/src/helpers/secureUserStorage.ts +0 -80
  649. package/src/helpers/shallowEqual.ts +0 -33
  650. package/src/helpers/sheetGestures.ts +0 -25
  651. package/src/hooks/useFileToken.ts +0 -7
  652. package/src/networking/authRefresh.ts +0 -451
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  import AsyncStorage from '@react-native-async-storage/async-storage';
4
- import { encryptForPersist, decryptFromPersist } from '../helpers/persistCrypto';
5
4
  // -------------------------------------------------------------------
6
5
  // Lightweight RN persistence layer. Mirrors what redux-persist gives
7
6
  // the web component:
@@ -11,32 +10,16 @@ import { encryptForPersist, decryptFromPersist } from '../helpers/persistCrypto'
11
10
  // - cap each room's messages to the most recent MESSAGE_LIMIT (100)
12
11
  // - debounced writes (200ms) on relevant action types
13
12
  //
14
- // AES-256-CBC at rest (see `helpers/persistCrypto.ts`): the JSON blob
15
- // under each key below is encrypted before it reaches AsyncStorage, with
16
- // the symmetric key held in the platform Keychain/Keystore. `user` here
17
- // is already secret-free (see `sanitizeUser`) — the encryption is for
18
- // the message bodies in `rooms`, which aren't.
13
+ // Not encrypted. We rely on AsyncStorage's per-app sandbox.
19
14
  // -------------------------------------------------------------------
20
15
 
21
16
  const KEY_CHAT = '@ethora/persist:chatSettingStore';
22
17
  const KEY_ROOMS = '@ethora/persist:rooms';
23
- // bug #39: a failed send needs to survive a relaunch as "failed / tap
24
- // to retry", not silently render as delivered. `roomHeapStore.failedMessages`
25
- // is the map the bubble reads (`isFailed = failedMessages[id]`, see
26
- // Message.tsx / useMessageHeapState): it lives in a separate, previously
27
- // non-persisted slice from `rooms`, so it gets its own key here.
28
- const KEY_HEAP = '@ethora/persist:roomHeap';
29
18
 
30
19
  // Per-room message cap on disk. Mirror this value in `roomsSlice`'s
31
20
  // in-memory cap (see `enforceMessageCap`) so the runtime and persisted
32
21
  // shapes stay aligned.
33
22
  export const MESSAGE_LIMIT = 100;
34
-
35
- // Defensive cap on the number of failed-message payloads written to
36
- // disk. In practice this map only grows while the user is actively
37
- // sending offline, but a runaway sender (or a bug that never clears an
38
- // entry) must not turn this key into an unbounded write.
39
- export const MAX_PERSISTED_FAILED_MESSAGES = 200;
40
23
  const sanitizeUser = user => {
41
24
  if (!user) {
42
25
  return null;
@@ -61,14 +44,23 @@ const sanitizeUser = user => {
61
44
  // on reload before MAM catches up. That needs the fields the bubbles and
62
45
  // room-list previews actually read, nothing else. Everything outside this
63
46
  // list is either re-derived on render or re-fetched from the server.
64
- const PERSISTED_MESSAGE_FIELDS = ['id', 'xmppId', 'xmppFrom', 'body', 'date', 'timestamp', 'roomJid', 'isSystemMessage', 'isMediafile', 'isDeleted', 'isEdited', 'isReply', 'showInChannel', 'mainMessage', 'mimetype', 'location', 'locationPreview', 'fileName', 'originalName', 'size', 'langSource', 'callLog',
65
- // bug #39: without this, a message that was still in flight (no
66
- // server echo yet) at kill time comes back from disk indistinguishable
67
- // from a normal delivered message, so the bubble renders it as sent.
68
- // Persisting `pending` lets the boot-time scan (see
69
- // computeBootTimeFailures below) find exactly the messages that never
70
- // got confirmed and flip them to failed instead.
71
- 'pending'];
47
+ const PERSISTED_MESSAGE_FIELDS = ['id', 'xmppId', 'xmppFrom', 'body', 'date', 'timestamp', 'roomJid', 'isSystemMessage', 'isMediafile', 'isDeleted', 'isEdited', 'isReply', 'showInChannel', 'mainMessage', 'mimetype', 'location', 'locationPreview', 'fileName', 'originalName', 'size', 'langSource',
48
+ // `translations` MUST be here. A previous version of this list dropped
49
+ // it, on the theory that it mirrored the web SDK's persist contract —
50
+ // it doesn't: web's redux-persist config (web/src/roomStore/index.ts)
51
+ // has no per-field message whitelist at all, it persists whatever is in
52
+ // `room.messages` (capped to the last 50) and that includes
53
+ // `translations` verbatim. Field-picking is an RN-only mechanism, so
54
+ // "same as web" was never true for this key.
55
+ //
56
+ // Dropping it meant every cold start painted the cached transcript in
57
+ // the ORIGINAL language and only flipped to the translation once MAM
58
+ // re-sent the history a few seconds later (onMessageHistory re-parses
59
+ // <translations> off the wire) — visible on every launch, for every
60
+ // translated message, since the cache never had a translation to show
61
+ // in the first place. Persisting it here is what lets the very first
62
+ // paint already be translated, the way the live path already is.
63
+ 'translations', 'callLog'];
72
64
 
73
65
  // The sender identity that rides along on every message over the wire
74
66
  // (senderFirstName / senderLastName / photo, which createMessageFromXml
@@ -159,167 +151,6 @@ const sanitizeRooms = rooms => {
159
151
  }
160
152
  return out;
161
153
  };
162
-
163
- // Only the fields retryMessage actually needs to replay the send (see
164
- // FailedMessagePayload / useSendMessage.retryMessage). In particular, the
165
- // media `data` blob is trimmed to `uri/type/name/size` (the picker never
166
- // hands us auth material, but this stays defensive against a future
167
- // picker change smuggling extra fields, or a huge inline payload, into
168
- // `data`).
169
- const sanitizeMediaData = data => {
170
- if (!data || typeof data !== 'object') {
171
- return {};
172
- }
173
- const out = {};
174
- if (typeof data.uri === 'string') {
175
- out.uri = data.uri;
176
- }
177
- if (typeof data.type === 'string') {
178
- out.type = data.type;
179
- }
180
- if (typeof data.name === 'string') {
181
- out.name = data.name;
182
- }
183
- if (typeof data.size === 'number') {
184
- out.size = data.size;
185
- }
186
- return out;
187
- };
188
- const sanitizeFailedMessagePayload = payload => {
189
- if (!payload || typeof payload !== 'object') {
190
- return null;
191
- }
192
- if (!payload.id || typeof payload.id !== 'string') {
193
- return null;
194
- }
195
- if (!payload.roomJID || typeof payload.roomJID !== 'string') {
196
- return null;
197
- }
198
- if (payload.kind === 'media') {
199
- return {
200
- kind: 'media',
201
- id: payload.id,
202
- roomJID: payload.roomJID,
203
- data: sanitizeMediaData(payload.data),
204
- type: typeof payload.type === 'string' ? payload.type : '',
205
- isReply: payload.isReply,
206
- isChecked: payload.isChecked,
207
- mainMessage: payload.mainMessage
208
- };
209
- }
210
- if (payload.kind === 'text') {
211
- return {
212
- kind: 'text',
213
- id: payload.id,
214
- roomJID: payload.roomJID,
215
- body: typeof payload.body === 'string' ? payload.body : '',
216
- isReply: payload.isReply,
217
- isChecked: payload.isChecked,
218
- mainMessage: payload.mainMessage
219
- };
220
- }
221
- return null;
222
- };
223
- const sanitizeFailedMessages = failedMessages => {
224
- if (!failedMessages || typeof failedMessages !== 'object') {
225
- return {};
226
- }
227
- const out = {};
228
- let count = 0;
229
- for (const [id, payload] of Object.entries(failedMessages)) {
230
- if (count >= MAX_PERSISTED_FAILED_MESSAGES) {
231
- break;
232
- }
233
- const clean = sanitizeFailedMessagePayload(payload);
234
- if (clean) {
235
- out[id] = clean;
236
- count++;
237
- }
238
- }
239
- return out;
240
- };
241
-
242
- // -------------------------------------------------------------------
243
- // Boot-time pending -> failed conversion (bug #39).
244
- //
245
- // `messageHeap` (the "still sending" buffer) is intentionally NOT
246
- // persisted: it's a process-lifetime thing. That means on a cold start
247
- // there is no such thing as "still sending": a persisted message that
248
- // carries `pending: true` never got a server echo NOR got the chance to
249
- // trip the in-session watchdog (see PENDING_WATCHDOG_MS in
250
- // useSendMessage.tsx) before the process died. It must render as failed
251
- // with a working retry, not as delivered and not as stuck "sending...".
252
- //
253
- // Reconstructs the same FailedMessagePayload shape the live send path
254
- // builds in useSendMessage (markMessageFailed calls), from the fields we
255
- // persist per message.
256
- // -------------------------------------------------------------------
257
-
258
- export function reconstructFailedMessagePayload(message, roomJID) {
259
- if (!message?.id || !roomJID) {
260
- return null;
261
- }
262
- const isReply = !!message.isReply;
263
- const isChecked = message.showInChannel === 'true';
264
- const mainMessage = message.mainMessage;
265
- if (message.isMediafile === 'true') {
266
- return {
267
- kind: 'media',
268
- id: message.id,
269
- roomJID,
270
- data: sanitizeMediaData({
271
- uri: message.location,
272
- name: message.fileName,
273
- type: message.mimetype,
274
- size: message.size !== undefined && message.size !== null ? Number(message.size) : undefined
275
- }),
276
- type: message.mimetype || '',
277
- isReply,
278
- isChecked,
279
- mainMessage
280
- };
281
- }
282
- return {
283
- kind: 'text',
284
- id: message.id,
285
- roomJID,
286
- body: message.body || '',
287
- isReply,
288
- isChecked,
289
- mainMessage
290
- };
291
- }
292
-
293
- /**
294
- * Scan every persisted room for messages still `pending: true` that
295
- * DON'T already have a restored failure entry (those are handled by the
296
- * caller separately, from the persisted `failedMessages` map), and
297
- * synthesize a retry-able FailedMessagePayload for each. Pure function:
298
- * the caller (roomStore/index.ts) is responsible for dispatching
299
- * `markMessageFailed` for the results.
300
- */
301
- export function computeBootTimeFailures(rooms, alreadyFailed) {
302
- if (!rooms || typeof rooms !== 'object') {
303
- return [];
304
- }
305
- const out = [];
306
- for (const [jid, room] of Object.entries(rooms)) {
307
- const messages = Array.isArray(room?.messages) ? room.messages : [];
308
- for (const message of messages) {
309
- if (!message || !message.pending) {
310
- continue;
311
- }
312
- if (alreadyFailed && alreadyFailed[message.id]) {
313
- continue;
314
- }
315
- const payload = reconstructFailedMessagePayload(message, jid);
316
- if (payload) {
317
- out.push(payload);
318
- }
319
- }
320
- }
321
- return out;
322
- }
323
154
  let writeTimer = null;
324
155
 
325
156
  /**
@@ -329,31 +160,25 @@ let writeTimer = null;
329
160
  export const persistenceMiddleware = storeAPI => next => action => {
330
161
  const result = next(action);
331
162
  const type = action?.type || '';
332
- if (!type.startsWith('roomMessages/') && !type.startsWith('roomHeapStore/') && !type.startsWith('chat/setUser') && !type.startsWith('chat/updateUser') && !type.startsWith('chat/refreshTokens') && !type.startsWith('chat/logout')) {
163
+ if (!type.startsWith('roomMessages/') && !type.startsWith('chat/setUser') && !type.startsWith('chat/updateUser') && !type.startsWith('chat/refreshTokens') && !type.startsWith('chat/logout')) {
333
164
  return result;
334
165
  }
335
166
  if (writeTimer) {
336
167
  clearTimeout(writeTimer);
337
168
  }
338
169
  writeTimer = setTimeout(() => {
339
- (async () => {
340
- try {
341
- const state = storeAPI.getState();
342
- const chatPayload = {
343
- user: sanitizeUser(state.chatSettingStore?.user)
344
- };
345
- const roomsPayload = {
346
- rooms: sanitizeRooms(state.rooms?.rooms || {})
347
- };
348
- const heapPayload = {
349
- failedMessages: sanitizeFailedMessages(state.roomHeapSlice?.failedMessages)
350
- };
351
- const [chatCipher, roomsCipher, heapCipher] = await Promise.all([encryptForPersist(JSON.stringify(chatPayload)), encryptForPersist(JSON.stringify(roomsPayload)), encryptForPersist(JSON.stringify(heapPayload))]);
352
- await AsyncStorage.multiSet([[KEY_CHAT, chatCipher], [KEY_ROOMS, roomsCipher], [KEY_HEAP, heapCipher]]);
353
- } catch (e) {
354
- console.warn('persist write failed', e);
355
- }
356
- })();
170
+ try {
171
+ const state = storeAPI.getState();
172
+ const chatPayload = {
173
+ user: sanitizeUser(state.chatSettingStore?.user)
174
+ };
175
+ const roomsPayload = {
176
+ rooms: sanitizeRooms(state.rooms?.rooms || {})
177
+ };
178
+ AsyncStorage.multiSet([[KEY_CHAT, JSON.stringify(chatPayload)], [KEY_ROOMS, JSON.stringify(roomsPayload)]]).catch(e => console.warn('persist write failed', e));
179
+ } catch (e) {
180
+ console.warn('persist serialize failed', e);
181
+ }
357
182
  }, 200);
358
183
  return result;
359
184
  };
@@ -365,40 +190,30 @@ export const persistenceMiddleware = storeAPI => next => action => {
365
190
  */
366
191
  export async function readPersistedState() {
367
192
  try {
368
- const [chatRaw, roomsRaw, heapRaw] = await AsyncStorage.multiGet([KEY_CHAT, KEY_ROOMS, KEY_HEAP]);
369
- const [chatPlain, roomsPlain, heapPlain] = await Promise.all([chatRaw[1] ? decryptFromPersist(chatRaw[1]) : Promise.resolve(null), roomsRaw[1] ? decryptFromPersist(roomsRaw[1]) : Promise.resolve(null), heapRaw[1] ? decryptFromPersist(heapRaw[1]) : Promise.resolve(null)]);
370
- // `decryptFromPersist` returns null both for "nothing stored" and
371
- // for "stored value isn't a valid envelope for the current key" —
372
- // notably a plaintext blob left over from a pre-encryption install.
373
- // Either way there is nothing safe to parse, so the caller treats it
374
- // as a cold start and re-hydrates from the server.
375
- const chat = chatPlain ? JSON.parse(chatPlain) : null;
376
- const rooms = roomsPlain ? JSON.parse(roomsPlain) : null;
377
- const heap = heapPlain ? JSON.parse(heapPlain) : null;
193
+ const [chatRaw, roomsRaw] = await AsyncStorage.multiGet([KEY_CHAT, KEY_ROOMS]);
194
+ const chat = chatRaw[1] ? JSON.parse(chatRaw[1]) : null;
195
+ const rooms = roomsRaw[1] ? JSON.parse(roomsRaw[1]) : null;
378
196
  return {
379
197
  chat,
380
- rooms,
381
- heap
198
+ rooms
382
199
  };
383
200
  } catch (e) {
384
201
  console.warn('persist read failed', e);
385
202
  return {
386
203
  chat: null,
387
- rooms: null,
388
- heap: null
204
+ rooms: null
389
205
  };
390
206
  }
391
207
  }
392
208
  export async function clearPersistedState() {
393
209
  try {
394
- await AsyncStorage.multiRemove([KEY_CHAT, KEY_ROOMS, KEY_HEAP]);
210
+ await AsyncStorage.multiRemove([KEY_CHAT, KEY_ROOMS]);
395
211
  } catch (e) {
396
212
  console.warn('persist clear failed', e);
397
213
  }
398
214
  }
399
215
  export const PERSIST_KEYS = {
400
216
  KEY_CHAT,
401
- KEY_ROOMS,
402
- KEY_HEAP
217
+ KEY_ROOMS
403
218
  };
404
219
  //# sourceMappingURL=persistence.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AsyncStorage","encryptForPersist","decryptFromPersist","KEY_CHAT","KEY_ROOMS","KEY_HEAP","MESSAGE_LIMIT","MAX_PERSISTED_FAILED_MESSAGES","sanitizeUser","user","token","_token","refreshToken","_refreshToken","xmppPassword","_xmppPassword","rest","PERSISTED_MESSAGE_FIELDS","PERSISTED_MESSAGE_USER_FIELDS","REFETCHED_ROOM_FIELDS","pickDefined","source","keys","out","key","value","undefined","compactMessageForPersist","message","compact","sanitizeMessages","messages","Array","isArray","capped","length","slice","map","sanitizeRooms","rooms","jid","room","Object","entries","includes","compactRoom","usersCnt","members","field","composing","composingList","isLoading","historyPreloadState","sanitizeMediaData","data","uri","type","name","size","sanitizeFailedMessagePayload","payload","id","roomJID","kind","isReply","isChecked","mainMessage","body","sanitizeFailedMessages","failedMessages","count","clean","reconstructFailedMessagePayload","showInChannel","isMediafile","location","fileName","mimetype","Number","computeBootTimeFailures","alreadyFailed","pending","push","writeTimer","persistenceMiddleware","storeAPI","next","action","result","startsWith","clearTimeout","setTimeout","state","getState","chatPayload","chatSettingStore","roomsPayload","heapPayload","roomHeapSlice","chatCipher","roomsCipher","heapCipher","Promise","all","JSON","stringify","multiSet","e","console","warn","readPersistedState","chatRaw","roomsRaw","heapRaw","multiGet","chatPlain","roomsPlain","heapPlain","resolve","chat","parse","heap","clearPersistedState","multiRemove","PERSIST_KEYS"],"sourceRoot":"../../../src","sources":["roomStore/persistence.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,2CAA2C;AAGpE,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,0BAA0B;AAGhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,QAAQ,GAAG,kCAAkC;AACnD,MAAMC,SAAS,GAAG,uBAAuB;AACzC;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,0BAA0B;;AAE3C;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAG,GAAG;AAmBhD,MAAMC,YAAY,GAAIC,IAAW,IAAkB;EACjD,IAAI,CAACA,IAAI,EAAE;IAAC,OAAO,IAAI;EAAC;EACxB;EACA;EACA,MAAM;IACJC,KAAK,EAAEC,MAAM;IACbC,YAAY,EAAEC,aAAa;IAC3BC,YAAY,EAAEC,aAAa;IAC3B,GAAGC;EACL,CAAC,GAAGP,IAAW;EACf,OAAO;IACL,GAAGO,IAAI;IACPN,KAAK,EAAE,EAAE;IACTE,YAAY,EAAE,EAAE;IAChBE,YAAY,EAAE;EAChB,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMG,wBAA4C,GAAG,CACnD,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,MAAM,EACN,MAAM,EACN,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CACV;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,6BAA6B,GAAG,C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CAAC,CAAC;EACjE,CAAC,CAAC,OAAOsG,CAAC,EAAE;IACVC,OAAO,CAACC,IAAI,CAAC,sBAAsB,EAAEF,CAAC,CAAC;EACzC;AACF;AAEA,OAAO,MAAMiB,YAAY,GAAG;EAAEzH,QAAQ;EAAEC,SAAS;EAAEC;AAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["AsyncStorage","KEY_CHAT","KEY_ROOMS","MESSAGE_LIMIT","sanitizeUser","user","token","_token","refreshToken","_refreshToken","xmppPassword","_xmppPassword","rest","PERSISTED_MESSAGE_FIELDS","PERSISTED_MESSAGE_USER_FIELDS","REFETCHED_ROOM_FIELDS","pickDefined","source","keys","out","key","value","undefined","compactMessageForPersist","message","compact","sanitizeMessages","messages","Array","isArray","capped","length","slice","map","sanitizeRooms","rooms","jid","room","Object","entries","includes","compactRoom","usersCnt","members","field","composing","composingList","isLoading","historyPreloadState","writeTimer","persistenceMiddleware","storeAPI","next","action","result","type","startsWith","clearTimeout","setTimeout","state","getState","chatPayload","chatSettingStore","roomsPayload","multiSet","JSON","stringify","catch","e","console","warn","readPersistedState","chatRaw","roomsRaw","multiGet","chat","parse","clearPersistedState","multiRemove","PERSIST_KEYS"],"sourceRoot":"../../../src","sources":["roomStore/persistence.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,2CAA2C;AAIpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,QAAQ,GAAG,kCAAkC;AACnD,MAAMC,SAAS,GAAG,uBAAuB;;AAEzC;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;AAWhC,MAAMC,YAAY,GAAIC,IAAW,IAAkB;EACjD,IAAI,CAACA,IAAI,EAAE;IAAC,OAAO,IAAI;EAAC;EACxB;EACA;EACA,MAAM;IACJC,KAAK,EAAEC,MAAM;IACbC,YAAY,EAAEC,aAAa;IAC3BC,YAAY,EAAEC,aAAa;IAC3B,GAAGC;EACL,CAAC,GAAGP,I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C8E,WAAW,CAAC,CAAC7E,QAAQ,EAAEC,SAAS,CAAC,CAAC;EACvD,CAAC,CAAC,OAAOkE,CAAC,EAAE;IACVC,OAAO,CAACC,IAAI,CAAC,sBAAsB,EAAEF,CAAC,CAAC;EACzC;AACF;AAEA,OAAO,MAAMW,YAAY,GAAG;EAAE9E,QAAQ;EAAEC;AAAU,CAAC","ignoreList":[]}
@@ -11,7 +11,7 @@ import { insertMessageWithDelimiter } from '../helpers/insertMessageWithDelimite
11
11
  // older history added via unshift/splice is exempt, so the user can
12
12
  // page backward arbitrarily far without instantly losing what they
13
13
  // just fetched. After cap eviction we drop from the head (oldest).
14
- export const RUNTIME_MESSAGE_LIMIT = 100;
14
+ const RUNTIME_MESSAGE_LIMIT = 100;
15
15
 
16
16
  // Body strings the server uses for call signaling broadcasts (call-token,
17
17
  // call-state ringing/ended, etc). These should never reach the chat
@@ -127,6 +127,7 @@ function mergeHistoryIntoCache(existing, fetched) {
127
127
  // fetched MAM page (the live-stream swallow doesn't cover history).
128
128
  const ex = stripCallSignals(existing);
129
129
  const fe = stripCallSignals(fetched);
130
+ const pending = ex.filter(m => m?.pending);
130
131
  const realExisting = ex.filter(m => m && !m.pending && m.id !== 'delimiter-new');
131
132
  const realFetched = fe.filter(m => m && m.id !== 'delimiter-new');
132
133
 
@@ -134,28 +135,6 @@ function mergeHistoryIntoCache(existing, fetched) {
134
135
  if (realFetched.length === 0) {
135
136
  return ex;
136
137
  }
137
-
138
- // Optimistic sends are preserved across a history merge - EXCEPT the
139
- // ones the fetched page proves the server already has. That happens
140
- // whenever a send reached the server but its echo did not reach us
141
- // before the process died: the optimistic bubble is restored from disk
142
- // still `pending: true` (and, since bug #39, flagged failed at boot),
143
- // while MAM hands back the very same message under its ARCHIVE id.
144
- // Keying only on `id` never matched those two, so the room ended up
145
- // showing the message twice - once for real and once as a bubble stuck
146
- // on "sending…"/"Failed" that nothing could ever clear. The archived
147
- // copy carries our original stanza id as `xmppId` (getDataFromXml), so
148
- // match on that too and drop the local ghost.
149
- const fetchedKeys = new Set();
150
- for (const m of realFetched) {
151
- if (m?.id != null) {
152
- fetchedKeys.add(String(m.id));
153
- }
154
- if (m?.xmppId) {
155
- fetchedKeys.add(String(m.xmppId));
156
- }
157
- }
158
- const pending = ex.filter(m => m?.pending && !fetchedKeys.has(String(m.id)) && !(m.xmppId && fetchedKeys.has(String(m.xmppId))));
159
138
  const byMs = (a, b) => msgSortableMs(a) - msgSortableMs(b);
160
139
  const capTail = arr => arr.length > RUNTIME_MESSAGE_LIMIT ? arr.slice(-RUNTIME_MESSAGE_LIMIT) : arr;
161
140
  const existingIds = new Set(realExisting.map(m => String(m.id)));
@@ -285,8 +264,6 @@ const reducers = {
285
264
  const existingMessages = Array.isArray(existing?.messages) ? existing.messages : [];
286
265
  state.rooms[roomData.jid] = {
287
266
  ...roomData,
288
- icon: roomData.icon !== undefined ? roomData.icon : existing?.icon,
289
- roomBg: roomData.roomBg !== undefined ? roomData.roomBg : existing?.roomBg,
290
267
  messages: existingMessages.length > 0 ? existingMessages : incomingMessages,
291
268
  lastViewedTimestamp: lastViewed,
292
269
  unreadMessages: roomData.unreadMessages ?? existing?.unreadMessages ?? 0,
@@ -518,19 +495,7 @@ const reducers = {
518
495
  *
519
496
  * Monotonic: a marker only ever moves a baseline FORWARD, so a stale
520
497
  * server value can't resurrect already-read messages and a more-recent
521
- * local read (tab blur stamping the server read timestamp) always wins.
522
- *
523
- * Bug #38 self-heal: forward-only is correct for a SANE existing
524
- * value, but a device whose clock was ahead may have already stamped
525
- * a marker in the future (either persisted locally from a previous
526
- * session, or fetched from the server before this fix existed). To
527
- * "only ever move forward" from a corrupt future value is to never
528
- * move at all - the room would stay stuck at `unreadMessages: 0`
529
- * forever. When the room is loaded, detect a marker that sits well
530
- * past the newest message we actually know it has and waive the
531
- * forward-only check for that one comparison, so the incoming
532
- * (already-clamped, see xmppClient.getChatsPrivateStoreRequestStanza)
533
- * value can correct it even though it's numerically smaller.
498
+ * local read (tab blur stamping Date.now()) always wins.
534
499
  */
535
500
  applyPrivateStoreMarkers: (state, action) => {
536
501
  const markers = action.payload;
@@ -545,30 +510,15 @@ const reducers = {
545
510
  if (!jid || !Number.isFinite(ts) || ts <= 0) {
546
511
  continue;
547
512
  }
548
- const room = state.rooms[jid];
549
- const newestKnownMs = room ? newestAckedMessageMs(room.messages) : 0;
550
- // Mirrors isCorruptFutureReadMarker in helpers/getServerReadTimestamp.ts
551
- // (duplicated to avoid a roomStore <-> helpers import cycle):
552
- // BOTH signals are required. "Further ahead than the newest
553
- // message this room has locally" happens all the time on a room
554
- // whose history hasn't synced yet, and healing on that alone
555
- // would drop a legitimate marker another device wrote after
556
- // reading newer messages. A real read marker can never be ahead
557
- // of real time, so that second signal is what distinguishes a
558
- // stale cache from a wrong clock.
559
- const nowMs = Date.now();
560
- const looksCorrupt = existing => newestKnownMs > 0 && existing > newestKnownMs + FUTURE_MARKER_TOLERANCE_MS && existing > nowMs + FUTURE_MARKER_TOLERANCE_MS;
561
-
562
513
  // Remember the marker so rooms that load LATER (via addRoom)
563
514
  // inherit it even though they don't exist in the store yet.
564
- const cachedMarker = state.privateStoreMarkers[jid] || 0;
565
- if (ts > cachedMarker || looksCorrupt(cachedMarker)) {
515
+ if (ts > (state.privateStoreMarkers[jid] || 0)) {
566
516
  state.privateStoreMarkers[jid] = ts;
567
517
  }
568
518
  // Upgrade an already-loaded room's baseline + recompute its badge.
569
- // Forward-only, unless the room's CURRENT baseline is itself the
570
- // corrupt value being corrected.
571
- if (room && (ts > (room.lastViewedTimestamp || 0) || looksCorrupt(room.lastViewedTimestamp || 0))) {
519
+ // Only ever forward, so a later local read isn't clobbered.
520
+ const room = state.rooms[jid];
521
+ if (room && ts > (room.lastViewedTimestamp || 0)) {
572
522
  room.lastViewedTimestamp = ts;
573
523
  room.unreadMessages = countNewerMessages(room.messages, ts);
574
524
  }
@@ -805,35 +755,6 @@ const isOwn = (msg, selfXmpp, selfWallet) => {
805
755
  }
806
756
  return false;
807
757
  };
808
-
809
- // Bug #38 tolerance: a stored read marker more than this far past the
810
- // newest message a room actually has is not "the user is a little
811
- // ahead" - it's a leftover from a device whose clock was wrong when it
812
- // stamped the marker. Kept in sync with (but duplicated from, to avoid
813
- // a roomStore ↔ helpers import cycle) FUTURE_READ_MARKER_TOLERANCE_MS
814
- // in helpers/getServerReadTimestamp.ts.
815
- const FUTURE_MARKER_TOLERANCE_MS = 5 * 60 * 1000;
816
-
817
- // Newest message in `messages` this room actually has proof the server
818
- // accepted - used only to sanity-check an already-stored read marker
819
- // against reality (see applyPrivateStoreMarkers's self-heal). Excludes
820
- // pending/optimistic sends via the `pending` flag alone: unlike
821
- // getServerReadTimestamp, this runs inside a reducer and can't reach
822
- // across to the roomHeapSlice slice, but `pending` already identifies
823
- // every optimistic send that matters for this comparison.
824
- const newestAckedMessageMs = messages => {
825
- let newest = 0;
826
- for (const m of messages || []) {
827
- if (!m || m.id === 'delimiter-new' || m.pending) {
828
- continue;
829
- }
830
- const ms = msgSortableMs(m);
831
- if (ms > newest) {
832
- newest = ms;
833
- }
834
- }
835
- return newest;
836
- };
837
758
  const countNewerMessages = (messages, timestamp, selfXmpp = '', selfWallet = '') => {
838
759
  if (!messages?.length || !timestamp) {
839
760
  return 0;