@ethora/chat-component-rn 26.7.5 → 26.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +31 -8
  3. package/lib/commonjs/assets/icons.js +7 -2
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/Header/HeaderRoomList.js +26 -7
  6. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  7. package/lib/commonjs/components/MainComponents/ChatHeader.js +5 -2
  8. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/ChatRoom.js +36 -14
  10. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  11. package/lib/commonjs/components/MainComponents/MessageList.js +7 -23
  12. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js +14 -13
  14. package/lib/commonjs/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  15. package/lib/commonjs/components/MainComponents/RoomList.js +208 -35
  16. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  17. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +317 -98
  18. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  19. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js +320 -110
  20. package/lib/commonjs/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  21. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +552 -213
  22. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  23. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +226 -0
  24. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
  25. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
  26. package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  27. package/lib/commonjs/components/Modals/Modal/Modal.js +8 -0
  28. package/lib/commonjs/components/Modals/Modal/Modal.js.map +1 -1
  29. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js +2 -1
  30. package/lib/commonjs/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  31. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js +202 -104
  32. package/lib/commonjs/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  33. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
  34. package/lib/commonjs/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  35. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js +556 -0
  36. package/lib/commonjs/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
  37. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js +210 -0
  38. package/lib/commonjs/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
  39. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
  40. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  41. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js +7 -21
  42. package/lib/commonjs/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  43. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +507 -244
  44. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  45. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +74 -46
  46. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  47. package/lib/commonjs/components/Modals/styledModalComponents.js +9 -2
  48. package/lib/commonjs/components/Modals/styledModalComponents.js.map +1 -1
  49. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +17 -7
  50. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  51. package/lib/commonjs/components/styled/SendInput.js +80 -11
  52. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  53. package/lib/commonjs/components/styled/StyledComponents.js +9 -3
  54. package/lib/commonjs/components/styled/StyledComponents.js.map +1 -1
  55. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
  56. package/lib/commonjs/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  57. package/lib/commonjs/context/xmppProvider.js +23 -38
  58. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  59. package/lib/commonjs/helpers/getChatBackground.js +23 -0
  60. package/lib/commonjs/helpers/getChatBackground.js.map +1 -0
  61. package/lib/commonjs/helpers/mediaLibraryRuntime.js +31 -0
  62. package/lib/commonjs/helpers/mediaLibraryRuntime.js.map +1 -0
  63. package/lib/commonjs/helpers/pickImageAsset.js +68 -0
  64. package/lib/commonjs/helpers/pickImageAsset.js.map +1 -0
  65. package/lib/commonjs/helpers/sheetGestures.js +32 -0
  66. package/lib/commonjs/helpers/sheetGestures.js.map +1 -0
  67. package/lib/commonjs/helpers/updateMessagesTillLast.js +12 -40
  68. package/lib/commonjs/helpers/updateMessagesTillLast.js.map +1 -1
  69. package/lib/commonjs/hooks/useChatRoomFocus.js +3 -9
  70. package/lib/commonjs/hooks/useChatRoomFocus.js.map +1 -1
  71. package/lib/commonjs/hooks/useLogout.js +0 -5
  72. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  73. package/lib/commonjs/hooks/useSendMessage.js +23 -50
  74. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  75. package/lib/commonjs/i18n/strings.js +121 -1
  76. package/lib/commonjs/i18n/strings.js.map +1 -1
  77. package/lib/commonjs/main.js +6 -0
  78. package/lib/commonjs/main.js.map +1 -1
  79. package/lib/commonjs/networking/api-requests/user.api.js +59 -0
  80. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  81. package/lib/commonjs/networking/authRefresh.js +12 -2
  82. package/lib/commonjs/networking/authRefresh.js.map +1 -1
  83. package/lib/commonjs/networking/outboundQueue.js +0 -18
  84. package/lib/commonjs/networking/outboundQueue.js.map +1 -1
  85. package/lib/commonjs/networking/stanzaHandlers.js +1 -10
  86. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  87. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +8 -1
  88. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  89. package/lib/commonjs/networking/xmppClient.js +7 -107
  90. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  91. package/lib/commonjs/roomStore/chatSettingsSlice.js +3 -1
  92. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  93. package/lib/commonjs/roomStore/roomsSlice.js +3 -22
  94. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  95. package/lib/module/assets/icons.js +6 -1
  96. package/lib/module/assets/icons.js.map +1 -1
  97. package/lib/module/components/Header/HeaderRoomList.js +26 -7
  98. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  99. package/lib/module/components/MainComponents/ChatHeader.js +5 -2
  100. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  101. package/lib/module/components/MainComponents/ChatRoom.js +36 -14
  102. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  103. package/lib/module/components/MainComponents/MessageList.js +8 -24
  104. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  105. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js +14 -13
  106. package/lib/module/components/MainComponents/ProfileImagePlaceholder.js.map +1 -1
  107. package/lib/module/components/MainComponents/RoomList.js +207 -35
  108. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  109. package/lib/module/components/Menu/HeaderRoomListMenu.js +319 -101
  110. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  111. package/lib/module/components/Modals/AttachSheet/AttachSheet.js +311 -113
  112. package/lib/module/components/Modals/AttachSheet/AttachSheet.js.map +1 -1
  113. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +555 -217
  114. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  115. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +223 -0
  116. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -0
  117. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +6 -2
  118. package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
  119. package/lib/module/components/Modals/Modal/Modal.js +9 -1
  120. package/lib/module/components/Modals/Modal/Modal.js.map +1 -1
  121. package/lib/module/components/Modals/NewChatModal/ModalContent.js +2 -1
  122. package/lib/module/components/Modals/NewChatModal/ModalContent.js.map +1 -1
  123. package/lib/module/components/Modals/NewChatModal/NewChatModal.js +205 -106
  124. package/lib/module/components/Modals/NewChatModal/NewChatModal.js.map +1 -1
  125. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js +8 -0
  126. package/lib/module/components/Modals/NewChatModal/UpdNewChatModal.js.map +1 -1
  127. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js +548 -0
  128. package/lib/module/components/Modals/ProfileHeader/ProfileHeader.js.map +1 -0
  129. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js +205 -0
  130. package/lib/module/components/Modals/ProfileHeader/ProfileMenu.js.map +1 -0
  131. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +4 -2
  132. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  133. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js +9 -23
  134. package/lib/module/components/Modals/UserProfileModal/EditUserModal.js.map +1 -1
  135. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +509 -248
  136. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  137. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +76 -48
  138. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  139. package/lib/module/components/Modals/styledModalComponents.js +9 -2
  140. package/lib/module/components/Modals/styledModalComponents.js.map +1 -1
  141. package/lib/module/components/RoomComponents/ChatRoomItem.js +17 -7
  142. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  143. package/lib/module/components/styled/SendInput.js +81 -12
  144. package/lib/module/components/styled/SendInput.js.map +1 -1
  145. package/lib/module/components/styled/StyledComponents.js +9 -3
  146. package/lib/module/components/styled/StyledComponents.js.map +1 -1
  147. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js +11 -4
  148. package/lib/module/components/styled/StyledInputComponents/StyledInputComponents.js.map +1 -1
  149. package/lib/module/context/xmppProvider.js +23 -38
  150. package/lib/module/context/xmppProvider.js.map +1 -1
  151. package/lib/module/helpers/getChatBackground.js +18 -0
  152. package/lib/module/helpers/getChatBackground.js.map +1 -0
  153. package/lib/module/helpers/mediaLibraryRuntime.js +25 -0
  154. package/lib/module/helpers/mediaLibraryRuntime.js.map +1 -0
  155. package/lib/module/helpers/pickImageAsset.js +63 -0
  156. package/lib/module/helpers/pickImageAsset.js.map +1 -0
  157. package/lib/module/helpers/sheetGestures.js +26 -0
  158. package/lib/module/helpers/sheetGestures.js.map +1 -0
  159. package/lib/module/helpers/updateMessagesTillLast.js +13 -41
  160. package/lib/module/helpers/updateMessagesTillLast.js.map +1 -1
  161. package/lib/module/hooks/useChatRoomFocus.js +3 -9
  162. package/lib/module/hooks/useChatRoomFocus.js.map +1 -1
  163. package/lib/module/hooks/useLogout.js +0 -5
  164. package/lib/module/hooks/useLogout.js.map +1 -1
  165. package/lib/module/hooks/useSendMessage.js +24 -51
  166. package/lib/module/hooks/useSendMessage.js.map +1 -1
  167. package/lib/module/i18n/strings.js +121 -1
  168. package/lib/module/i18n/strings.js.map +1 -1
  169. package/lib/module/main.js +1 -1
  170. package/lib/module/main.js.map +1 -1
  171. package/lib/module/networking/api-requests/user.api.js +56 -0
  172. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  173. package/lib/module/networking/authRefresh.js +12 -2
  174. package/lib/module/networking/authRefresh.js.map +1 -1
  175. package/lib/module/networking/outboundQueue.js +0 -17
  176. package/lib/module/networking/outboundQueue.js.map +1 -1
  177. package/lib/module/networking/stanzaHandlers.js +1 -10
  178. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  179. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +8 -1
  180. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  181. package/lib/module/networking/xmppClient.js +7 -107
  182. package/lib/module/networking/xmppClient.js.map +1 -1
  183. package/lib/module/roomStore/chatSettingsSlice.js +3 -1
  184. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  185. package/lib/module/roomStore/roomsSlice.js +2 -20
  186. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  187. package/lib/typescript/assets/icons.d.ts +16 -0
  188. package/lib/typescript/assets/icons.d.ts.map +1 -1
  189. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  190. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  191. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  192. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  193. package/lib/typescript/components/MainComponents/ProfileImagePlaceholder.d.ts.map +1 -1
  194. package/lib/typescript/components/MainComponents/RoomList.d.ts +7 -0
  195. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  196. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts +3 -0
  197. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  198. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts +9 -0
  199. package/lib/typescript/components/Modals/AttachSheet/AttachSheet.d.ts.map +1 -1
  200. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +10 -0
  201. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  202. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts +9 -0
  203. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -0
  204. package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
  205. package/lib/typescript/components/Modals/Modal/Modal.d.ts.map +1 -1
  206. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts +4 -2
  207. package/lib/typescript/components/Modals/NewChatModal/ModalContent.d.ts.map +1 -1
  208. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts +1 -1
  209. package/lib/typescript/components/Modals/NewChatModal/NewChatModal.d.ts.map +1 -1
  210. package/lib/typescript/components/Modals/NewChatModal/UpdNewChatModal.d.ts.map +1 -1
  211. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts +75 -0
  212. package/lib/typescript/components/Modals/ProfileHeader/ProfileHeader.d.ts.map +1 -0
  213. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts +25 -0
  214. package/lib/typescript/components/Modals/ProfileHeader/ProfileMenu.d.ts.map +1 -0
  215. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts +6 -1
  216. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  217. package/lib/typescript/components/Modals/UserProfileModal/EditUserModal.d.ts.map +1 -1
  218. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts +16 -0
  219. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  220. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts +1 -0
  221. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  222. package/lib/typescript/components/Modals/styledModalComponents.d.ts.map +1 -1
  223. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  224. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  225. package/lib/typescript/components/styled/StyledComponents.d.ts.map +1 -1
  226. package/lib/typescript/components/styled/StyledInputComponents/StyledInputComponents.d.ts.map +1 -1
  227. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  228. package/lib/typescript/helpers/getChatBackground.d.ts +15 -0
  229. package/lib/typescript/helpers/getChatBackground.d.ts.map +1 -0
  230. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts +3 -0
  231. package/lib/typescript/helpers/mediaLibraryRuntime.d.ts.map +1 -0
  232. package/lib/typescript/helpers/pickImageAsset.d.ts +27 -0
  233. package/lib/typescript/helpers/pickImageAsset.d.ts.map +1 -0
  234. package/lib/typescript/helpers/sheetGestures.d.ts +20 -0
  235. package/lib/typescript/helpers/sheetGestures.d.ts.map +1 -0
  236. package/lib/typescript/helpers/updateMessagesTillLast.d.ts.map +1 -1
  237. package/lib/typescript/hooks/useChatRoomFocus.d.ts.map +1 -1
  238. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  239. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  240. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  241. package/lib/typescript/main.d.ts +1 -1
  242. package/lib/typescript/main.d.ts.map +1 -1
  243. package/lib/typescript/networking/api-requests/user.api.d.ts +27 -0
  244. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  245. package/lib/typescript/networking/authRefresh.d.ts +4 -1
  246. package/lib/typescript/networking/authRefresh.d.ts.map +1 -1
  247. package/lib/typescript/networking/outboundQueue.d.ts +0 -16
  248. package/lib/typescript/networking/outboundQueue.d.ts.map +1 -1
  249. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  250. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  251. package/lib/typescript/networking/xmppClient.d.ts +1 -33
  252. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  253. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  254. package/lib/typescript/roomStore/roomsSlice.d.ts +1 -18
  255. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  256. package/lib/typescript/types/models/room.model.d.ts +0 -15
  257. package/lib/typescript/types/models/room.model.d.ts.map +1 -1
  258. package/lib/typescript/types/types.d.ts +30 -20
  259. package/lib/typescript/types/types.d.ts.map +1 -1
  260. package/package.json +6 -1
  261. package/src/assets/icons.tsx +48 -9
  262. package/src/components/Header/HeaderRoomList.tsx +24 -6
  263. package/src/components/MainComponents/ChatHeader.tsx +5 -2
  264. package/src/components/MainComponents/ChatRoom.tsx +38 -20
  265. package/src/components/MainComponents/MessageList.tsx +8 -24
  266. package/src/components/MainComponents/ProfileImagePlaceholder.tsx +21 -14
  267. package/src/components/MainComponents/RoomList.tsx +236 -39
  268. package/src/components/Menu/HeaderRoomListMenu.tsx +328 -75
  269. package/src/components/Modals/AttachSheet/AttachSheet.tsx +331 -97
  270. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +598 -279
  271. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +244 -0
  272. package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +4 -2
  273. package/src/components/Modals/Modal/Modal.tsx +7 -0
  274. package/src/components/Modals/NewChatModal/ModalContent.tsx +6 -3
  275. package/src/components/Modals/NewChatModal/NewChatModal.tsx +219 -117
  276. package/src/components/Modals/NewChatModal/UpdNewChatModal.tsx +12 -1
  277. package/src/components/Modals/ProfileHeader/ProfileHeader.tsx +615 -0
  278. package/src/components/Modals/ProfileHeader/ProfileMenu.tsx +217 -0
  279. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +14 -4
  280. package/src/components/Modals/UserProfileModal/EditUserModal.tsx +9 -25
  281. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +617 -307
  282. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +75 -58
  283. package/src/components/Modals/styledModalComponents.tsx +9 -2
  284. package/src/components/RoomComponents/ChatRoomItem.tsx +14 -7
  285. package/src/components/styled/SendInput.tsx +83 -12
  286. package/src/components/styled/StyledComponents.ts +9 -3
  287. package/src/components/styled/StyledInputComponents/StyledInputComponents.tsx +11 -4
  288. package/src/context/xmppProvider.tsx +27 -46
  289. package/src/helpers/getChatBackground.ts +18 -0
  290. package/src/helpers/mediaLibraryRuntime.ts +25 -0
  291. package/src/helpers/pickImageAsset.ts +68 -0
  292. package/src/helpers/sheetGestures.ts +25 -0
  293. package/src/helpers/updateMessagesTillLast.tsx +17 -42
  294. package/src/hooks/useChatRoomFocus.ts +3 -11
  295. package/src/hooks/useLogout.tsx +0 -7
  296. package/src/hooks/useSendMessage.tsx +24 -60
  297. package/src/i18n/strings.ts +121 -1
  298. package/src/main.ts +1 -1
  299. package/src/networking/api-requests/user.api.ts +71 -0
  300. package/src/networking/authRefresh.ts +25 -4
  301. package/src/networking/outboundQueue.ts +0 -29
  302. package/src/networking/stanzaHandlers.ts +1 -9
  303. package/src/networking/xmpp/presenceInRoom.xmpp.ts +6 -1
  304. package/src/networking/xmppClient.ts +7 -118
  305. package/src/roomStore/chatSettingsSlice.ts +3 -1
  306. package/src/roomStore/roomsSlice.ts +2 -20
  307. package/src/types/models/room.model.ts +0 -15
  308. package/src/types/types.ts +32 -20
