@ethora/chat-component-rn 26.9.1 → 26.10.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 (816) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +19 -0
  3. package/lib/commonjs/assets/icons.js +2 -2
  4. package/lib/commonjs/assets/icons.js.map +1 -1
  5. package/lib/commonjs/components/Header/HeaderRoomList.js +22 -6
  6. package/lib/commonjs/components/Header/HeaderRoomList.js.map +1 -1
  7. package/lib/commonjs/components/InputComponents/Search.js +38 -1
  8. package/lib/commonjs/components/InputComponents/Search.js.map +1 -1
  9. package/lib/commonjs/components/MainComponents/ArchivedMessageCard.js +166 -0
  10. package/lib/commonjs/components/MainComponents/ArchivedMessageCard.js.map +1 -0
  11. package/lib/commonjs/components/MainComponents/ChatHeader.js +22 -5
  12. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  13. package/lib/commonjs/components/MainComponents/ChatRoom.js +56 -25
  14. package/lib/commonjs/components/MainComponents/ChatRoom.js.map +1 -1
  15. package/lib/commonjs/components/MainComponents/ChatWrapper.js +31 -1
  16. package/lib/commonjs/components/MainComponents/ChatWrapper.js.map +1 -1
  17. package/lib/commonjs/components/MainComponents/MediaMessage.js +18 -3
  18. package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
  19. package/lib/commonjs/components/MainComponents/MessageList.js +739 -42
  20. package/lib/commonjs/components/MainComponents/MessageList.js.map +1 -1
  21. package/lib/commonjs/components/MainComponents/MessageSearchButton.js +58 -0
  22. package/lib/commonjs/components/MainComponents/MessageSearchButton.js.map +1 -0
  23. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +15 -6
  24. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  25. package/lib/commonjs/components/MainComponents/RoomList.js +110 -1
  26. package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
  27. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js +14 -3
  28. package/lib/commonjs/components/Menu/HeaderRoomListMenu.js.map +1 -1
  29. package/lib/commonjs/components/MessageBubble/BubbleHighlight.js +112 -0
  30. package/lib/commonjs/components/MessageBubble/BubbleHighlight.js.map +1 -0
  31. package/lib/commonjs/components/MessageBubble/Message.js +169 -125
  32. package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
  33. package/lib/commonjs/components/MessageBubble/MessageInteractions.js +98 -78
  34. package/lib/commonjs/components/MessageBubble/MessageInteractions.js.map +1 -1
  35. package/lib/commonjs/components/MessageBubble/messageMenuLayout.js +50 -0
  36. package/lib/commonjs/components/MessageBubble/messageMenuLayout.js.map +1 -0
  37. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +73 -37
  38. package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  39. package/lib/commonjs/components/Modals/MessageSearchModal/MessageHitResults.js +253 -0
  40. package/lib/commonjs/components/Modals/MessageSearchModal/MessageHitResults.js.map +1 -0
  41. package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js +488 -0
  42. package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -0
  43. package/lib/commonjs/components/Modals/MessageSearchModal/openHit.js +51 -0
  44. package/lib/commonjs/components/Modals/MessageSearchModal/openHit.js.map +1 -0
  45. package/lib/commonjs/components/Modals/MessageSearchModal/resolveSender.js +47 -0
  46. package/lib/commonjs/components/Modals/MessageSearchModal/resolveSender.js.map +1 -0
  47. package/lib/commonjs/components/Modals/MessageSearchModal/searchFilters.js +83 -0
  48. package/lib/commonjs/components/Modals/MessageSearchModal/searchFilters.js.map +1 -0
  49. package/lib/commonjs/components/Modals/MessageSearchModal/snippet.js +61 -0
  50. package/lib/commonjs/components/Modals/MessageSearchModal/snippet.js.map +1 -0
  51. package/lib/commonjs/components/Modals/MessageSearchModal/useMessageSearch.js +136 -0
  52. package/lib/commonjs/components/Modals/MessageSearchModal/useMessageSearch.js.map +1 -0
  53. package/lib/commonjs/components/Modals/PublicChatsModal/PublicChatsModal.js +306 -0
  54. package/lib/commonjs/components/Modals/PublicChatsModal/PublicChatsModal.js.map +1 -0
  55. package/lib/commonjs/components/Modals/PublicChatsModal/publicChatsLogic.js +36 -0
  56. package/lib/commonjs/components/Modals/PublicChatsModal/publicChatsLogic.js.map +1 -0
  57. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -1
  58. package/lib/commonjs/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  59. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +14 -12
  60. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  61. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +41 -39
  62. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  63. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +137 -50
  64. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  65. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +15 -13
  66. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  67. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +57 -55
  68. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  69. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +15 -1
  70. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  71. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +61 -59
  72. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  73. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +8 -3
  74. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  75. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js +13 -2
  76. package/lib/commonjs/components/RoomComponents/ChatRoomItem.js.map +1 -1
  77. package/lib/commonjs/components/RoomComponents/SwipeableRoomRow.js +38 -6
  78. package/lib/commonjs/components/RoomComponents/SwipeableRoomRow.js.map +1 -1
  79. package/lib/commonjs/components/Thread/ThreadHeader.js +3 -1
  80. package/lib/commonjs/components/Thread/ThreadHeader.js.map +1 -1
  81. package/lib/commonjs/components/Thread/ThreadWrapper.js +90 -10
  82. package/lib/commonjs/components/Thread/ThreadWrapper.js.map +1 -1
  83. package/lib/commonjs/components/styled/AudioDecoderHost.js +338 -0
  84. package/lib/commonjs/components/styled/AudioDecoderHost.js.map +1 -0
  85. package/lib/commonjs/components/styled/AudioMessage.js +493 -420
  86. package/lib/commonjs/components/styled/AudioMessage.js.map +1 -1
  87. package/lib/commonjs/components/styled/SendInput.js +31 -5
  88. package/lib/commonjs/components/styled/SendInput.js.map +1 -1
  89. package/lib/commonjs/context/MessageNotificationContext.js +14 -4
  90. package/lib/commonjs/context/MessageNotificationContext.js.map +1 -1
  91. package/lib/commonjs/context/xmppProvider.js +41 -77
  92. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  93. package/lib/commonjs/helpers/audioWaveform.js +165 -0
  94. package/lib/commonjs/helpers/audioWaveform.js.map +1 -0
  95. package/lib/commonjs/helpers/backgroundJoinSweep.js +36 -0
  96. package/lib/commonjs/helpers/backgroundJoinSweep.js.map +1 -0
  97. package/lib/commonjs/helpers/bubbleHighlight.js +44 -0
  98. package/lib/commonjs/helpers/bubbleHighlight.js.map +1 -0
  99. package/lib/commonjs/helpers/checkUniqueUsers.js +14 -12
  100. package/lib/commonjs/helpers/checkUniqueUsers.js.map +1 -1
  101. package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js +5 -1
  102. package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
  103. package/lib/commonjs/helpers/constants/MODAL_TYPES.js +3 -1
  104. package/lib/commonjs/helpers/constants/MODAL_TYPES.js.map +1 -1
  105. package/lib/commonjs/helpers/createRoomFromApi.js +40 -3
  106. package/lib/commonjs/helpers/createRoomFromApi.js.map +1 -1
  107. package/lib/commonjs/helpers/dedupeMembers.js +34 -0
  108. package/lib/commonjs/helpers/dedupeMembers.js.map +1 -0
  109. package/lib/commonjs/helpers/ethoraLogger.js +56 -0
  110. package/lib/commonjs/helpers/ethoraLogger.js.map +1 -0
  111. package/lib/commonjs/helpers/getUnnamedUsers.js +9 -4
  112. package/lib/commonjs/helpers/getUnnamedUsers.js.map +1 -1
  113. package/lib/commonjs/helpers/historyPreloadConfig.js +44 -0
  114. package/lib/commonjs/helpers/historyPreloadConfig.js.map +1 -0
  115. package/lib/commonjs/helpers/historyPreloadScheduler.js +372 -137
  116. package/lib/commonjs/helpers/historyPreloadScheduler.js.map +1 -1
  117. package/lib/commonjs/helpers/initRoomsPresence.js +17 -5
  118. package/lib/commonjs/helpers/initRoomsPresence.js.map +1 -1
  119. package/lib/commonjs/helpers/insertMessageWithDelimiter.js +5 -0
  120. package/lib/commonjs/helpers/insertMessageWithDelimiter.js.map +1 -1
  121. package/lib/commonjs/helpers/isLikelyMucJid.js +67 -0
  122. package/lib/commonjs/helpers/isLikelyMucJid.js.map +1 -0
  123. package/lib/commonjs/helpers/isMessageSearchEnabled.js +18 -0
  124. package/lib/commonjs/helpers/isMessageSearchEnabled.js.map +1 -0
  125. package/lib/commonjs/helpers/joiningRoom.js +14 -0
  126. package/lib/commonjs/helpers/joiningRoom.js.map +1 -0
  127. package/lib/commonjs/helpers/jumpThread.js +100 -0
  128. package/lib/commonjs/helpers/jumpThread.js.map +1 -0
  129. package/lib/commonjs/helpers/jumpToMessage.js +58 -0
  130. package/lib/commonjs/helpers/jumpToMessage.js.map +1 -0
  131. package/lib/commonjs/helpers/jumpWindow.js +187 -0
  132. package/lib/commonjs/helpers/jumpWindow.js.map +1 -0
  133. package/lib/commonjs/helpers/loadRoomHistory.js +75 -0
  134. package/lib/commonjs/helpers/loadRoomHistory.js.map +1 -0
  135. package/lib/commonjs/helpers/notificationPolicy.js +77 -0
  136. package/lib/commonjs/helpers/notificationPolicy.js.map +1 -0
  137. package/lib/commonjs/helpers/openRoomAtMessage.js +47 -0
  138. package/lib/commonjs/helpers/openRoomAtMessage.js.map +1 -0
  139. package/lib/commonjs/helpers/openThreadForJump.js +72 -0
  140. package/lib/commonjs/helpers/openThreadForJump.js.map +1 -0
  141. package/lib/commonjs/helpers/parseMessageReference.js +27 -8
  142. package/lib/commonjs/helpers/parseMessageReference.js.map +1 -1
  143. package/lib/commonjs/helpers/publicChatsEntry.js +17 -0
  144. package/lib/commonjs/helpers/publicChatsEntry.js.map +1 -0
  145. package/lib/commonjs/helpers/roomActivityScore.js +37 -0
  146. package/lib/commonjs/helpers/roomActivityScore.js.map +1 -0
  147. package/lib/commonjs/helpers/roomUserCount.js +36 -0
  148. package/lib/commonjs/helpers/roomUserCount.js.map +1 -0
  149. package/lib/commonjs/helpers/runConfiguredHistoryPreload.js +68 -0
  150. package/lib/commonjs/helpers/runConfiguredHistoryPreload.js.map +1 -0
  151. package/lib/commonjs/helpers/sessionAppId.js +24 -0
  152. package/lib/commonjs/helpers/sessionAppId.js.map +1 -0
  153. package/lib/commonjs/helpers/timestamp.js +43 -0
  154. package/lib/commonjs/helpers/timestamp.js.map +1 -0
  155. package/lib/commonjs/helpers/userResolver.js +517 -0
  156. package/lib/commonjs/helpers/userResolver.js.map +1 -0
  157. package/lib/commonjs/helpers/xmppIdShape.js +52 -0
  158. package/lib/commonjs/helpers/xmppIdShape.js.map +1 -0
  159. package/lib/commonjs/hooks/useChatWrapperInit.js +27 -5
  160. package/lib/commonjs/hooks/useChatWrapperInit.js.map +1 -1
  161. package/lib/commonjs/hooks/useHeapSender.js +54 -3
  162. package/lib/commonjs/hooks/useHeapSender.js.map +1 -1
  163. package/lib/commonjs/hooks/useJumpToMessage.js +411 -0
  164. package/lib/commonjs/hooks/useJumpToMessage.js.map +1 -0
  165. package/lib/commonjs/hooks/useMessageLoaderQueue.js +32 -5
  166. package/lib/commonjs/hooks/useMessageLoaderQueue.js.map +1 -1
  167. package/lib/commonjs/hooks/useMessageQueue.js +13 -5
  168. package/lib/commonjs/hooks/useMessageQueue.js.map +1 -1
  169. package/lib/commonjs/hooks/useRoomDirectory.js +29 -0
  170. package/lib/commonjs/hooks/useRoomDirectory.js.map +1 -0
  171. package/lib/commonjs/hooks/useRoomInitialization.js +27 -5
  172. package/lib/commonjs/hooks/useRoomInitialization.js.map +1 -1
  173. package/lib/commonjs/hooks/useRoomMute.js +62 -0
  174. package/lib/commonjs/hooks/useRoomMute.js.map +1 -0
  175. package/lib/commonjs/hooks/useRoomState.js +3 -1
  176. package/lib/commonjs/hooks/useRoomState.js.map +1 -1
  177. package/lib/commonjs/hooks/useSendMessage.js +13 -3
  178. package/lib/commonjs/hooks/useSendMessage.js.map +1 -1
  179. package/lib/commonjs/i18n/strings.js +312 -6
  180. package/lib/commonjs/i18n/strings.js.map +1 -1
  181. package/lib/commonjs/networking/api-requests/messageSearch.api.js +87 -0
  182. package/lib/commonjs/networking/api-requests/messageSearch.api.js.map +1 -0
  183. package/lib/commonjs/networking/api-requests/publicChats.api.js +48 -0
  184. package/lib/commonjs/networking/api-requests/publicChats.api.js.map +1 -0
  185. package/lib/commonjs/networking/api-requests/roomMembers.api.js +253 -4
  186. package/lib/commonjs/networking/api-requests/roomMembers.api.js.map +1 -1
  187. package/lib/commonjs/networking/api-requests/rooms.api.js +48 -12
  188. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  189. package/lib/commonjs/networking/api-requests/user.api.js +32 -3
  190. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  191. package/lib/commonjs/networking/api-requests/xmppToken.api.js +71 -0
  192. package/lib/commonjs/networking/api-requests/xmppToken.api.js.map +1 -0
  193. package/lib/commonjs/networking/ethoraEvents.js +227 -0
  194. package/lib/commonjs/networking/ethoraEvents.js.map +1 -0
  195. package/lib/commonjs/networking/stanzaHandlers.js +153 -16
  196. package/lib/commonjs/networking/stanzaHandlers.js.map +1 -1
  197. package/lib/commonjs/networking/xmpp/allRoomPresences.xmpp.js +124 -3
  198. package/lib/commonjs/networking/xmpp/allRoomPresences.xmpp.js.map +1 -1
  199. package/lib/commonjs/networking/xmpp/getHistory.xmpp.js +319 -35
  200. package/lib/commonjs/networking/xmpp/getHistory.xmpp.js.map +1 -1
  201. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js +7 -0
  202. package/lib/commonjs/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  203. package/lib/commonjs/networking/xmpp/historyCursor.js +101 -0
  204. package/lib/commonjs/networking/xmpp/historyCursor.js.map +1 -0
  205. package/lib/commonjs/networking/xmpp/mamQueryIds.js +17 -0
  206. package/lib/commonjs/networking/xmpp/mamQueryIds.js.map +1 -0
  207. package/lib/commonjs/networking/xmpp/mamRouter.js +24 -9
  208. package/lib/commonjs/networking/xmpp/mamRouter.js.map +1 -1
  209. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js +70 -65
  210. package/lib/commonjs/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  211. package/lib/commonjs/networking/xmpp/roomJoinSweep.js +389 -0
  212. package/lib/commonjs/networking/xmpp/roomJoinSweep.js.map +1 -0
  213. package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js +0 -1
  214. package/lib/commonjs/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
  215. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js +0 -1
  216. package/lib/commonjs/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  217. package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +0 -1
  218. package/lib/commonjs/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
  219. package/lib/commonjs/networking/xmppClient.js +269 -41
  220. package/lib/commonjs/networking/xmppClient.js.map +1 -1
  221. package/lib/commonjs/networking/xmppCredentials.js +80 -0
  222. package/lib/commonjs/networking/xmppCredentials.js.map +1 -0
  223. package/lib/commonjs/roomStore/Middleware/jumpThreadMiddleware.js +158 -0
  224. package/lib/commonjs/roomStore/Middleware/jumpThreadMiddleware.js.map +1 -0
  225. package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js +6 -0
  226. package/lib/commonjs/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
  227. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js +45 -7
  228. package/lib/commonjs/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  229. package/lib/commonjs/roomStore/chatSettingsSlice.js +21 -1
  230. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  231. package/lib/commonjs/roomStore/index.js +13 -3
  232. package/lib/commonjs/roomStore/index.js.map +1 -1
  233. package/lib/commonjs/roomStore/persistence.js +48 -1
  234. package/lib/commonjs/roomStore/persistence.js.map +1 -1
  235. package/lib/commonjs/roomStore/roomsSlice.js +474 -60
  236. package/lib/commonjs/roomStore/roomsSlice.js.map +1 -1
  237. package/lib/commonjs/roomStore/safeKey.js +44 -0
  238. package/lib/commonjs/roomStore/safeKey.js.map +1 -0
  239. package/lib/commonjs/roomStore/usersSetCap.js +37 -0
  240. package/lib/commonjs/roomStore/usersSetCap.js.map +1 -0
  241. package/lib/commonjs/version.js +1 -1
  242. package/lib/commonjs/version.js.map +1 -1
  243. package/lib/module/assets/icons.js +1 -1
  244. package/lib/module/assets/icons.js.map +1 -1
  245. package/lib/module/components/Header/HeaderRoomList.js +23 -7
  246. package/lib/module/components/Header/HeaderRoomList.js.map +1 -1
  247. package/lib/module/components/InputComponents/Search.js +39 -2
  248. package/lib/module/components/InputComponents/Search.js.map +1 -1
  249. package/lib/module/components/MainComponents/ArchivedMessageCard.js +161 -0
  250. package/lib/module/components/MainComponents/ArchivedMessageCard.js.map +1 -0
  251. package/lib/module/components/MainComponents/ChatHeader.js +22 -5
  252. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  253. package/lib/module/components/MainComponents/ChatRoom.js +57 -26
  254. package/lib/module/components/MainComponents/ChatRoom.js.map +1 -1
  255. package/lib/module/components/MainComponents/ChatWrapper.js +31 -1
  256. package/lib/module/components/MainComponents/ChatWrapper.js.map +1 -1
  257. package/lib/module/components/MainComponents/MediaMessage.js +18 -3
  258. package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
  259. package/lib/module/components/MainComponents/MessageList.js +740 -42
  260. package/lib/module/components/MainComponents/MessageList.js.map +1 -1
  261. package/lib/module/components/MainComponents/MessageSearchButton.js +48 -0
  262. package/lib/module/components/MainComponents/MessageSearchButton.js.map +1 -0
  263. package/lib/module/components/MainComponents/ReduxWrapper.js +15 -7
  264. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  265. package/lib/module/components/MainComponents/RoomList.js +111 -2
  266. package/lib/module/components/MainComponents/RoomList.js.map +1 -1
  267. package/lib/module/components/Menu/HeaderRoomListMenu.js +15 -4
  268. package/lib/module/components/Menu/HeaderRoomListMenu.js.map +1 -1
  269. package/lib/module/components/MessageBubble/BubbleHighlight.js +106 -0
  270. package/lib/module/components/MessageBubble/BubbleHighlight.js.map +1 -0
  271. package/lib/module/components/MessageBubble/Message.js +172 -127
  272. package/lib/module/components/MessageBubble/Message.js.map +1 -1
  273. package/lib/module/components/MessageBubble/MessageInteractions.js +98 -78
  274. package/lib/module/components/MessageBubble/MessageInteractions.js.map +1 -1
  275. package/lib/module/components/MessageBubble/messageMenuLayout.js +45 -0
  276. package/lib/module/components/MessageBubble/messageMenuLayout.js.map +1 -0
  277. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +74 -38
  278. package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
  279. package/lib/module/components/Modals/MessageSearchModal/MessageHitResults.js +243 -0
  280. package/lib/module/components/Modals/MessageSearchModal/MessageHitResults.js.map +1 -0
  281. package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js +482 -0
  282. package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -0
  283. package/lib/module/components/Modals/MessageSearchModal/openHit.js +45 -0
  284. package/lib/module/components/Modals/MessageSearchModal/openHit.js.map +1 -0
  285. package/lib/module/components/Modals/MessageSearchModal/resolveSender.js +41 -0
  286. package/lib/module/components/Modals/MessageSearchModal/resolveSender.js.map +1 -0
  287. package/lib/module/components/Modals/MessageSearchModal/searchFilters.js +74 -0
  288. package/lib/module/components/Modals/MessageSearchModal/searchFilters.js.map +1 -0
  289. package/lib/module/components/Modals/MessageSearchModal/snippet.js +57 -0
  290. package/lib/module/components/Modals/MessageSearchModal/snippet.js.map +1 -0
  291. package/lib/module/components/Modals/MessageSearchModal/useMessageSearch.js +131 -0
  292. package/lib/module/components/Modals/MessageSearchModal/useMessageSearch.js.map +1 -0
  293. package/lib/module/components/Modals/PublicChatsModal/PublicChatsModal.js +300 -0
  294. package/lib/module/components/Modals/PublicChatsModal/PublicChatsModal.js.map +1 -0
  295. package/lib/module/components/Modals/PublicChatsModal/publicChatsLogic.js +30 -0
  296. package/lib/module/components/Modals/PublicChatsModal/publicChatsLogic.js.map +1 -0
  297. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js +8 -1
  298. package/lib/module/components/Modals/SelectUsersModal/SelectUsersModal.js.map +1 -1
  299. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +15 -13
  300. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  301. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +42 -40
  302. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  303. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +138 -52
  304. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  305. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +16 -14
  306. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  307. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +58 -56
  308. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  309. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +14 -0
  310. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  311. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +62 -60
  312. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  313. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +9 -4
  314. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  315. package/lib/module/components/RoomComponents/ChatRoomItem.js +14 -3
  316. package/lib/module/components/RoomComponents/ChatRoomItem.js.map +1 -1
  317. package/lib/module/components/RoomComponents/SwipeableRoomRow.js +39 -7
  318. package/lib/module/components/RoomComponents/SwipeableRoomRow.js.map +1 -1
  319. package/lib/module/components/Thread/ThreadHeader.js +3 -1
  320. package/lib/module/components/Thread/ThreadHeader.js.map +1 -1
  321. package/lib/module/components/Thread/ThreadWrapper.js +89 -9
  322. package/lib/module/components/Thread/ThreadWrapper.js.map +1 -1
  323. package/lib/module/components/styled/AudioDecoderHost.js +332 -0
  324. package/lib/module/components/styled/AudioDecoderHost.js.map +1 -0
  325. package/lib/module/components/styled/AudioMessage.js +495 -422
  326. package/lib/module/components/styled/AudioMessage.js.map +1 -1
  327. package/lib/module/components/styled/SendInput.js +32 -6
  328. package/lib/module/components/styled/SendInput.js.map +1 -1
  329. package/lib/module/context/MessageNotificationContext.js +15 -5
  330. package/lib/module/context/MessageNotificationContext.js.map +1 -1
  331. package/lib/module/context/xmppProvider.js +42 -78
  332. package/lib/module/context/xmppProvider.js.map +1 -1
  333. package/lib/module/helpers/audioWaveform.js +153 -0
  334. package/lib/module/helpers/audioWaveform.js.map +1 -0
  335. package/lib/module/helpers/backgroundJoinSweep.js +30 -0
  336. package/lib/module/helpers/backgroundJoinSweep.js.map +1 -0
  337. package/lib/module/helpers/bubbleHighlight.js +38 -0
  338. package/lib/module/helpers/bubbleHighlight.js.map +1 -0
  339. package/lib/module/helpers/checkUniqueUsers.js +15 -13
  340. package/lib/module/helpers/checkUniqueUsers.js.map +1 -1
  341. package/lib/module/helpers/constants/MODAL_COMPONENTS.js +5 -1
  342. package/lib/module/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
  343. package/lib/module/helpers/constants/MODAL_TYPES.js +3 -1
  344. package/lib/module/helpers/constants/MODAL_TYPES.js.map +1 -1
  345. package/lib/module/helpers/createRoomFromApi.js +37 -3
  346. package/lib/module/helpers/createRoomFromApi.js.map +1 -1
  347. package/lib/module/helpers/dedupeMembers.js +28 -0
  348. package/lib/module/helpers/dedupeMembers.js.map +1 -0
  349. package/lib/module/helpers/ethoraLogger.js +52 -0
  350. package/lib/module/helpers/ethoraLogger.js.map +1 -0
  351. package/lib/module/helpers/getUnnamedUsers.js +9 -4
  352. package/lib/module/helpers/getUnnamedUsers.js.map +1 -1
  353. package/lib/module/helpers/historyPreloadConfig.js +39 -0
  354. package/lib/module/helpers/historyPreloadConfig.js.map +1 -0
  355. package/lib/module/helpers/historyPreloadScheduler.js +368 -134
  356. package/lib/module/helpers/historyPreloadScheduler.js.map +1 -1
  357. package/lib/module/helpers/initRoomsPresence.js +18 -5
  358. package/lib/module/helpers/initRoomsPresence.js.map +1 -1
  359. package/lib/module/helpers/insertMessageWithDelimiter.js +5 -0
  360. package/lib/module/helpers/insertMessageWithDelimiter.js.map +1 -1
  361. package/lib/module/helpers/isLikelyMucJid.js +60 -0
  362. package/lib/module/helpers/isLikelyMucJid.js.map +1 -0
  363. package/lib/module/helpers/isMessageSearchEnabled.js +13 -0
  364. package/lib/module/helpers/isMessageSearchEnabled.js.map +1 -0
  365. package/lib/module/helpers/joiningRoom.js +9 -0
  366. package/lib/module/helpers/joiningRoom.js.map +1 -0
  367. package/lib/module/helpers/jumpThread.js +83 -0
  368. package/lib/module/helpers/jumpThread.js.map +1 -0
  369. package/lib/module/helpers/jumpToMessage.js +52 -0
  370. package/lib/module/helpers/jumpToMessage.js.map +1 -0
  371. package/lib/module/helpers/jumpWindow.js +177 -0
  372. package/lib/module/helpers/jumpWindow.js.map +1 -0
  373. package/lib/module/helpers/loadRoomHistory.js +69 -0
  374. package/lib/module/helpers/loadRoomHistory.js.map +1 -0
  375. package/lib/module/helpers/notificationPolicy.js +70 -0
  376. package/lib/module/helpers/notificationPolicy.js.map +1 -0
  377. package/lib/module/helpers/openRoomAtMessage.js +41 -0
  378. package/lib/module/helpers/openRoomAtMessage.js.map +1 -0
  379. package/lib/module/helpers/openThreadForJump.js +68 -0
  380. package/lib/module/helpers/openThreadForJump.js.map +1 -0
  381. package/lib/module/helpers/parseMessageReference.js +26 -6
  382. package/lib/module/helpers/parseMessageReference.js.map +1 -1
  383. package/lib/module/helpers/publicChatsEntry.js +12 -0
  384. package/lib/module/helpers/publicChatsEntry.js.map +1 -0
  385. package/lib/module/helpers/roomActivityScore.js +30 -0
  386. package/lib/module/helpers/roomActivityScore.js.map +1 -0
  387. package/lib/module/helpers/roomUserCount.js +29 -0
  388. package/lib/module/helpers/roomUserCount.js.map +1 -0
  389. package/lib/module/helpers/runConfiguredHistoryPreload.js +63 -0
  390. package/lib/module/helpers/runConfiguredHistoryPreload.js.map +1 -0
  391. package/lib/module/helpers/sessionAppId.js +20 -0
  392. package/lib/module/helpers/sessionAppId.js.map +1 -0
  393. package/lib/module/helpers/timestamp.js +37 -0
  394. package/lib/module/helpers/timestamp.js.map +1 -0
  395. package/lib/module/helpers/userResolver.js +503 -0
  396. package/lib/module/helpers/userResolver.js.map +1 -0
  397. package/lib/module/helpers/xmppIdShape.js +46 -0
  398. package/lib/module/helpers/xmppIdShape.js.map +1 -0
  399. package/lib/module/hooks/useChatWrapperInit.js +16 -5
  400. package/lib/module/hooks/useChatWrapperInit.js.map +1 -1
  401. package/lib/module/hooks/useHeapSender.js +54 -3
  402. package/lib/module/hooks/useHeapSender.js.map +1 -1
  403. package/lib/module/hooks/useJumpToMessage.js +389 -0
  404. package/lib/module/hooks/useJumpToMessage.js.map +1 -0
  405. package/lib/module/hooks/useMessageLoaderQueue.js +32 -5
  406. package/lib/module/hooks/useMessageLoaderQueue.js.map +1 -1
  407. package/lib/module/hooks/useMessageQueue.js +13 -5
  408. package/lib/module/hooks/useMessageQueue.js.map +1 -1
  409. package/lib/module/hooks/useRoomDirectory.js +24 -0
  410. package/lib/module/hooks/useRoomDirectory.js.map +1 -0
  411. package/lib/module/hooks/useRoomInitialization.js +29 -7
  412. package/lib/module/hooks/useRoomInitialization.js.map +1 -1
  413. package/lib/module/hooks/useRoomMute.js +58 -0
  414. package/lib/module/hooks/useRoomMute.js.map +1 -0
  415. package/lib/module/hooks/useRoomState.js +3 -1
  416. package/lib/module/hooks/useRoomState.js.map +1 -1
  417. package/lib/module/hooks/useSendMessage.js +13 -3
  418. package/lib/module/hooks/useSendMessage.js.map +1 -1
  419. package/lib/module/i18n/strings.js +312 -6
  420. package/lib/module/i18n/strings.js.map +1 -1
  421. package/lib/module/networking/api-requests/messageSearch.api.js +81 -0
  422. package/lib/module/networking/api-requests/messageSearch.api.js.map +1 -0
  423. package/lib/module/networking/api-requests/publicChats.api.js +43 -0
  424. package/lib/module/networking/api-requests/publicChats.api.js.map +1 -0
  425. package/lib/module/networking/api-requests/roomMembers.api.js +248 -4
  426. package/lib/module/networking/api-requests/roomMembers.api.js.map +1 -1
  427. package/lib/module/networking/api-requests/rooms.api.js +48 -12
  428. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  429. package/lib/module/networking/api-requests/user.api.js +31 -3
  430. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  431. package/lib/module/networking/api-requests/xmppToken.api.js +66 -0
  432. package/lib/module/networking/api-requests/xmppToken.api.js.map +1 -0
  433. package/lib/module/networking/ethoraEvents.js +220 -0
  434. package/lib/module/networking/ethoraEvents.js.map +1 -0
  435. package/lib/module/networking/stanzaHandlers.js +155 -18
  436. package/lib/module/networking/stanzaHandlers.js.map +1 -1
  437. package/lib/module/networking/xmpp/allRoomPresences.xmpp.js +125 -3
  438. package/lib/module/networking/xmpp/allRoomPresences.xmpp.js.map +1 -1
  439. package/lib/module/networking/xmpp/getHistory.xmpp.js +318 -35
  440. package/lib/module/networking/xmpp/getHistory.xmpp.js.map +1 -1
  441. package/lib/module/networking/xmpp/handleStanzas.xmpp.js +7 -0
  442. package/lib/module/networking/xmpp/handleStanzas.xmpp.js.map +1 -1
  443. package/lib/module/networking/xmpp/historyCursor.js +95 -0
  444. package/lib/module/networking/xmpp/historyCursor.js.map +1 -0
  445. package/lib/module/networking/xmpp/mamQueryIds.js +12 -0
  446. package/lib/module/networking/xmpp/mamQueryIds.js.map +1 -0
  447. package/lib/module/networking/xmpp/mamRouter.js +22 -8
  448. package/lib/module/networking/xmpp/mamRouter.js.map +1 -1
  449. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js +68 -62
  450. package/lib/module/networking/xmpp/presenceInRoom.xmpp.js.map +1 -1
  451. package/lib/module/networking/xmpp/roomJoinSweep.js +385 -0
  452. package/lib/module/networking/xmpp/roomJoinSweep.js.map +1 -0
  453. package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js +0 -1
  454. package/lib/module/networking/xmpp/sendMediaMessage.xmpp.js.map +1 -1
  455. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js +0 -1
  456. package/lib/module/networking/xmpp/sendTextMessage.xmpp.js.map +1 -1
  457. package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js +0 -1
  458. package/lib/module/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.js.map +1 -1
  459. package/lib/module/networking/xmppClient.js +269 -41
  460. package/lib/module/networking/xmppClient.js.map +1 -1
  461. package/lib/module/networking/xmppCredentials.js +76 -0
  462. package/lib/module/networking/xmppCredentials.js.map +1 -0
  463. package/lib/module/roomStore/Middleware/jumpThreadMiddleware.js +153 -0
  464. package/lib/module/roomStore/Middleware/jumpThreadMiddleware.js.map +1 -0
  465. package/lib/module/roomStore/Middleware/reactionsMiddleware.js +6 -0
  466. package/lib/module/roomStore/Middleware/reactionsMiddleware.js.map +1 -1
  467. package/lib/module/roomStore/Middleware/unreadMidlleware.js +46 -7
  468. package/lib/module/roomStore/Middleware/unreadMidlleware.js.map +1 -1
  469. package/lib/module/roomStore/chatSettingsSlice.js +19 -0
  470. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  471. package/lib/module/roomStore/index.js +7 -3
  472. package/lib/module/roomStore/index.js.map +1 -1
  473. package/lib/module/roomStore/persistence.js +46 -1
  474. package/lib/module/roomStore/persistence.js.map +1 -1
  475. package/lib/module/roomStore/roomsSlice.js +459 -58
  476. package/lib/module/roomStore/roomsSlice.js.map +1 -1
  477. package/lib/module/roomStore/safeKey.js +37 -0
  478. package/lib/module/roomStore/safeKey.js.map +1 -0
  479. package/lib/module/roomStore/usersSetCap.js +32 -0
  480. package/lib/module/roomStore/usersSetCap.js.map +1 -0
  481. package/lib/module/version.js +1 -1
  482. package/lib/module/version.js.map +1 -1
  483. package/lib/typescript/assets/icons.d.ts +4 -0
  484. package/lib/typescript/assets/icons.d.ts.map +1 -1
  485. package/lib/typescript/components/Header/HeaderRoomList.d.ts.map +1 -1
  486. package/lib/typescript/components/InputComponents/Search.d.ts.map +1 -1
  487. package/lib/typescript/components/MainComponents/ArchivedMessageCard.d.ts +12 -0
  488. package/lib/typescript/components/MainComponents/ArchivedMessageCard.d.ts.map +1 -0
  489. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  490. package/lib/typescript/components/MainComponents/ChatRoom.d.ts.map +1 -1
  491. package/lib/typescript/components/MainComponents/ChatWrapper.d.ts.map +1 -1
  492. package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
  493. package/lib/typescript/components/MainComponents/MessageList.d.ts +22 -1
  494. package/lib/typescript/components/MainComponents/MessageList.d.ts.map +1 -1
  495. package/lib/typescript/components/MainComponents/MessageSearchButton.d.ts +7 -0
  496. package/lib/typescript/components/MainComponents/MessageSearchButton.d.ts.map +1 -0
  497. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  498. package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
  499. package/lib/typescript/components/Menu/HeaderRoomListMenu.d.ts.map +1 -1
  500. package/lib/typescript/components/MessageBubble/BubbleHighlight.d.ts +12 -0
  501. package/lib/typescript/components/MessageBubble/BubbleHighlight.d.ts.map +1 -0
  502. package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
  503. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts +5 -0
  504. package/lib/typescript/components/MessageBubble/MessageInteractions.d.ts.map +1 -1
  505. package/lib/typescript/components/MessageBubble/messageMenuLayout.d.ts +29 -0
  506. package/lib/typescript/components/MessageBubble/messageMenuLayout.d.ts.map +1 -0
  507. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts +2 -0
  508. package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
  509. package/lib/typescript/components/Modals/MessageSearchModal/MessageHitResults.d.ts +44 -0
  510. package/lib/typescript/components/Modals/MessageSearchModal/MessageHitResults.d.ts.map +1 -0
  511. package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts +12 -0
  512. package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts.map +1 -0
  513. package/lib/typescript/components/Modals/MessageSearchModal/openHit.d.ts +15 -0
  514. package/lib/typescript/components/Modals/MessageSearchModal/openHit.d.ts.map +1 -0
  515. package/lib/typescript/components/Modals/MessageSearchModal/resolveSender.d.ts +34 -0
  516. package/lib/typescript/components/Modals/MessageSearchModal/resolveSender.d.ts.map +1 -0
  517. package/lib/typescript/components/Modals/MessageSearchModal/searchFilters.d.ts +41 -0
  518. package/lib/typescript/components/Modals/MessageSearchModal/searchFilters.d.ts.map +1 -0
  519. package/lib/typescript/components/Modals/MessageSearchModal/snippet.d.ts +15 -0
  520. package/lib/typescript/components/Modals/MessageSearchModal/snippet.d.ts.map +1 -0
  521. package/lib/typescript/components/Modals/MessageSearchModal/useMessageSearch.d.ts +23 -0
  522. package/lib/typescript/components/Modals/MessageSearchModal/useMessageSearch.d.ts.map +1 -0
  523. package/lib/typescript/components/Modals/PublicChatsModal/PublicChatsModal.d.ts +16 -0
  524. package/lib/typescript/components/Modals/PublicChatsModal/PublicChatsModal.d.ts.map +1 -0
  525. package/lib/typescript/components/Modals/PublicChatsModal/publicChatsLogic.d.ts +14 -0
  526. package/lib/typescript/components/Modals/PublicChatsModal/publicChatsLogic.d.ts.map +1 -0
  527. package/lib/typescript/components/Modals/SelectUsersModal/SelectUsersModal.d.ts.map +1 -1
  528. package/lib/typescript/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts.map +1 -1
  529. package/lib/typescript/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts.map +1 -1
  530. package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
  531. package/lib/typescript/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts.map +1 -1
  532. package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
  533. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +1 -0
  534. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
  535. package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
  536. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  537. package/lib/typescript/components/RoomComponents/ChatRoomItem.d.ts.map +1 -1
  538. package/lib/typescript/components/RoomComponents/SwipeableRoomRow.d.ts +5 -1
  539. package/lib/typescript/components/RoomComponents/SwipeableRoomRow.d.ts.map +1 -1
  540. package/lib/typescript/components/Thread/ThreadHeader.d.ts.map +1 -1
  541. package/lib/typescript/components/Thread/ThreadWrapper.d.ts +1 -0
  542. package/lib/typescript/components/Thread/ThreadWrapper.d.ts.map +1 -1
  543. package/lib/typescript/components/styled/AudioDecoderHost.d.ts +39 -0
  544. package/lib/typescript/components/styled/AudioDecoderHost.d.ts.map +1 -0
  545. package/lib/typescript/components/styled/AudioMessage.d.ts +14 -1
  546. package/lib/typescript/components/styled/AudioMessage.d.ts.map +1 -1
  547. package/lib/typescript/components/styled/SendInput.d.ts.map +1 -1
  548. package/lib/typescript/context/MessageNotificationContext.d.ts.map +1 -1
  549. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  550. package/lib/typescript/helpers/audioWaveform.d.ts +54 -0
  551. package/lib/typescript/helpers/audioWaveform.d.ts.map +1 -0
  552. package/lib/typescript/helpers/backgroundJoinSweep.d.ts +14 -0
  553. package/lib/typescript/helpers/backgroundJoinSweep.d.ts.map +1 -0
  554. package/lib/typescript/helpers/bubbleHighlight.d.ts +17 -0
  555. package/lib/typescript/helpers/bubbleHighlight.d.ts.map +1 -0
  556. package/lib/typescript/helpers/checkUniqueUsers.d.ts +2 -2
  557. package/lib/typescript/helpers/checkUniqueUsers.d.ts.map +1 -1
  558. package/lib/typescript/helpers/constants/MODAL_COMPONENTS.d.ts.map +1 -1
  559. package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts +2 -0
  560. package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts.map +1 -1
  561. package/lib/typescript/helpers/createRoomFromApi.d.ts +25 -0
  562. package/lib/typescript/helpers/createRoomFromApi.d.ts.map +1 -1
  563. package/lib/typescript/helpers/dedupeMembers.d.ts +11 -0
  564. package/lib/typescript/helpers/dedupeMembers.d.ts.map +1 -0
  565. package/lib/typescript/helpers/ethoraLogger.d.ts +13 -0
  566. package/lib/typescript/helpers/ethoraLogger.d.ts.map +1 -0
  567. package/lib/typescript/helpers/getUnnamedUsers.d.ts.map +1 -1
  568. package/lib/typescript/helpers/historyPreloadConfig.d.ts +26 -0
  569. package/lib/typescript/helpers/historyPreloadConfig.d.ts.map +1 -0
  570. package/lib/typescript/helpers/historyPreloadScheduler.d.ts +8 -4
  571. package/lib/typescript/helpers/historyPreloadScheduler.d.ts.map +1 -1
  572. package/lib/typescript/helpers/initRoomsPresence.d.ts +7 -0
  573. package/lib/typescript/helpers/initRoomsPresence.d.ts.map +1 -1
  574. package/lib/typescript/helpers/insertMessageWithDelimiter.d.ts.map +1 -1
  575. package/lib/typescript/helpers/isLikelyMucJid.d.ts +19 -0
  576. package/lib/typescript/helpers/isLikelyMucJid.d.ts.map +1 -0
  577. package/lib/typescript/helpers/isMessageSearchEnabled.d.ts +12 -0
  578. package/lib/typescript/helpers/isMessageSearchEnabled.d.ts.map +1 -0
  579. package/lib/typescript/helpers/joiningRoom.d.ts +7 -0
  580. package/lib/typescript/helpers/joiningRoom.d.ts.map +1 -0
  581. package/lib/typescript/helpers/jumpThread.d.ts +48 -0
  582. package/lib/typescript/helpers/jumpThread.d.ts.map +1 -0
  583. package/lib/typescript/helpers/jumpToMessage.d.ts +26 -0
  584. package/lib/typescript/helpers/jumpToMessage.d.ts.map +1 -0
  585. package/lib/typescript/helpers/jumpWindow.d.ts +74 -0
  586. package/lib/typescript/helpers/jumpWindow.d.ts.map +1 -0
  587. package/lib/typescript/helpers/loadRoomHistory.d.ts +34 -0
  588. package/lib/typescript/helpers/loadRoomHistory.d.ts.map +1 -0
  589. package/lib/typescript/helpers/notificationPolicy.d.ts +42 -0
  590. package/lib/typescript/helpers/notificationPolicy.d.ts.map +1 -0
  591. package/lib/typescript/helpers/openRoomAtMessage.d.ts +17 -0
  592. package/lib/typescript/helpers/openRoomAtMessage.d.ts.map +1 -0
  593. package/lib/typescript/helpers/openThreadForJump.d.ts +27 -0
  594. package/lib/typescript/helpers/openThreadForJump.d.ts.map +1 -0
  595. package/lib/typescript/helpers/parseMessageReference.d.ts +18 -5
  596. package/lib/typescript/helpers/parseMessageReference.d.ts.map +1 -1
  597. package/lib/typescript/helpers/publicChatsEntry.d.ts +11 -0
  598. package/lib/typescript/helpers/publicChatsEntry.d.ts.map +1 -0
  599. package/lib/typescript/helpers/roomActivityScore.d.ts +5 -0
  600. package/lib/typescript/helpers/roomActivityScore.d.ts.map +1 -0
  601. package/lib/typescript/helpers/roomUserCount.d.ts +20 -0
  602. package/lib/typescript/helpers/roomUserCount.d.ts.map +1 -0
  603. package/lib/typescript/helpers/runConfiguredHistoryPreload.d.ts +21 -0
  604. package/lib/typescript/helpers/runConfiguredHistoryPreload.d.ts.map +1 -0
  605. package/lib/typescript/helpers/sessionAppId.d.ts +8 -0
  606. package/lib/typescript/helpers/sessionAppId.d.ts.map +1 -0
  607. package/lib/typescript/helpers/timestamp.d.ts +3 -0
  608. package/lib/typescript/helpers/timestamp.d.ts.map +1 -0
  609. package/lib/typescript/helpers/userResolver.d.ts +58 -0
  610. package/lib/typescript/helpers/userResolver.d.ts.map +1 -0
  611. package/lib/typescript/helpers/xmppIdShape.d.ts +10 -0
  612. package/lib/typescript/helpers/xmppIdShape.d.ts.map +1 -0
  613. package/lib/typescript/hooks/useChatWrapperInit.d.ts +2 -0
  614. package/lib/typescript/hooks/useChatWrapperInit.d.ts.map +1 -1
  615. package/lib/typescript/hooks/useHeapSender.d.ts.map +1 -1
  616. package/lib/typescript/hooks/useJumpToMessage.d.ts +116 -0
  617. package/lib/typescript/hooks/useJumpToMessage.d.ts.map +1 -0
  618. package/lib/typescript/hooks/useMessageLoaderQueue.d.ts.map +1 -1
  619. package/lib/typescript/hooks/useMessageQueue.d.ts.map +1 -1
  620. package/lib/typescript/hooks/useRoomDirectory.d.ts +12 -0
  621. package/lib/typescript/hooks/useRoomDirectory.d.ts.map +1 -0
  622. package/lib/typescript/hooks/useRoomInitialization.d.ts.map +1 -1
  623. package/lib/typescript/hooks/useRoomMute.d.ts +8 -0
  624. package/lib/typescript/hooks/useRoomMute.d.ts.map +1 -0
  625. package/lib/typescript/hooks/useRoomState.d.ts +1 -0
  626. package/lib/typescript/hooks/useRoomState.d.ts.map +1 -1
  627. package/lib/typescript/hooks/useSendMessage.d.ts.map +1 -1
  628. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  629. package/lib/typescript/networking/api-requests/messageSearch.api.d.ts +57 -0
  630. package/lib/typescript/networking/api-requests/messageSearch.api.d.ts.map +1 -0
  631. package/lib/typescript/networking/api-requests/publicChats.api.d.ts +24 -0
  632. package/lib/typescript/networking/api-requests/publicChats.api.d.ts.map +1 -0
  633. package/lib/typescript/networking/api-requests/roomMembers.api.d.ts +19 -1
  634. package/lib/typescript/networking/api-requests/roomMembers.api.d.ts.map +1 -1
  635. package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
  636. package/lib/typescript/networking/api-requests/user.api.d.ts +8 -0
  637. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  638. package/lib/typescript/networking/api-requests/xmppToken.api.d.ts +2 -0
  639. package/lib/typescript/networking/api-requests/xmppToken.api.d.ts.map +1 -0
  640. package/lib/typescript/networking/ethoraEvents.d.ts +45 -0
  641. package/lib/typescript/networking/ethoraEvents.d.ts.map +1 -0
  642. package/lib/typescript/networking/stanzaHandlers.d.ts +1 -1
  643. package/lib/typescript/networking/stanzaHandlers.d.ts.map +1 -1
  644. package/lib/typescript/networking/xmpp/allRoomPresences.xmpp.d.ts +32 -1
  645. package/lib/typescript/networking/xmpp/allRoomPresences.xmpp.d.ts.map +1 -1
  646. package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts +64 -0
  647. package/lib/typescript/networking/xmpp/getHistory.xmpp.d.ts.map +1 -1
  648. package/lib/typescript/networking/xmpp/handleStanzas.xmpp.d.ts.map +1 -1
  649. package/lib/typescript/networking/xmpp/historyCursor.d.ts +35 -0
  650. package/lib/typescript/networking/xmpp/historyCursor.d.ts.map +1 -0
  651. package/lib/typescript/networking/xmpp/mamQueryIds.d.ts +10 -0
  652. package/lib/typescript/networking/xmpp/mamQueryIds.d.ts.map +1 -0
  653. package/lib/typescript/networking/xmpp/mamRouter.d.ts +7 -0
  654. package/lib/typescript/networking/xmpp/mamRouter.d.ts.map +1 -1
  655. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts +13 -2
  656. package/lib/typescript/networking/xmpp/presenceInRoom.xmpp.d.ts.map +1 -1
  657. package/lib/typescript/networking/xmpp/roomJoinSweep.d.ts +82 -0
  658. package/lib/typescript/networking/xmpp/roomJoinSweep.d.ts.map +1 -0
  659. package/lib/typescript/networking/xmpp/sendMediaMessage.xmpp.d.ts.map +1 -1
  660. package/lib/typescript/networking/xmpp/sendTextMessage.xmpp.d.ts.map +1 -1
  661. package/lib/typescript/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts.map +1 -1
  662. package/lib/typescript/networking/xmppClient.d.ts +90 -4
  663. package/lib/typescript/networking/xmppClient.d.ts.map +1 -1
  664. package/lib/typescript/networking/xmppCredentials.d.ts +12 -0
  665. package/lib/typescript/networking/xmppCredentials.d.ts.map +1 -0
  666. package/lib/typescript/roomStore/Middleware/jumpThreadMiddleware.d.ts +3 -0
  667. package/lib/typescript/roomStore/Middleware/jumpThreadMiddleware.d.ts.map +1 -0
  668. package/lib/typescript/roomStore/Middleware/reactionsMiddleware.d.ts.map +1 -1
  669. package/lib/typescript/roomStore/Middleware/unreadMidlleware.d.ts.map +1 -1
  670. package/lib/typescript/roomStore/chatSettingsSlice.d.ts +8 -1
  671. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  672. package/lib/typescript/roomStore/index.d.ts +2 -1
  673. package/lib/typescript/roomStore/index.d.ts.map +1 -1
  674. package/lib/typescript/roomStore/persistence.d.ts +8 -0
  675. package/lib/typescript/roomStore/persistence.d.ts.map +1 -1
  676. package/lib/typescript/roomStore/roomsSlice.d.ts +138 -2
  677. package/lib/typescript/roomStore/roomsSlice.d.ts.map +1 -1
  678. package/lib/typescript/roomStore/safeKey.d.ts +13 -0
  679. package/lib/typescript/roomStore/safeKey.d.ts.map +1 -0
  680. package/lib/typescript/roomStore/usersSetCap.d.ts +16 -0
  681. package/lib/typescript/roomStore/usersSetCap.d.ts.map +1 -0
  682. package/lib/typescript/types/models/media.model.d.ts +2 -0
  683. package/lib/typescript/types/models/media.model.d.ts.map +1 -1
  684. package/lib/typescript/types/models/room.model.d.ts +18 -5
  685. package/lib/typescript/types/models/room.model.d.ts.map +1 -1
  686. package/lib/typescript/types/models/xmpp.model.d.ts +8 -1
  687. package/lib/typescript/types/models/xmpp.model.d.ts.map +1 -1
  688. package/lib/typescript/types/types.d.ts +88 -5
  689. package/lib/typescript/types/types.d.ts.map +1 -1
  690. package/lib/typescript/version.d.ts +1 -1
  691. package/lib/typescript/version.d.ts.map +1 -1
  692. package/package.json +1 -1
  693. package/src/assets/icons.tsx +13 -0
  694. package/src/components/Header/HeaderRoomList.tsx +21 -4
  695. package/src/components/InputComponents/Search.tsx +33 -0
  696. package/src/components/MainComponents/ArchivedMessageCard.tsx +139 -0
  697. package/src/components/MainComponents/ChatHeader.tsx +19 -3
  698. package/src/components/MainComponents/ChatRoom.tsx +60 -23
  699. package/src/components/MainComponents/ChatWrapper.tsx +23 -4
  700. package/src/components/MainComponents/MediaMessage.tsx +17 -0
  701. package/src/components/MainComponents/MessageList.tsx +823 -84
  702. package/src/components/MainComponents/MessageSearchButton.tsx +48 -0
  703. package/src/components/MainComponents/ReduxWrapper.tsx +16 -5
  704. package/src/components/MainComponents/RoomList.tsx +125 -0
  705. package/src/components/Menu/HeaderRoomListMenu.tsx +26 -2
  706. package/src/components/MessageBubble/BubbleHighlight.tsx +106 -0
  707. package/src/components/MessageBubble/Message.tsx +265 -177
  708. package/src/components/MessageBubble/MessageInteractions.tsx +109 -86
  709. package/src/components/MessageBubble/messageMenuLayout.ts +59 -0
  710. package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +92 -21
  711. package/src/components/Modals/MessageSearchModal/MessageHitResults.tsx +271 -0
  712. package/src/components/Modals/MessageSearchModal/MessageSearchModal.tsx +487 -0
  713. package/src/components/Modals/MessageSearchModal/openHit.ts +50 -0
  714. package/src/components/Modals/MessageSearchModal/resolveSender.ts +57 -0
  715. package/src/components/Modals/MessageSearchModal/searchFilters.ts +109 -0
  716. package/src/components/Modals/MessageSearchModal/snippet.ts +58 -0
  717. package/src/components/Modals/MessageSearchModal/useMessageSearch.ts +151 -0
  718. package/src/components/Modals/PublicChatsModal/PublicChatsModal.tsx +288 -0
  719. package/src/components/Modals/PublicChatsModal/publicChatsLogic.ts +36 -0
  720. package/src/components/Modals/SelectUsersModal/SelectUsersModal.tsx +8 -1
  721. package/src/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.tsx +20 -17
  722. package/src/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.tsx +58 -55
  723. package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +156 -62
  724. package/src/components/Modals/SettingsModals/ProfileShares/ProfileShares.tsx +22 -19
  725. package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +48 -45
  726. package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +11 -0
  727. package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +63 -60
  728. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +11 -3
  729. package/src/components/RoomComponents/ChatRoomItem.tsx +16 -3
  730. package/src/components/RoomComponents/SwipeableRoomRow.tsx +39 -6
  731. package/src/components/Thread/ThreadHeader.tsx +3 -1
  732. package/src/components/Thread/ThreadWrapper.tsx +96 -10
  733. package/src/components/styled/AudioDecoderHost.tsx +351 -0
  734. package/src/components/styled/AudioMessage.tsx +482 -425
  735. package/src/components/styled/SendInput.tsx +42 -4
  736. package/src/context/MessageNotificationContext.tsx +19 -5
  737. package/src/context/xmppProvider.tsx +44 -91
  738. package/src/helpers/audioWaveform.ts +142 -0
  739. package/src/helpers/backgroundJoinSweep.ts +35 -0
  740. package/src/helpers/bubbleHighlight.ts +47 -0
  741. package/src/helpers/checkUniqueUsers.tsx +15 -17
  742. package/src/helpers/constants/MODAL_COMPONENTS.tsx +4 -0
  743. package/src/helpers/constants/MODAL_TYPES.ts +3 -0
  744. package/src/helpers/createRoomFromApi.tsx +45 -4
  745. package/src/helpers/dedupeMembers.ts +29 -0
  746. package/src/helpers/ethoraLogger.ts +50 -0
  747. package/src/helpers/getUnnamedUsers.ts +7 -4
  748. package/src/helpers/historyPreloadConfig.ts +68 -0
  749. package/src/helpers/historyPreloadScheduler.ts +437 -199
  750. package/src/helpers/initRoomsPresence.ts +20 -7
  751. package/src/helpers/insertMessageWithDelimiter.ts +3 -0
  752. package/src/helpers/isLikelyMucJid.ts +72 -0
  753. package/src/helpers/isMessageSearchEnabled.ts +18 -0
  754. package/src/helpers/joiningRoom.ts +13 -0
  755. package/src/helpers/jumpThread.ts +102 -0
  756. package/src/helpers/jumpToMessage.ts +57 -0
  757. package/src/helpers/jumpWindow.ts +212 -0
  758. package/src/helpers/loadRoomHistory.ts +83 -0
  759. package/src/helpers/notificationPolicy.ts +82 -0
  760. package/src/helpers/openRoomAtMessage.ts +38 -0
  761. package/src/helpers/openThreadForJump.ts +96 -0
  762. package/src/helpers/parseMessageReference.ts +37 -8
  763. package/src/helpers/publicChatsEntry.ts +15 -0
  764. package/src/helpers/roomActivityScore.ts +45 -0
  765. package/src/helpers/roomUserCount.ts +44 -0
  766. package/src/helpers/runConfiguredHistoryPreload.ts +76 -0
  767. package/src/helpers/sessionAppId.ts +17 -0
  768. package/src/helpers/timestamp.ts +44 -0
  769. package/src/helpers/userResolver.ts +542 -0
  770. package/src/helpers/xmppIdShape.ts +46 -0
  771. package/src/hooks/useChatWrapperInit.ts +22 -4
  772. package/src/hooks/useHeapSender.tsx +54 -3
  773. package/src/hooks/useJumpToMessage.ts +538 -0
  774. package/src/hooks/useMessageLoaderQueue.tsx +40 -4
  775. package/src/hooks/useMessageQueue.ts +9 -5
  776. package/src/hooks/useRoomDirectory.ts +39 -0
  777. package/src/hooks/useRoomInitialization.tsx +33 -7
  778. package/src/hooks/useRoomMute.ts +42 -0
  779. package/src/hooks/useRoomState.tsx +6 -0
  780. package/src/hooks/useSendMessage.tsx +14 -2
  781. package/src/i18n/strings.ts +306 -0
  782. package/src/networking/api-requests/messageSearch.api.ts +130 -0
  783. package/src/networking/api-requests/publicChats.api.ts +71 -0
  784. package/src/networking/api-requests/roomMembers.api.ts +263 -11
  785. package/src/networking/api-requests/rooms.api.ts +52 -12
  786. package/src/networking/api-requests/user.api.ts +28 -2
  787. package/src/networking/api-requests/xmppToken.api.ts +62 -0
  788. package/src/networking/ethoraEvents.ts +262 -0
  789. package/src/networking/stanzaHandlers.ts +145 -19
  790. package/src/networking/xmpp/allRoomPresences.xmpp.ts +155 -5
  791. package/src/networking/xmpp/getHistory.xmpp.ts +433 -47
  792. package/src/networking/xmpp/handleStanzas.xmpp.ts +8 -0
  793. package/src/networking/xmpp/historyCursor.ts +124 -0
  794. package/src/networking/xmpp/mamQueryIds.ts +11 -0
  795. package/src/networking/xmpp/mamRouter.ts +24 -10
  796. package/src/networking/xmpp/presenceInRoom.xmpp.ts +91 -68
  797. package/src/networking/xmpp/roomJoinSweep.ts +412 -0
  798. package/src/networking/xmpp/sendMediaMessage.xmpp.ts +0 -1
  799. package/src/networking/xmpp/sendTextMessage.xmpp.ts +0 -1
  800. package/src/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.ts +0 -1
  801. package/src/networking/xmppClient.ts +323 -47
  802. package/src/networking/xmppCredentials.ts +87 -0
  803. package/src/roomStore/Middleware/jumpThreadMiddleware.ts +163 -0
  804. package/src/roomStore/Middleware/reactionsMiddleware.tsx +4 -0
  805. package/src/roomStore/Middleware/unreadMidlleware.tsx +59 -11
  806. package/src/roomStore/chatSettingsSlice.ts +17 -0
  807. package/src/roomStore/index.ts +10 -3
  808. package/src/roomStore/persistence.ts +54 -0
  809. package/src/roomStore/roomsSlice.ts +547 -65
  810. package/src/roomStore/safeKey.ts +49 -0
  811. package/src/roomStore/usersSetCap.ts +37 -0
  812. package/src/types/models/media.model.ts +4 -0
  813. package/src/types/models/room.model.ts +18 -5
  814. package/src/types/models/xmpp.model.ts +15 -1
  815. package/src/types/types.ts +93 -5
  816. package/src/version.ts +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MILLISECONDS_LOWER_BOUND","MICROSECONDS_UPPER_BOUND","NANOS_UPPER_BOUND","normalizeTimestampValue","value","Number","isFinite","Math","floor","exports","getTimestampFromUnknown","Date","ts","getTime","trimmed","trim","test","parsedDate","numericChunk","match"],"sourceRoot":"../../../src","sources":["helpers/timestamp.ts"],"mappings":";;;;;;AAAA,MAAMA,wBAAwB,GAAG,IAAI;AACrC,MAAMC,wBAAwB,GAAG,IAAI;AACrC,MAAMC,iBAAiB,GAAG,IAAI;AAEvB,MAAMC,uBAAuB,GAAIC,KAAa,IAAa;EAChE,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,IAAIA,KAAK,IAAI,CAAC,EAAE,OAAO,CAAC;EACnD,IAAIA,KAAK,GAAGJ,wBAAwB,EAAE,OAAOI,KAAK,GAAG,IAAI,CAAC,CAAC;EAC3D,IAAIA,KAAK,GAAGF,iBAAiB,EAAE,OAAOK,IAAI,CAACC,KAAK,CAACJ,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;EACrE,IAAIA,KAAK,GAAGH,wBAAwB,EAAE,OAAOM,IAAI,CAACC,KAAK,CAACJ,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;EACvE,OAAOA,KAAK,CAAC,CAAC;AAChB,CAAC;AAACK,OAAA,CAAAN,uBAAA,GAAAA,uBAAA;AAEK,MAAMO,uBAAuB,GAAIN,KAAc,IAAa;EACjE,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAO,CAAC;EAE3B,IAAIA,KAAK,YAAYO,IAAI,EAAE;IACzB,MAAMC,EAAE,GAAGR,KAAK,CAACS,OAAO,CAAC,CAAC;IAC1B,OAAOR,MAAM,CAACC,QAAQ,CAACM,EAAE,CAAC,IAAIA,EAAE,GAAG,CAAC,GAAGA,EAAE,GAAG,CAAC;EAC/C;EAEA,IAAI,OAAOR,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOD,uBAAuB,CAACC,KAAK,CAAC;EACvC;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,MAAMU,OAAO,GAAGV,KAAK,CAACW,IAAI,CAAC,CAAC;IAC5B,IAAI,CAACD,OAAO,EAAE,OAAO,CAAC;IAEtB,IAAI,OAAO,CAACE,IAAI,CAACF,OAAO,CAAC,EAAE;MACzB,OAAOX,uBAAuB,CAACE,MAAM,CAACS,OAAO,CAAC,CAAC;IACjD;IAEA,MAAMG,UAAU,GAAG,IAAIN,IAAI,CAACG,OAAO,CAAC,CAACD,OAAO,CAAC,CAAC;IAC9C,IAAIR,MAAM,CAACC,QAAQ,CAACW,UAAU,CAAC,IAAIA,UAAU,GAAG,CAAC,EAAE,OAAOA,UAAU;IAEpE,MAAMC,YAAY,GAAGJ,OAAO,CAACK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAClD,IAAID,YAAY,EAAE;MAChB,OAAOf,uBAAuB,CAACE,MAAM,CAACa,YAAY,CAAC,CAAC;IACtD;EACF;EAEA,OAAO,CAAC;AACV,CAAC;AAACT,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,517 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ensureRoomDirectory = ensureRoomDirectory;