@@ -0,0 +1,68 @@
1
+ import { Alert, Linking } from 'react-native';
2
+ import * as ImagePicker from 'expo-image-picker';
3
+
4
+ /**
5
+ * A picked image in the shape React Native's FormData understands.
6
+ *
7
+ * NOT a web `File`: RN streams a multipart part straight from a `file://`
8
+ * uri and has no usable Blob/File/atob path. Screens ported from the web
9
+ * client used to carry base64 -> Blob -> File helpers that could never
10
+ * have run here.
11
+ */
12
+ export interface PickedImage {
13
+ uri: string;
14
+ type: string;
15
+ name: string;
16
+ }
17
+
18
+ /**
19
+ * Ask for library permission, open the picker, and normalise the result.
20
+ *
21
+ * Returns `null` for every non-error outcome — permission refused, user
22
+ * cancelled — so call sites can simply keep their current value.
23
+ *
24
+ * Exists because the avatar pickers are wired to `onPress`, which hands
25
+ * the callback a SyntheticEvent. Storing that event as "the image" (what
26
+ * two screens used to do) rendered a pooled event as an <Image source>
27
+ * and then crashed with "Property is not configurable" when React tried
28
+ * to release it — on top of never letting the user pick anything.
29
+ */
30
+ export const pickImageAsset = async (): Promise<PickedImage | null> => {
31
+ try {
32
+ // expo-image-picker owns the permission prompt internally and
33
+ // returns a `granted` flag.
34
+ const perm = await ImagePicker.requestMediaLibraryPermissionsAsync();
35
+ if (!perm.granted) {
36
+ Alert.alert(
37
+ 'Permission required',
38
+ 'Photo library permission is needed to select images.',
39
+ [
40
+ { text: 'Cancel', style: 'cancel' },
41
+ { text: 'Open Settings', onPress: () => Linking.openSettings() },
42
+ ]
43
+ );
44
+ return null;
45
+ }
46
+
47
+ const result = await ImagePicker.launchImageLibraryAsync({
48
+ mediaTypes: ['images'],
49
+ allowsEditing: true,
50
+ aspect: [1, 1],
51
+ quality: 0.8,
52
+ });
53
+ if (result.canceled || !result.assets?.[0]) {
54
+ return null;
55
+ }
56
+
57
+ const asset = result.assets[0];
58
+ const originalName = asset.fileName || asset.uri.split('/').pop();
59
+ return {
60
+ uri: asset.uri,
61
+ type: asset.mimeType || 'image/jpeg',
62
+ name: originalName || `image_${Date.now()}.jpg`,
63
+ };
64
+ } catch (error) {
65
+ console.error('Failed to pick an image:', error);
66
+ return null;
67
+ }
68
+ };
@@ -0,0 +1,25 @@
1
+ /** @format */
2
+
3
+ /**
4
+ * Shared thresholds for the drag-to-dismiss gesture on bottom sheets (the
5
+ * attach sheet, the profile headers, the room-list menu). Kept in one
6
+ * place so a pull feels identical wherever the user does it — and so the
7
+ * numbers are unit-testable without a touch event.
8
+ */
9
+
10
+ /** Drag past this many points and letting go dismisses the sheet. */
11
+ export const DISMISS_DISTANCE = 90;
12
+ /** …or flick faster than this, however short the drag. */
13
+ export const DISMISS_VELOCITY = 0.8;
14
+
15
+ /**
16
+ * Claim a drag only once it is clearly a downward pull, so a tap on a row
17
+ * still registers and a horizontal swipe stays with whatever scrolls
18
+ * sideways inside the sheet.
19
+ */
20
+ export const shouldClaimVerticalDrag = (dy: number, dx: number) =>
21
+ dy > 6 && Math.abs(dy) > Math.abs(dx) * 1.5;
22
+
23
+ /** Far enough / fast enough to let go of the sheet. */
24
+ export const shouldDismissOnDrag = (dy: number, vy: number) =>
25
+ dy > DISMISS_DISTANCE || vy > DISMISS_VELOCITY;
@@ -1,6 +1,6 @@
1
1
  import XmppClient from '../networking/xmppClient';
2
2
  import { store } from '../roomStore';
3
- import { applyRoomsPreloadBatch } from '../roomStore/roomsSlice';
3
+ import { setRoomMessages } from '../roomStore/roomsSlice';
4
4
  import { IMessage, IRoom } from '../types/types';
5
5
  import { checkUniqueUsers } from './checkUniqueUsers';
6
6
 
@@ -76,47 +76,22 @@ export const updateMessagesTillLast = async (
76
76
  Number(message.id) === Number(lastCachedMessagesTimeStamp)
77
77
  );
78
78
 
79
- }
80
-
81
- // Publish whatever the catch-up actually retrieved.
82
- //
83
- // This used to sit INSIDE the loop behind
84
- // `!isMessageFound && !(counter <= maxFetchAttempts - 1)`,
85
- // i.e. it only ran when the walk-back gave up. In the common
86
- // case — the gap is small and the anchor is found on the first
87
- // fetch — `isMessageFound` flips true immediately and NOTHING
88
- // was ever dispatched, so the reconnect catch-up silently
89
- // dropped its own result. The messages still appeared, but only
90
- // as a side effect of the always-on `onMessageHistory` stanza
91
- // handler, which parses the same stanza a different way
92
- // (positional form, no explicit `user` object) and inserts via
93
- // addRoomMessage. That copy could carry a wrong sender identity
94
- // and, being treated as an own-message, was excluded from the
95
- // unread count — the "wrong sender + no unread after reconnect,
96
- // both correct after restart" symptom, because only a fresh
97
- // start re-runs the preload scheduler that overwrites it.
98
- //
99
- // Dispatching through `applyRoomsPreloadBatch` (rather than the
100
- // previous `setRoomMessages` array-replace) reuses
101
- // mergeHistoryIntoCache: it dedupes by id with "fetched wins",
102
- // preserves locally-pending sends and older cached history, and
103
- // is already a trigger for the unread middleware — exactly what
104
- // the startup path does, so reconnect and cold start now agree.
105
- // Customer-reported #32.
106
- if (currentJidNewMessages.length > 0) {
107
- // Fire-and-forget — checkUniqueUsers resolves to an
108
- // updated RoomMember list, but there's no slice
109
- // action wired to receive it on RN yet (the web SDK
110
- // has one; the port left a TODO). Keep the call so
111
- // the API request goes out (it warms the cache for
112
- // later renders) but stop short of dispatching.
113
- await checkUniqueUsers(currentJidNewMessages);
114
-
115
- store.dispatch(
116
- applyRoomsPreloadBatch({
117
- rooms: [{ jid, messages: currentJidNewMessages }],
118
- })
119
- );
79
+ if (!isMessageFound && !(counter <= maxFetchAttempts - 1)) {
80
+ // Fire-and-forget — checkUniqueUsers resolves to an
81
+ // updated RoomMember list, but there's no slice
82
+ // action wired to receive it on RN yet (the web SDK
83
+ // has one; the port left a TODO). Keep the call so
84
+ // the API request goes out (it warms the cache for
85
+ // later renders) but stop short of dispatching.
86
+ await checkUniqueUsers(currentJidNewMessages);
87
+
88
+ store.dispatch(
89
+ setRoomMessages({
90
+ roomJID: jid,
91
+ messages: currentJidNewMessages,
92
+ })
93
+ );
94
+ }
120
95
  }