7
+ exports.isUserNotFound = exports.getUserLookupStatus = exports.getRoomDirectoryState = exports.getRoomDirectoryMembers = void 0;
8
+ exports.refreshUser = refreshUser;
9
+ exports.requestSendersOf = requestSendersOf;
10
+ exports.requestUsers = requestUsers;
11
+ exports.resetUserResolver = resetUserResolver;
12
+ exports.subscribeUserResolver = void 0;
13
+ var _apiClient = _interopRequireDefault(require("../networking/apiClient"));
14
+ var _roomMembers = require("../networking/api-requests/roomMembers.api");
15
+ var _dedupeMembers = require("./dedupeMembers");
16
+ var _roomStore = require("../roomStore");
17
+ var _roomsSlice = require("../roomStore/roomsSlice");
18
+ var _chatSettingsSlice = require("../roomStore/chatSettingsSlice");
19
+ var _safeKey = require("../roomStore/safeKey");
20
+ var _xmppUsername = require("./xmppUsername");
21
+ var _xmppIdShape = require("./xmppIdShape");
22
+ var _sessionAppId = require("./sessionAppId");
23
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
24
+ // Lazy user resolution.
25
+ //
26
+ // GET /v1/chats/my returns at most 30 members of a big room (plus
27
+ // `usersCnt`), so senders of older messages are unknown to usersSet. The
28
+ // source of truth for a name is the backend user record, fetched here:
29
+ // - one user: GET /v1/apps/users/<appId_userId>, falling back to
30
+ // GET /v2/chats/users?xmppUsername=<appId_userId> when the backend does
31
+ // not take our token on v1 (see lookupUser in roomMembers.api.ts)
32
+ // - GET /v2/chats/users?chatName=<roomLocal>&limit=500 a room directory
33
+ // Results go into rooms.usersSet through mergeUsersSet (names render from
34
+ // usersSet at render time, so nothing else needs rewriting). Only display fields are kept: the
35
+ // endpoint also returns email and tags, which must never reach the
36
+ // persisted usersSet.
37
+
38
+ const DEBOUNCE_MS = 150;
39
+ const CONCURRENCY = 4;
40
+ const SINGLE_FETCH_LIMIT = 10;
41
+ const MAX_PENDING = 200;
42
+ const NOT_FOUND_TTL_MS = 10 * 60_000;
43
+ const BACKOFF_STEPS_MS = [5_000, 30_000];
44
+ const DIRECTORY_PAGE_LIMIT = 500;
45
+ const DIRECTORY_MAX_PAGES = 200;
46
+ const DIRECTORY_MAX_STALE_PAGES = 5;
47
+ const INSERT_BUFFER_MS = 100;
48
+ let generation = 0;
49
+ const pending = new Set();
50
+ const inflight = new Set();
51
+ const negative = new Map();
52
+ let debounceTimer = null;
53
+ let activeWorkers = 0;
54
+ const queue = [];
55
+ let insertBuffer = [];
56
+ const refreshTimers = new Map();
57
+ const refreshAgain = new Set();
58
+ // ids whose in-progress fetch was asked for by refreshUser
59
+ const refreshForced = new Set();
60
+ let insertTimer = null;
61
+ const dirState = new Map();
62
+ const dirInflight = new Map();
63
+ // A failed directory is not retried for a while: without this a dead
64
+ // endpoint turned every debounce pass into another directory request.
65
+ const DIRECTORY_RETRY_MS = 30_000;
66
+ const dirFailedAt = new Map();
67
+ const dirCoolingDown = jid => Date.now() - (dirFailedAt.get(jid) ?? -Infinity) < DIRECTORY_RETRY_MS;
68
+ // The directory members of each room in server order, grown page by page.
69
+ const dirMembers = new Map();
70
+ const listeners = new Set();
71
+ const notify = () => {
72
+ listeners.forEach(l => {
73
+ try {
74
+ l();
75
+ } catch {
76
+ // a broken subscriber must not stop the others
77
+ }
78
+ });
79
+ };
80
+
81
+ /** Re-render hook: called when a directory state or a negative cache entry changes. */
82
+ const subscribeUserResolver = listener => {
83
+ listeners.add(listener);
84
+ return () => {
85
+ listeners.delete(listener);
86
+ };
87
+ };
88
+ exports.subscribeUserResolver = subscribeUserResolver;
89
+ let sessionIdentity = '';
90
+
91
+ /**
92
+ * The signed-in account is the session identity: when another account signs
93
+ * in, every cache and in-flight result of the previous one is dropped (a
94
+ * token refresh for the same account must not). No token (logout, or a
95
+ * transient rehydrate gap) just yields '' and does no work.
96
+ */
97
+ const getToken = () => {
98
+ const u = _roomStore.store.getState().chatSettingStore?.user;
99
+ const token = u?.token || '';
100
+ const identity = String(u?.xmppUsername || u?._id || '');
101
+ if (token && identity && sessionIdentity && identity !== sessionIdentity) {
102
+ resetUserResolver();
103
+ }
104
+ if (token && identity) sessionIdentity = identity;
105
+ return token;
106
+ };
107
+
108
+ /** `appId_userId@host/res`, `appId_userId`, or a doubled prefix -> `appId_userId`. */
109
+ const normalizeId = raw => {
110
+ if (typeof raw !== 'string') return '';
111
+ const local = (0, _xmppIdShape.toLocalPart)(raw.split('/')[0]).trim();
112
+ if (!local || local === 'undefined') return '';
113
+ return (0, _xmppUsername.normalizeXmppUsername)(local);
114
+ };
115
+ const isLookupable = id => {
116
+ if (!id || /\s/.test(id) || !(0, _safeKey.isSafeKey)(id)) return false;
117
+ // Only appId_userId shaped ids can exist on the backend.
118
+ if (!id.includes('_')) return false;
119
+ if (!(0, _safeKey.hasSafeIdSegments)(id)) return false;
120
+ const appId = (0, _sessionAppId.getSessionAppId)();
121
+ if (appId && (id === appId || id === `${appId}_${appId}`)) return false;
122
+ return true;
123
+ };
124
+ const sanitizeUser = (raw, fallbackId) => {
125
+ if (!raw || typeof raw !== 'object') return null;
126
+ const xmppUsername = normalizeId(raw.xmppUsername) || fallbackId || '';
127
+ if (!(0, _safeKey.isSafeKey)(xmppUsername)) return null;
128
+ const user = {
129
+ _id: String(raw._id ?? ''),
130
+ xmppUsername,
131
+ firstName: typeof raw.firstName === 'string' ? raw.firstName : '',
132
+ lastName: typeof raw.lastName === 'string' ? raw.lastName : ''
133
+ };
134
+ if (typeof raw.profileImage === 'string' && raw.profileImage) {
135
+ user.profileImage = raw.profileImage;
136
+ }
137
+ return user;
138
+ };
139
+
140
+ // One dispatch for the whole batch. Display fields are laid over whatever the
141
+ // entry already carries (role, jid, ...) so a lookup never strips what the
142
+ // REST member list put there. RN renders names from usersSet at render time,
143
+ // so no message rewrite is needed.
144
+ const insertIntoUsersSet = users => {
145
+ if (!users.length) return;
146
+ const existing = _roomStore.store.getState().rooms?.usersSet || {};
147
+ const members = {};
148
+ for (const u of users) {
149
+ if (!(0, _safeKey.isSafeKey)(u?.xmppUsername)) continue;
150
+ members[u.xmppUsername] = {
151
+ ...(existing[u.xmppUsername] || {}),
152
+ ...u
153
+ };
154
+ }
155
+ if (Object.keys(members).length) _roomStore.store.dispatch((0, _roomsSlice.mergeUsersSet)({
156
+ members
157
+ }));
158
+ };
159
+ const flushInserts = () => {
160
+ if (insertTimer) {
161
+ clearTimeout(insertTimer);
162
+ insertTimer = null;
163
+ }
164
+ if (!insertBuffer.length) return;
165
+ const batch = insertBuffer;
166
+ insertBuffer = [];
167
+ insertIntoUsersSet(batch);
168
+ };
169
+ const bufferInsert = users => {
170
+ if (!users.length) return;
171
+ insertBuffer.push(...users);
172
+ if (!insertTimer) insertTimer = setTimeout(flushInserts, INSERT_BUFFER_MS);
173
+ };
174
+ const markNegative = (id, kind) => {
175
+ const prev = negative.get(id);
176
+ const attempts = (prev?.kind === 'error' ? prev.attempts : 0) + 1;
177
+ const ttl = kind !== 'error' ? NOT_FOUND_TTL_MS : BACKOFF_STEPS_MS[Math.min(attempts - 1, BACKOFF_STEPS_MS.length - 1)];
178
+ negative.set(id, {
179
+ until: Date.now() + ttl,
180
+ kind,
181
+ attempts
182
+ });
183
+ };
184
+ const isNegative = id => {
185
+ const n = negative.get(id);
186
+ if (!n) return false;
187
+ if (n.until <= Date.now()) {
188
+ // keep an expired error entry so attempts keep escalating the backoff
189
+ if (n.kind !== 'error') negative.delete(id);
190
+ return false;
191
+ }
192
+ return true;
193
+ };
194
+
195
+ /**
196
+ * True for an id the backend answered 404 for: the user really is gone.
197
+ * (An id merely not resolved yet is NOT "not found".)
198
+ */
199
+ const isUserNotFound = rawId => {
200
+ const n = negative.get(normalizeId(rawId));
201
+ return Boolean(n && n.kind === 'notfound' && n.until > Date.now());
202
+ };
203
+
204
+ /**
205
+ * Where a sender's lookup stands, for the display chain:
206
+ * - resolved: in usersSet
207
+ * - pending: queued, in flight, or not requested yet (a bubble just mounted)
208
+ * - notfound / forbidden: the backend answered, nothing to show from it
209
+ * - failed: the last attempt errored (backoff), or the lookup is exhausted
210
+ * - unavailable: this id can never be looked up (plain handle) or there is
211
+ * no session token, so nothing is coming
212
+ */
213
+ exports.isUserNotFound = isUserNotFound;
214
+ const getUserLookupStatus = rawId => {
215
+ const id = normalizeId(rawId);
216
+ if (!id) return 'unavailable';
217
+ if (_roomStore.store.getState().rooms?.usersSet?.[id]) return 'resolved';
218
+ const n = negative.get(id);
219
+ // an answer recorded a moment ago wins over the in-flight bookkeeping that
220
+ // is cleared right after it
221
+ if (n && isNegative(id)) return n.kind === 'error' ? 'failed' : n.kind;
222
+ if (pending.has(id) || inflight.has(id) || queue.includes(id)) {
223
+ return 'pending';
224
+ }
225
+ if (n && n.kind === 'error') return 'failed';
226
+ if (!isLookupable(id) || !getToken()) return 'unavailable';
227
+ return 'pending';
228
+ };
229
+
230
+ // A refreshed profile that is the signed-in user's own also updates the
231
+ // session user (chatSettingStore.user), which feeds the own-profile UI.
232
+ // Only the display fields, and only when something actually changed.
233
+ exports.getUserLookupStatus = getUserLookupStatus;
234
+ const applyToSessionUser = (id, fresh) => {
235
+ const me = _roomStore.store.getState().chatSettingStore?.user;
236
+ if (!me || normalizeId(me.xmppUsername) !== id) return;
237
+ const updates = {};
238
+ if (fresh.firstName !== undefined && fresh.firstName !== me.firstName) {
239
+ updates.firstName = fresh.firstName;
240
+ }
241
+ if (fresh.lastName !== undefined && fresh.lastName !== me.lastName) {
242
+ updates.lastName = fresh.lastName;
243
+ }
244
+ if (fresh.profileImage && fresh.profileImage !== me.profileImage) {
245
+ updates.profileImage = fresh.profileImage;
246
+ }
247
+ if (Object.keys(updates).length) _roomStore.store.dispatch((0, _chatSettingsSlice.updateUser)({
248
+ updates
249
+ }));
250
+ };
251
+ const fetchOne = async (id, gen) => {
252
+ const token = getToken();
253
+ if (!token) return;
254
+ const outcome = await (0, _roomMembers.lookupUser)(id, token);
255
+ if (gen !== generation) return;
256
+ if (outcome.status === 'ok') {
257
+ const user = sanitizeUser(outcome.user, id);
258
+ if (user) {
259
+ negative.delete(id);
260
+ bufferInsert([user]);
261
+ if (refreshForced.delete(id)) applyToSessionUser(id, user);
262
+ return;
263
+ }
264
+ markNegative(id, 'notfound');
265
+ } else {
266
+ markNegative(id, outcome.status);
267
+ }
268
+ notify();
269
+ };
270
+ const pump = gen => {
271
+ while (activeWorkers < CONCURRENCY && queue.length) {
272
+ const id = queue.shift();
273
+ activeWorkers++;
274
+ inflight.add(id);
275
+ fetchOne(id, gen).finally(() => {
276
+ if (gen !== generation) return;
277
+ inflight.delete(id);
278
+ activeWorkers--;
279
+ // a refresh asked for while this fetch was running: its answer may
280
+ // predate the change, so fetch once more
281
+ if (refreshAgain.delete(id) && !queue.includes(id)) queue.push(id);
282
+ if (queue.length) pump(gen);else if (activeWorkers === 0) flushInserts();
283
+ });
284
+ }
285
+ };
286
+ const knownUsers = () => _roomStore.store.getState().rooms?.usersSet || {};
287
+
288
+ /** The room, if any, whose unknown senders among `ids` justify one directory fetch. */
289
+ const pickDirectoryRoom = ids => {
290
+ const idSet = new Set(ids);
291
+ const rooms = _roomStore.store.getState().rooms?.rooms || {};
292
+ let best = null;
293
+ let bestCount = SINGLE_FETCH_LIMIT;
294
+ for (const [jid, room] of Object.entries(rooms)) {
295
+ const cnt = Number(room?.usersCnt || 0);
296
+ const have = Array.isArray(room?.members) ? room.members.length : 0;
297
+ if (!(have < cnt) || dirState.get(jid) === 'done' || dirCoolingDown(jid)) {
298
+ continue;
299
+ }
300
+ const seen = new Set();
301
+ for (const m of room.messages || []) {
302
+ const uid = normalizeId(m?.user?.id);
303
+ if (uid && idSet.has(uid)) seen.add(uid);
304
+ }
305
+ if (seen.size > bestCount) {
306
+ best = jid;
307
+ bestCount = seen.size;
308
+ }
309
+ }
310
+ return best;
311
+ };
312
+ const flush = () => {
313
+ debounceTimer = null;
314
+ const gen = generation;
315
+ const users = knownUsers();
316
+ const ids = [...pending].filter(id => !users[id] && !inflight.has(id) && !isNegative(id));
317
+ pending.clear();
318
+ if (!ids.length) return;
319
+ if (ids.length > SINGLE_FETCH_LIMIT) {
320
+ const roomJid = pickDirectoryRoom(ids);
321
+ if (roomJid) {
322
+ ensureRoomDirectory(roomJid).then(() => {
323
+ if (gen !== generation) return;
324
+ // whoever the directory did not contain (left the room) still gets
325
+ // the per-user lookup
326
+ requestUsers(ids);
327
+ });
328
+ return;
329
+ }
330
+ }
331
+ for (const id of ids) if (!queue.includes(id)) queue.push(id);
332
+ pump(gen);
333
+ };
334
+
335
+ /**
336
+ * Ask for the profiles of these senders. Cheap to call from anywhere (a
337
+ * bubble mounting, a history batch parse): known, in-flight and recently
338
+ * failed ids are dropped, the rest are debounced into one pass.
339
+ */
340
+ function requestUsers(ids) {
341
+ if (!Array.isArray(ids) || !ids.length) return;
342
+ if (!getToken()) return;
343
+ const users = knownUsers();
344
+ let added = false;
345
+ for (const raw of ids) {
346
+ const id = normalizeId(raw);
347
+ if (!isLookupable(id)) continue;
348
+ if (users[id] || inflight.has(id) || pending.has(id) || isNegative(id)) {
349
+ continue;
350
+ }
351
+ pending.add(id);
352
+ added = true;
353
+ if (pending.size > MAX_PENDING) {
354
+ // drop the oldest
355
+ const oldest = pending.values().next().value;
356
+ pending.delete(oldest);
357
+ }
358
+ }
359
+ if (!added) return;
360
+ if (debounceTimer) clearTimeout(debounceTimer);
361
+ debounceTimer = setTimeout(flush, DEBOUNCE_MS);
362
+ }
363
+ const REFRESH_DEBOUNCE_MS = 500;
364
+
365
+ /**
366
+ * Re-fetch one user's profile even though it is already in usersSet, because
367
+ * the server said it changed (ethora-event user-profile-updated). Bypasses
368
+ * the cache and forgets a negative-cache entry, but shares everything else
369
+ * with requestUsers: the same route chain (lookupUser), the same worker
370
+ * queue and concurrency cap, one request at a time per user. Calls for the
371
+ * same user within REFRESH_DEBOUNCE_MS coalesce into one fetch. The answer
372
+ * goes through mergeUsersSet (display fields only), so existing bubbles are
373
+ * re-named. Never throws.
374
+ */
375
+ function refreshUser(rawId) {
376
+ const id = normalizeId(rawId);
377
+ if (!isLookupable(id) || !getToken()) return;
378
+ const prior = refreshTimers.get(id);
379
+ if (prior) clearTimeout(prior);
380
+ const gen = generation;
381
+ refreshTimers.set(id, setTimeout(() => {
382
+ refreshTimers.delete(id);
383
+ if (gen !== generation) return;
384
+ negative.delete(id);
385
+ refreshForced.add(id);
386
+ if (inflight.has(id)) {
387
+ refreshAgain.add(id);
388
+ return;
389
+ }
390
+ if (!queue.includes(id)) queue.push(id);
391
+ pump(gen);
392
+ }, REFRESH_DEBOUNCE_MS));
393
+ }
394
+ const EMPTY_DIRECTORY = [];
395
+
396
+ /**
397
+ * Members loaded so far by ensureRoomDirectory for this room (a new array
398
+ * identity after every page, a stable empty array before any).
399
+ */
400
+ const getRoomDirectoryMembers = roomJID => dirMembers.get(roomJID) || EMPTY_DIRECTORY;
401
+
402
+ /** requestUsers for the senders of a batch of messages (history page, jump window). */
403
+ exports.getRoomDirectoryMembers = getRoomDirectoryMembers;
404
+ function requestSendersOf(messages) {
405
+ if (!messages?.length) return;
406
+ const ids = new Set();
407
+ for (const m of messages) {
408
+ const id = m?.user?.id;
409
+ if (id) ids.add(id);
410
+ }
411
+ if (ids.size) requestUsers([...ids]);
412
+ }
413
+ const getRoomDirectoryState = roomJID => dirState.get(roomJID) || 'idle';
414
+ exports.getRoomDirectoryState = getRoomDirectoryState;
415
+ const setDirState = (roomJID, state) => {
416
+ if (dirState.get(roomJID) === state) return;
417
+ dirState.set(roomJID, state);
418
+ notify();
419
+ };
420
+
421
+ /**
422
+ * Loads every member of one room into usersSet, once. Pages are not
423
+ * guaranteed to be full, so it stops on an empty page or offset >= total,
424
+ * never on `items.length < limit`.
425
+ */
426
+ function ensureRoomDirectory(roomJID) {
427
+ if (!roomJID || typeof roomJID !== 'string') return Promise.resolve();
428
+ if (dirState.get(roomJID) === 'done') return Promise.resolve();
429
+ const running = dirInflight.get(roomJID);
430
+ if (running) return running;
431
+ if (dirCoolingDown(roomJID)) return Promise.resolve();
432
+ const token = getToken();
433
+ const chatName = (0, _xmppIdShape.toLocalPart)(roomJID);
434
+ if (!token || !chatName) return Promise.resolve();
435
+ const gen = generation;
436
+ setDirState(roomJID, 'loading');
437
+ const job = (async () => {
438
+ let offset = 0;
439
+ let total = Infinity;
440
+ let stale = 0;
441
+ try {
442
+ for (let page = 0; page < DIRECTORY_MAX_PAGES; page++) {
443
+ const res = await _apiClient.default.get('/v2/chats/users', {
444
+ params: {
445
+ chatName,
446
+ limit: DIRECTORY_PAGE_LIMIT,
447
+ offset
448
+ },
449
+ headers: {
450
+ Authorization: token
451
+ }
452
+ });
453
+ if (gen !== generation) return;
454
+ const data = res?.data || {};
455
+ const items = Array.isArray(data.items) ? data.items : Array.isArray(data.results) ? data.results : [];
456
+ if (!items.length) break;
457
+ const batch = items.map(item => sanitizeUser(item)).filter(u => Boolean(u));
458
+ // The backend can repeat the same user across pages (total counts the
459
+ // repeats), so merge by identity: first occurrence wins.
460
+ const before = dirMembers.get(roomJID) || EMPTY_DIRECTORY;
461
+ const merged = (0, _dedupeMembers.dedupeMembers)([...before, ...batch]);
462
+ const added = merged.length - before.length;
463
+ if (added > 0) {
464
+ insertIntoUsersSet(batch);
465
+ dirMembers.set(roomJID, merged);
466
+ notify();
467
+ }
468
+ offset += items.length;
469
+ // Pages made only of repeats are normal at the tail (the real
470
+ // 435/11/3/1 shape), but a run of them means the server ignores
471
+ // offset: stop instead of walking to the page cap.
472
+ stale = added > 0 ? 0 : stale + 1;
473
+ if (stale >= DIRECTORY_MAX_STALE_PAGES) break;
474
+ const t = Number(data.total ?? data.pagination?.total);
475
+ if (Number.isFinite(t)) total = t;
476
+ if (offset >= total) break;
477
+ }
478
+ if (gen === generation) setDirState(roomJID, 'done');
479
+ } catch {
480
+ if (gen === generation) {
481
+ dirFailedAt.set(roomJID, Date.now());
482
+ setDirState(roomJID, 'error');
483
+ }
484
+ }
485
+ })().finally(() => {
486
+ if (dirInflight.get(roomJID) === job) dirInflight.delete(roomJID);
487
+ });
488
+ dirInflight.set(roomJID, job);
489
+ return job;
490
+ }
491
+
492
+ /** For tests and logout: drops every cache, timer and in-flight result. */
493
+ function resetUserResolver() {
494
+ generation++;
495
+ sessionIdentity = '';
496
+ pending.clear();
497
+ inflight.clear();
498
+ negative.clear();
499
+ (0, _roomMembers.resetUserLookupRoute)();
500
+ queue.length = 0;
501
+ activeWorkers = 0;
502
+ insertBuffer = [];
503
+ refreshTimers.forEach(t => clearTimeout(t));
504
+ refreshTimers.clear();
505
+ refreshAgain.clear();
506
+ refreshForced.clear();
507
+ if (debounceTimer) clearTimeout(debounceTimer);
508
+ debounceTimer = null;
509
+ if (insertTimer) clearTimeout(insertTimer);
510
+ insertTimer = null;
511
+ dirState.clear();
512
+ dirInflight.clear();
513
+ dirFailedAt.clear();
514
+ dirMembers.clear();
515
+ notify();
516
+ }
517
+ //# sourceMappingURL=userResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_apiClient","_interopRequireDefault","require","_roomMembers","_dedupeMembers","_roomStore","_roomsSlice","_chatSettingsSlice","_safeKey","_xmppUsername","_xmppIdShape","_sessionAppId","e","__esModule","default","DEBOUNCE_MS","CONCURRENCY","SINGLE_FETCH_LIMIT","MAX_PENDING","NOT_FOUND_TTL_MS","BACKOFF_STEPS_MS","DIRECTORY_PAGE_LIMIT","DIRECTORY_MAX_PAGES","DIRECTORY_MAX_STALE_PAGES","INSERT_BUFFER_MS","generation","pending","Set","inflight","negative","Map","debounceTimer","activeWorkers","queue","insertBuffer","refreshTimers","refreshAgain","refreshForced","insertTimer","dirState","dirInflight","DIRECTORY_RETRY_MS","dirFailedAt","dirCoolingDown","jid","Date","now","get","Infinity","dirMembers","listeners","notify","forEach","l","subscribeUserResolver","listener","add","delete","exports","sessionIdentity","getToken","u","store","getState","chatSettingStore","user","token","identity","String","xmppUsername","_id","resetUserResolver","normalizeId","raw","local","toLocalPart","split","trim","normalizeXmppUsername","isLookupable","id","test","isSafeKey","includes","hasSafeIdSegments","appId","getSessionAppId","sanitizeUser","fallbackId","firstName","lastName","profileImage","insertIntoUsersSet","users","length","existing","rooms","usersSet","members","Object","keys","dispatch","mergeUsersSet","flushInserts","clearTimeout","batch","bufferInsert","push","setTimeout","markNegative","kind","prev","attempts","ttl","Math","min","set","until","isNegative","n","isUserNotFound","rawId","Boolean","getUserLookupStatus","has","applyToSessionUser","fresh","me","updates","undefined","updateUser","fetchOne","gen","outcome","lookupUser","status","pump","shift","finally","knownUsers","pickDirectoryRoom","ids","idSet","best","bestCount","room","entries","cnt","Number","usersCnt","have","Array","isArray","seen","m","messages","uid","size","flush","filter","clear","roomJid","ensureRoomDirectory","then","requestUsers","added","oldest","values","next","value","REFRESH_DEBOUNCE_MS","refreshUser","prior","EMPTY_DIRECTORY","getRoomDirectoryMembers","roomJID","requestSendersOf","getRoomDirectoryState","setDirState","state","Promise","resolve","running","chatName","job","offset","total","stale","page","res","http","params","limit","headers","Authorization","data","items","results","map","item","before","merged","dedupeMembers","t","pagination","isFinite","resetUserLookupRoute"],"sourceRoot":"../../../src","sources":["helpers/userResolver.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAAiD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMG,WAAW,GAAG,GAAG;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,kBAAkB,GAAG,EAAE;AAC7B,MAAMC,WAAW,GAAG,GAAG;AACvB,MAAMC,gBAAgB,GAAG,EAAE,GAAG,MAAM;AACpC,MAAMC,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,MAAMC,oBAAoB,GAAG,GAAG;AAChC,MAAMC,mBAAmB,GAAG,GAAG;AAC/B,MAAMC,yBAAyB,GAAG,CAAC;AACnC,MAAMC,gBAAgB,GAAG,GAAG;AAK5B,IAAIC,UAAU,GAAG,CAAC;A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AC;EACrB5H,YAAY,CAAC4H,KAAK,CAAC,CAAC;EACpB3H,aAAa,CAAC2H,KAAK,CAAC,CAAC;EACrB,IAAIjI,aAAa,EAAEyE,YAAY,CAACzE,aAAa,CAAC;EAC9CA,aAAa,GAAG,IAAI;EACpB,IAAIO,WAAW,EAAEkE,YAAY,CAAClE,WAAW,CAAC;EAC1CA,WAAW,GAAG,IAAI;EAClBC,QAAQ,CAACyH,KAAK,CAAC,CAAC;EAChBxH,WAAW,CAACwH,KAAK,CAAC,CAAC;EACnBtH,WAAW,CAACsH,KAAK,CAAC,CAAC;EACnB/G,UAAU,CAAC+G,KAAK,CAAC,CAAC;EAClB7G,MAAM,CAAC,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.toLocalPart = exports.isOpaqueXmppUserId = void 0;
7
+ // Pure string-shape helpers for xmpp local ids/JIDs - no dependency on the
8
+ // redux store. Kept separate from xmppUsername.ts (which imports `store`
9
+ // for normalizeXmppUsername/isSameXmppUsername) so this file can be safely
10
+ // imported from the redux reducer graph itself (roomsSlice.ts,
11
+ // createUserNameFromSetUser.ts): those are pulled in by roomStore/index.ts
12
+ // to build the root reducer, and importing anything that in turn imports
13
+ // `store` from roomStore/index.ts there creates a circular dependency back
14
+ // into the module that is still assembling the store.
15
+
16
+ // Strips a value that the local part of an XMPP JID may carry, leaving
17
+ // just the bare resource (anything before `@`). XMPP allows resources
18
+ // with `@` only in escaped form so the simple split is enough here.
19
+ const toLocalPart = value => {
20
+ if (!value) return '';
21
+ return String(value).split('@')[0];
22
+ };
23
+
24
+ // A 24-character hex string is a Mongo ObjectId - the shape of both the
25
+ // appId and the userId that make up an Ethora xmpp username.
26
+ exports.toLocalPart = toLocalPart;
27
+ const HEX24 = '[0-9a-fA-F]{24}';
28
+ // `<appId>_<userId>` (the normal shape) or a bare id on its own (seen on
29
+ // system/local entries that never went through the appId_userId join).
30
+ // Anchored end to end so a human handle that merely contains 24 hex chars
31
+ // somewhere (unlikely, but not impossible) is never caught by accident.
32
+ const UUID = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
33
+ // `<appId>_<uuid>` or `<appId>_<hex24>`, optionally followed by further
34
+ // `_<token>` segments (appId is hex24 on most deployments, any alphanumeric
35
+ // token on others). A bare id, or a two-segment mongo id, is the original
36
+ // shape.
37
+ const OPAQUE_XMPP_USER_ID_RE = new RegExp(`^(?:${HEX24}(?:_${HEX24})?|[A-Za-z0-9]+_(?:${HEX24}|${UUID})(?:_[0-9A-Za-z-]+)*)$`);
38
+
39
+ /**
40
+ * True when `value` (a full JID or already-bare local part) is a
41
+ * machine-generated Ethora id rather than anything a human would recognize
42
+ * as their own name - `<24 hex>_<24 hex>`, `<appId>_<uuid>` or a bare 24-hex
43
+ * id. Kept narrow on purpose: a handle a person actually picked is never
44
+ * this shape, so it is never mistaken for one.
45
+ */
46
+ const isOpaqueXmppUserId = value => {
47
+ const local = toLocalPart(value || '').trim();
48
+ if (!local) return false;
49
+ return OPAQUE_XMPP_USER_ID_RE.test(local);
50
+ };
51
+ exports.isOpaqueXmppUserId = isOpaqueXmppUserId;
52
+ //# sourceMappingURL=xmppIdShape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["toLocalPart","value","String","split","exports","HEX24","UUID","OPAQUE_XMPP_USER_ID_RE","RegExp","isOpaqueXmppUserId","local","trim","test"],"sourceRoot":"../../../src","sources":["helpers/xmppIdShape.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,WAAW,GAAIC,KAAc,IAAa;EACrD,IAAI,CAACA,KAAK,EAAE,OAAO,EAAE;EACrB,OAAOC,MAAM,CAACD,KAAK,CAAC,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;;AAED;AACA;AAAAC,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AACA,MAAMK,KAAK,GAAG,iBAAiB;AAC/B;AACA;AACA;AACA;AACA,MAAMC,IAAI,GACR,6EAA6E;AAC/E;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,IAAIC,MAAM,CACvC,OAAOH,KAAK,OAAOA,KAAK,sBAAsBA,KAAK,IAAIC,IAAI,wBAC7D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,kBAAkB,GAAIR,KAAgC,IAAc;EAC/E,MAAMS,KAAK,GAAGV,WAAW,CAACC,KAAK,IAAI,EAAE,CAAC,CAACU,IAAI,CAAC,CAAC;EAC7C,IAAI,CAACD,KAAK,EAAE,OAAO,KAAK;EACxB,OAAOH,sBAAsB,CAACK,IAAI,CAACF,KAAK,CAAC;AAC3C,CAAC;AAACN,OAAA,CAAAK,kBAAA,GAAAA,kBAAA","ignoreList":[]}