121
96
  } catch (error) {
122
97
  console.error(`Error processing room ${jid}:`, error);
@@ -59,20 +59,12 @@ export const useChatRoomFocus = ({
59
59
  });
60
60
 
61
61
  const leaveRoom = (jid: string) => {
62
- const rooms = store.getState().rooms?.rooms;
63
- // Only mark read as far as the user actually scrolled. Blindly
64
- // stamping `Date.now()` here clears messages they never reached, and
65
- // the server flush below makes that permanent across a restart.
66
- // Customer-reported #33.
67
- const boundaryTs = rooms?.[jid]?.readBoundaryTs ?? null;
68
- const timestamp = boundaryTs ?? Date.now();
62
+ const timestamp = Date.now();
69
63
  dispatch(setLastViewedTimestamp({ chatJID: jid, timestamp }));
70
64
  dispatch(clearVisibleRoom());
65
+ const rooms = store.getState().rooms?.rooms;
71
66
  (store.getState().chatSettingStore as any)?.client
72
- ?.flushLastViewedToPrivateStoreStanza(rooms, {
73
- visibleRoomJID: jid,
74
- visibleRoomTs: boundaryTs,
75
- })
67
+ ?.flushLastViewedToPrivateStoreStanza(rooms, { visibleRoomJID: jid })
76
68
  .catch(() => {});
77
69
  };
78
70
 
@@ -63,13 +63,6 @@ const logoutService = {
63
63
  await Promise.race([
64
64
  client.flushLastViewedToPrivateStoreStanza(rooms, {
65
65
  visibleRoomJID,
66
- // `onlyIfNoUnread` deliberately exempts the visible room, so
67
- // without this the open-but-scrolled-up room would still be
68
- // stamped "read up to now" on logout and come back read on
69
- // the next login. Customer-reported #33.
70
- visibleRoomTs: visibleRoomJID
71
- ? rooms?.[visibleRoomJID]?.readBoundaryTs ?? null
72
- : null,
73
66
  onlyIfNoUnread: true,
74
67
  }),
75
68
  new Promise((res) => setTimeout(res, 2000)),
@@ -10,11 +10,7 @@ import {
10
10
  markMessageFailed,
11
11
  } from '../roomStore/roomHeapSlice';
12
12
  import { uploadFileV2 } from '../networking/api-requests/auth.api';
13
- import {
14
- enqueueOutboundSend,
15
- markOutboundSentLive,
16
- removeOutboundSend,
17
- } from '../networking/outboundQueue';
13
+ import { enqueueOutboundSend, removeOutboundSend } from '../networking/outboundQueue';
18
14
  import { RootState, store } from '../roomStore';
19
15
  import { getGlobalXmppClient } from '../utils/clientRegistry';
20
16
  import { useEventHandlers } from './useEventHandlers';
@@ -308,36 +304,15 @@ export const useSendMessage = (_configOverride?: IConfig) => {
308
304
  }
309
305
 
310
306
  replaySend(effectiveClient);
311
- // The stanza is on the wire from here on. Mark the buffered copy
312
- // so a later reconnect flush won't blind-replay it — see
313
- // markOutboundSentLive / flushOutboundSends. Customer-reported #31.
314
- markOutboundSentLive(optimisticId);
315
307
  try {
316
- // Throttled + config-gated: a burst of sends starts at most one
317
- // probe, and a single missed probe no longer tears the stream
318
- // down. See ensureStreamAliveAfterSend / ensureStreamAlive.
319
- effectiveClient.ensureStreamAliveAfterSend?.();
308
+ effectiveClient.ensureStreamAlive?.();
320
309
  } catch {}
321
- // Post-send notification ONLY. Deliberately outside the try below:
322
- // `handleMessageSent` re-throws whatever the host app's
323
- // `eventHandlers.onMessageSent` callback throws, and this runs
324
- // AFTER the stanza was already delivered — letting that reach the
325
- // catch marked a delivered message "Failed → tap to retry" purely
326
- // because a consumer's analytics/webhook hook was slow or errored.
327
- // Customer-reported #31 ("delivered but shows as failed").
328
- try {
329
- await handleMessageSent({
330
- message,
331
- roomJID: activeRoomJID,
332
- user,
333
- messageType: 'text',
334
- });
335
- } catch (notifyError) {
336
- console.warn(
337
- 'onMessageSent handler threw after a successful send; not failing the message',
338
- notifyError
339
- );
340
- }
310
+ await handleMessageSent({
311
+ message,
312
+ roomJID: activeRoomJID,
313
+ user,
314
+ messageType: 'text',
315
+ });
341
316
  } catch (error) {
342
317
  clearTimeout(watchdogTimer);
343
318
  // Same reasoning as the watchdog: once the bubble shows failed,
@@ -605,7 +580,7 @@ export const useSendMessage = (_configOverride?: IConfig) => {
605
580
  id
606
581
  );
607
582
  try {
608
- effectiveMediaClient.ensureStreamAliveAfterSend?.();
583
+ effectiveMediaClient.ensureStreamAlive?.();
609
584
  } catch {}
610
585
  } else {
611
586
  const anyMediaClient: any =
@@ -628,32 +603,21 @@ export const useSendMessage = (_configOverride?: IConfig) => {
628
603
  }
629
604
  }
630
605
 
631
- // Post-send notification ONLY — see the text path: the upload and
632
- // stanza send have already succeeded here, so a throw from the
633
- // host's `onMessageSent` callback must not flip this to "Failed".
634
- // Customer-reported #31.
635
- try {
636
- await handleMessageSent({
637
- message: 'media',
638
- roomJID: activeRoomJID,
639
- user,
640
- messageType: 'media',
641
- metadata: {
642
- isReply,
643
- isChecked,
644
- mainMessage,
645
- fileData: data,
646
- fileType: type,
647
- messageId: id,
648
- uploadResults: response.data.results,
649
- },
650
- });
651
- } catch (notifyError) {
652
- console.warn(
653
- 'onMessageSent handler threw after a successful media send; not failing the message',
654
- notifyError
655
- );
656
- }
606
+ await handleMessageSent({
607
+ message: 'media',
608
+ roomJID: activeRoomJID,
609
+ user,
610
+ messageType: 'media',
611
+ metadata: {
612
+ isReply,
613
+ isChecked,
614
+ mainMessage,
615
+ fileData: data,
616
+ fileType: type,
617
+ messageId: id,
618
+ uploadResults: response.data.results,
619
+ },
620
+ });
657
621
  } catch (error: any) {
658
622
  // Upload (or stanza send) threw an explicit error. Clear the
659
623
  // watchdog so it doesn't double-fire `markMessageFailed`.