@ethora/chat-component-rn 26.10.10 → 26.10.11

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 (483) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +125 -0
  3. package/lib/commonjs/booking/index.js +44 -0
  4. package/lib/commonjs/booking/index.js.map +1 -0
  5. package/lib/commonjs/booking/pendingScheduledCall.js +275 -0
  6. package/lib/commonjs/booking/pendingScheduledCall.js.map +1 -0
  7. package/lib/commonjs/booking/scheduleForm.js +91 -0
  8. package/lib/commonjs/booking/scheduleForm.js.map +1 -0
  9. package/lib/commonjs/booking/scheduledCall.js +141 -0
  10. package/lib/commonjs/booking/scheduledCall.js.map +1 -0
  11. package/lib/commonjs/booking/scheduledCallActions.js +128 -0
  12. package/lib/commonjs/booking/scheduledCallActions.js.map +1 -0
  13. package/lib/commonjs/booking/scheduledCallLink.js +143 -0
  14. package/lib/commonjs/booking/scheduledCallLink.js.map +1 -0
  15. package/lib/commonjs/booking/scheduledCallStore.js +64 -0
  16. package/lib/commonjs/booking/scheduledCallStore.js.map +1 -0
  17. package/lib/commonjs/booking/startRoomCall.js +84 -0
  18. package/lib/commonjs/booking/startRoomCall.js.map +1 -0
  19. package/lib/commonjs/calls/callBusy.js +18 -0
  20. package/lib/commonjs/calls/callBusy.js.map +1 -0
  21. package/lib/commonjs/calls/callDisplay.js +73 -0
  22. package/lib/commonjs/calls/callDisplay.js.map +1 -0
  23. package/lib/commonjs/calls/callMode.js +175 -0
  24. package/lib/commonjs/calls/callMode.js.map +1 -0
  25. package/lib/commonjs/calls/declineReport.js +20 -0
  26. package/lib/commonjs/calls/declineReport.js.map +1 -0
  27. package/lib/commonjs/calls/p2p/P2PCallController.js +724 -0
  28. package/lib/commonjs/calls/p2p/P2PCallController.js.map +1 -0
  29. package/lib/commonjs/calls/p2p/icePolicy.js +107 -0
  30. package/lib/commonjs/calls/p2p/icePolicy.js.map +1 -0
  31. package/lib/commonjs/calls/p2p/negotiator.js +202 -0
  32. package/lib/commonjs/calls/p2p/negotiator.js.map +1 -0
  33. package/lib/commonjs/calls/p2p/p2pRuntime.js +147 -0
  34. package/lib/commonjs/calls/p2p/p2pRuntime.js.map +1 -0
  35. package/lib/commonjs/calls/p2p/signalInbox.js +98 -0
  36. package/lib/commonjs/calls/p2p/signalInbox.js.map +1 -0
  37. package/lib/commonjs/calls/p2p/signalStanza.js +141 -0
  38. package/lib/commonjs/calls/p2p/signalStanza.js.map +1 -0
  39. package/lib/commonjs/calls/p2p/webrtcRuntime.js +53 -0
  40. package/lib/commonjs/calls/p2p/webrtcRuntime.js.map +1 -0
  41. package/lib/commonjs/calls/senderTrust.js +43 -0
  42. package/lib/commonjs/calls/senderTrust.js.map +1 -0
  43. package/lib/commonjs/calls/startCall.js +51 -0
  44. package/lib/commonjs/calls/startCall.js.map +1 -0
  45. package/lib/commonjs/components/Booking/BookingIcons.js +55 -0
  46. package/lib/commonjs/components/Booking/BookingIcons.js.map +1 -0
  47. package/lib/commonjs/components/Booking/ScheduleCallButton.js +64 -0
  48. package/lib/commonjs/components/Booking/ScheduleCallButton.js.map +1 -0
  49. package/lib/commonjs/components/Booking/ScheduleCallSheet.js +351 -0
  50. package/lib/commonjs/components/Booking/ScheduleCallSheet.js.map +1 -0
  51. package/lib/commonjs/components/Booking/ScheduledCallCard.js +203 -0
  52. package/lib/commonjs/components/Booking/ScheduledCallCard.js.map +1 -0
  53. package/lib/commonjs/components/Booking/ScheduledCallHost.js +23 -0
  54. package/lib/commonjs/components/Booking/ScheduledCallHost.js.map +1 -0
  55. package/lib/commonjs/components/Booking/ScheduledCallMessage.js +55 -0
  56. package/lib/commonjs/components/Booking/ScheduledCallMessage.js.map +1 -0
  57. package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js +235 -0
  58. package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js.map +1 -0
  59. package/lib/commonjs/components/Booking/bookingShared.js +305 -0
  60. package/lib/commonjs/components/Booking/bookingShared.js.map +1 -0
  61. package/lib/commonjs/components/MainComponents/ChatHeader.js +2 -1
  62. package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
  63. package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js +5 -2
  64. package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js.map +1 -1
  65. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +6 -3
  66. package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js.map +1 -1
  67. package/lib/commonjs/components/MainComponents/MessageContainer.js +13 -0
  68. package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
  69. package/lib/commonjs/components/MainComponents/ReduxWrapper.js +10 -0
  70. package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
  71. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +19 -15
  72. package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
  73. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +15 -8
  74. package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  75. package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
  76. package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
  77. package/lib/commonjs/components/VideoCalls/ActiveCallBar.js +3 -2
  78. package/lib/commonjs/components/VideoCalls/ActiveCallBar.js.map +1 -1
  79. package/lib/commonjs/components/VideoCalls/CallButtons.js +19 -11
  80. package/lib/commonjs/components/VideoCalls/CallButtons.js.map +1 -1
  81. package/lib/commonjs/components/VideoCalls/CallControlBar.js +119 -0
  82. package/lib/commonjs/components/VideoCalls/CallControlBar.js.map +1 -0
  83. package/lib/commonjs/components/VideoCalls/CallVideo.js +49 -0
  84. package/lib/commonjs/components/VideoCalls/CallVideo.js.map +1 -0
  85. package/lib/commonjs/components/VideoCalls/GroupCallView.js +281 -0
  86. package/lib/commonjs/components/VideoCalls/GroupCallView.js.map +1 -0
  87. package/lib/commonjs/components/VideoCalls/P2PCallRunner.js +151 -0
  88. package/lib/commonjs/components/VideoCalls/P2PCallRunner.js.map +1 -0
  89. package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +38 -14
  90. package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -1
  91. package/lib/commonjs/components/VideoCalls/VideoCallSession.js +57 -128
  92. package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
  93. package/lib/commonjs/components/VideoCalls/callActions.js +3 -0
  94. package/lib/commonjs/components/VideoCalls/callActions.js.map +1 -1
  95. package/lib/commonjs/components/VideoCalls/callElapsed.js +38 -0
  96. package/lib/commonjs/components/VideoCalls/callElapsed.js.map +1 -0
  97. package/lib/commonjs/components/VideoCalls/callLive.js +15 -0
  98. package/lib/commonjs/components/VideoCalls/callLive.js.map +1 -0
  99. package/lib/commonjs/components/VideoCalls/callSessionController.js +81 -24
  100. package/lib/commonjs/components/VideoCalls/callSessionController.js.map +1 -1
  101. package/lib/commonjs/components/VideoCalls/callSessionTypes.js +41 -0
  102. package/lib/commonjs/components/VideoCalls/callSessionTypes.js.map +1 -0
  103. package/lib/commonjs/components/VideoCalls/groupLayout.js +43 -0
  104. package/lib/commonjs/components/VideoCalls/groupLayout.js.map +1 -0
  105. package/lib/commonjs/components/VideoCalls/p2pCallSession.js +272 -0
  106. package/lib/commonjs/components/VideoCalls/p2pCallSession.js.map +1 -0
  107. package/lib/commonjs/components/VideoCalls/useCallKeep.js +7 -2
  108. package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -1
  109. package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js +2 -1
  110. package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
  111. package/lib/commonjs/context/xmppProvider.js +2 -1
  112. package/lib/commonjs/context/xmppProvider.js.map +1 -1
  113. package/lib/commonjs/helpers/callPush.js +3 -1
  114. package/lib/commonjs/helpers/callPush.js.map +1 -1
  115. package/lib/commonjs/helpers/incomingCallFromPush.js +63 -7
  116. package/lib/commonjs/helpers/incomingCallFromPush.js.map +1 -1
  117. package/lib/commonjs/helpers/pushPayload.js +5 -0
  118. package/lib/commonjs/helpers/pushPayload.js.map +1 -1
  119. package/lib/commonjs/helpers/reportRoom.js +76 -0
  120. package/lib/commonjs/helpers/reportRoom.js.map +1 -0
  121. package/lib/commonjs/i18n/strings.js +444 -0
  122. package/lib/commonjs/i18n/strings.js.map +1 -1
  123. package/lib/commonjs/main.js +93 -0
  124. package/lib/commonjs/main.js.map +1 -1
  125. package/lib/commonjs/networking/api-requests/callState.api.js +75 -0
  126. package/lib/commonjs/networking/api-requests/callState.api.js.map +1 -0
  127. package/lib/commonjs/networking/api-requests/push.api.js +29 -6
  128. package/lib/commonjs/networking/api-requests/push.api.js.map +1 -1
  129. package/lib/commonjs/networking/api-requests/rooms.api.js +8 -2
  130. package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
  131. package/lib/commonjs/networking/api-requests/scheduledCalls.api.js +141 -0
  132. package/lib/commonjs/networking/api-requests/scheduledCalls.api.js.map +1 -0
  133. package/lib/commonjs/networking/callTokenStanza.js +210 -50
  134. package/lib/commonjs/networking/callTokenStanza.js.map +1 -1
  135. package/lib/commonjs/roomStore/callSlice.js +59 -4
  136. package/lib/commonjs/roomStore/callSlice.js.map +1 -1
  137. package/lib/commonjs/services/appBadge.js +80 -0
  138. package/lib/commonjs/services/appBadge.js.map +1 -0
  139. package/lib/commonjs/services/languageSettings.js +47 -15
  140. package/lib/commonjs/services/languageSettings.js.map +1 -1
  141. package/lib/commonjs/services/pushRegistration.js +21 -5
  142. package/lib/commonjs/services/pushRegistration.js.map +1 -1
  143. package/lib/commonjs/version.js +1 -1
  144. package/lib/module/booking/index.js +5 -0
  145. package/lib/module/booking/index.js.map +1 -0
  146. package/lib/module/booking/pendingScheduledCall.js +261 -0
  147. package/lib/module/booking/pendingScheduledCall.js.map +1 -0
  148. package/lib/module/booking/scheduleForm.js +79 -0
  149. package/lib/module/booking/scheduleForm.js.map +1 -0
  150. package/lib/module/booking/scheduledCall.js +129 -0
  151. package/lib/module/booking/scheduledCall.js.map +1 -0
  152. package/lib/module/booking/scheduledCallActions.js +118 -0
  153. package/lib/module/booking/scheduledCallActions.js.map +1 -0
  154. package/lib/module/booking/scheduledCallLink.js +136 -0
  155. package/lib/module/booking/scheduledCallLink.js.map +1 -0
  156. package/lib/module/booking/scheduledCallStore.js +60 -0
  157. package/lib/module/booking/scheduledCallStore.js.map +1 -0
  158. package/lib/module/booking/startRoomCall.js +80 -0
  159. package/lib/module/booking/startRoomCall.js.map +1 -0
  160. package/lib/module/calls/callBusy.js +13 -0
  161. package/lib/module/calls/callBusy.js.map +1 -0
  162. package/lib/module/calls/callDisplay.js +65 -0
  163. package/lib/module/calls/callDisplay.js.map +1 -0
  164. package/lib/module/calls/callMode.js +168 -0
  165. package/lib/module/calls/callMode.js.map +1 -0
  166. package/lib/module/calls/declineReport.js +16 -0
  167. package/lib/module/calls/declineReport.js.map +1 -0
  168. package/lib/module/calls/p2p/P2PCallController.js +718 -0
  169. package/lib/module/calls/p2p/P2PCallController.js.map +1 -0
  170. package/lib/module/calls/p2p/icePolicy.js +102 -0
  171. package/lib/module/calls/p2p/icePolicy.js.map +1 -0
  172. package/lib/module/calls/p2p/negotiator.js +197 -0
  173. package/lib/module/calls/p2p/negotiator.js.map +1 -0
  174. package/lib/module/calls/p2p/p2pRuntime.js +137 -0
  175. package/lib/module/calls/p2p/p2pRuntime.js.map +1 -0
  176. package/lib/module/calls/p2p/signalInbox.js +93 -0
  177. package/lib/module/calls/p2p/signalInbox.js.map +1 -0
  178. package/lib/module/calls/p2p/signalStanza.js +135 -0
  179. package/lib/module/calls/p2p/signalStanza.js.map +1 -0
  180. package/lib/module/calls/p2p/webrtcRuntime.js +46 -0
  181. package/lib/module/calls/p2p/webrtcRuntime.js.map +1 -0
  182. package/lib/module/calls/senderTrust.js +38 -0
  183. package/lib/module/calls/senderTrust.js.map +1 -0
  184. package/lib/module/calls/startCall.js +47 -0
  185. package/lib/module/calls/startCall.js.map +1 -0
  186. package/lib/module/components/Booking/BookingIcons.js +48 -0
  187. package/lib/module/components/Booking/BookingIcons.js.map +1 -0
  188. package/lib/module/components/Booking/ScheduleCallButton.js +59 -0
  189. package/lib/module/components/Booking/ScheduleCallButton.js.map +1 -0
  190. package/lib/module/components/Booking/ScheduleCallSheet.js +345 -0
  191. package/lib/module/components/Booking/ScheduleCallSheet.js.map +1 -0
  192. package/lib/module/components/Booking/ScheduledCallCard.js +197 -0
  193. package/lib/module/components/Booking/ScheduledCallCard.js.map +1 -0
  194. package/lib/module/components/Booking/ScheduledCallHost.js +18 -0
  195. package/lib/module/components/Booking/ScheduledCallHost.js.map +1 -0
  196. package/lib/module/components/Booking/ScheduledCallMessage.js +48 -0
  197. package/lib/module/components/Booking/ScheduledCallMessage.js.map +1 -0
  198. package/lib/module/components/Booking/ScheduledCallPreJoin.js +229 -0
  199. package/lib/module/components/Booking/ScheduledCallPreJoin.js.map +1 -0
  200. package/lib/module/components/Booking/bookingShared.js +291 -0
  201. package/lib/module/components/Booking/bookingShared.js.map +1 -0
  202. package/lib/module/components/MainComponents/ChatHeader.js +2 -1
  203. package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
  204. package/lib/module/components/MainComponents/LanguageSelectorButton.js +5 -2
  205. package/lib/module/components/MainComponents/LanguageSelectorButton.js.map +1 -1
  206. package/lib/module/components/MainComponents/LanguageSelectorModal.js +7 -4
  207. package/lib/module/components/MainComponents/LanguageSelectorModal.js.map +1 -1
  208. package/lib/module/components/MainComponents/MessageContainer.js +13 -0
  209. package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
  210. package/lib/module/components/MainComponents/ReduxWrapper.js +10 -0
  211. package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
  212. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +21 -15
  213. package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
  214. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +17 -10
  215. package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
  216. package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
  217. package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
  218. package/lib/module/components/VideoCalls/ActiveCallBar.js +3 -2
  219. package/lib/module/components/VideoCalls/ActiveCallBar.js.map +1 -1
  220. package/lib/module/components/VideoCalls/CallButtons.js +19 -11
  221. package/lib/module/components/VideoCalls/CallButtons.js.map +1 -1
  222. package/lib/module/components/VideoCalls/CallControlBar.js +113 -0
  223. package/lib/module/components/VideoCalls/CallControlBar.js.map +1 -0
  224. package/lib/module/components/VideoCalls/CallVideo.js +43 -0
  225. package/lib/module/components/VideoCalls/CallVideo.js.map +1 -0
  226. package/lib/module/components/VideoCalls/GroupCallView.js +275 -0
  227. package/lib/module/components/VideoCalls/GroupCallView.js.map +1 -0
  228. package/lib/module/components/VideoCalls/P2PCallRunner.js +147 -0
  229. package/lib/module/components/VideoCalls/P2PCallRunner.js.map +1 -0
  230. package/lib/module/components/VideoCalls/VideoCallOverlay.js +38 -14
  231. package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -1
  232. package/lib/module/components/VideoCalls/VideoCallSession.js +46 -127
  233. package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
  234. package/lib/module/components/VideoCalls/callActions.js +3 -0
  235. package/lib/module/components/VideoCalls/callActions.js.map +1 -1
  236. package/lib/module/components/VideoCalls/callElapsed.js +33 -0
  237. package/lib/module/components/VideoCalls/callElapsed.js.map +1 -0
  238. package/lib/module/components/VideoCalls/callLive.js +10 -0
  239. package/lib/module/components/VideoCalls/callLive.js.map +1 -0
  240. package/lib/module/components/VideoCalls/callSessionController.js +80 -24
  241. package/lib/module/components/VideoCalls/callSessionController.js.map +1 -1
  242. package/lib/module/components/VideoCalls/callSessionTypes.js +37 -0
  243. package/lib/module/components/VideoCalls/callSessionTypes.js.map +1 -0
  244. package/lib/module/components/VideoCalls/groupLayout.js +36 -0
  245. package/lib/module/components/VideoCalls/groupLayout.js.map +1 -0
  246. package/lib/module/components/VideoCalls/p2pCallSession.js +256 -0
  247. package/lib/module/components/VideoCalls/p2pCallSession.js.map +1 -0
  248. package/lib/module/components/VideoCalls/useCallKeep.js +8 -2
  249. package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -1
  250. package/lib/module/components/VideoCalls/useOngoingCallNotification.js +2 -1
  251. package/lib/module/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
  252. package/lib/module/context/xmppProvider.js +2 -1
  253. package/lib/module/context/xmppProvider.js.map +1 -1
  254. package/lib/module/helpers/callPush.js +3 -1
  255. package/lib/module/helpers/callPush.js.map +1 -1
  256. package/lib/module/helpers/incomingCallFromPush.js +63 -7
  257. package/lib/module/helpers/incomingCallFromPush.js.map +1 -1
  258. package/lib/module/helpers/pushPayload.js +5 -0
  259. package/lib/module/helpers/pushPayload.js.map +1 -1
  260. package/lib/module/helpers/reportRoom.js +70 -0
  261. package/lib/module/helpers/reportRoom.js.map +1 -0
  262. package/lib/module/i18n/strings.js +444 -0
  263. package/lib/module/i18n/strings.js.map +1 -1
  264. package/lib/module/main.js +5 -0
  265. package/lib/module/main.js.map +1 -1
  266. package/lib/module/networking/api-requests/callState.api.js +66 -0
  267. package/lib/module/networking/api-requests/callState.api.js.map +1 -0
  268. package/lib/module/networking/api-requests/push.api.js +29 -6
  269. package/lib/module/networking/api-requests/push.api.js.map +1 -1
  270. package/lib/module/networking/api-requests/rooms.api.js +8 -2
  271. package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
  272. package/lib/module/networking/api-requests/scheduledCalls.api.js +130 -0
  273. package/lib/module/networking/api-requests/scheduledCalls.api.js.map +1 -0
  274. package/lib/module/networking/callTokenStanza.js +210 -50
  275. package/lib/module/networking/callTokenStanza.js.map +1 -1
  276. package/lib/module/roomStore/callSlice.js +57 -3
  277. package/lib/module/roomStore/callSlice.js.map +1 -1
  278. package/lib/module/services/appBadge.js +74 -0
  279. package/lib/module/services/appBadge.js.map +1 -0
  280. package/lib/module/services/languageSettings.js +44 -13
  281. package/lib/module/services/languageSettings.js.map +1 -1
  282. package/lib/module/services/pushRegistration.js +21 -5
  283. package/lib/module/services/pushRegistration.js.map +1 -1
  284. package/lib/module/version.js +1 -1
  285. package/lib/typescript/booking/index.d.ts +3 -0
  286. package/lib/typescript/booking/index.d.ts.map +1 -0
  287. package/lib/typescript/booking/pendingScheduledCall.d.ts +80 -0
  288. package/lib/typescript/booking/pendingScheduledCall.d.ts.map +1 -0
  289. package/lib/typescript/booking/scheduleForm.d.ts +28 -0
  290. package/lib/typescript/booking/scheduleForm.d.ts.map +1 -0
  291. package/lib/typescript/booking/scheduledCall.d.ts +52 -0
  292. package/lib/typescript/booking/scheduledCall.d.ts.map +1 -0
  293. package/lib/typescript/booking/scheduledCallActions.d.ts +22 -0
  294. package/lib/typescript/booking/scheduledCallActions.d.ts.map +1 -0
  295. package/lib/typescript/booking/scheduledCallLink.d.ts +37 -0
  296. package/lib/typescript/booking/scheduledCallLink.d.ts.map +1 -0
  297. package/lib/typescript/booking/scheduledCallStore.d.ts +47 -0
  298. package/lib/typescript/booking/scheduledCallStore.d.ts.map +1 -0
  299. package/lib/typescript/booking/startRoomCall.d.ts +12 -0
  300. package/lib/typescript/booking/startRoomCall.d.ts.map +1 -0
  301. package/lib/typescript/calls/callBusy.d.ts +9 -0
  302. package/lib/typescript/calls/callBusy.d.ts.map +1 -0
  303. package/lib/typescript/calls/callDisplay.d.ts +23 -0
  304. package/lib/typescript/calls/callDisplay.d.ts.map +1 -0
  305. package/lib/typescript/calls/callMode.d.ts +106 -0
  306. package/lib/typescript/calls/callMode.d.ts.map +1 -0
  307. package/lib/typescript/calls/declineReport.d.ts +11 -0
  308. package/lib/typescript/calls/declineReport.d.ts.map +1 -0
  309. package/lib/typescript/calls/p2p/P2PCallController.d.ts +150 -0
  310. package/lib/typescript/calls/p2p/P2PCallController.d.ts.map +1 -0
  311. package/lib/typescript/calls/p2p/icePolicy.d.ts +37 -0
  312. package/lib/typescript/calls/p2p/icePolicy.d.ts.map +1 -0
  313. package/lib/typescript/calls/p2p/negotiator.d.ts +57 -0
  314. package/lib/typescript/calls/p2p/negotiator.d.ts.map +1 -0
  315. package/lib/typescript/calls/p2p/p2pRuntime.d.ts +41 -0
  316. package/lib/typescript/calls/p2p/p2pRuntime.d.ts.map +1 -0
  317. package/lib/typescript/calls/p2p/signalInbox.d.ts +35 -0
  318. package/lib/typescript/calls/p2p/signalInbox.d.ts.map +1 -0
  319. package/lib/typescript/calls/p2p/signalStanza.d.ts +52 -0
  320. package/lib/typescript/calls/p2p/signalStanza.d.ts.map +1 -0
  321. package/lib/typescript/calls/p2p/webrtcRuntime.d.ts +32 -0
  322. package/lib/typescript/calls/p2p/webrtcRuntime.d.ts.map +1 -0
  323. package/lib/typescript/calls/senderTrust.d.ts +8 -0
  324. package/lib/typescript/calls/senderTrust.d.ts.map +1 -0
  325. package/lib/typescript/calls/startCall.d.ts +17 -0
  326. package/lib/typescript/calls/startCall.d.ts.map +1 -0
  327. package/lib/typescript/components/Booking/BookingIcons.d.ts +9 -0
  328. package/lib/typescript/components/Booking/BookingIcons.d.ts.map +1 -0
  329. package/lib/typescript/components/Booking/ScheduleCallButton.d.ts +11 -0
  330. package/lib/typescript/components/Booking/ScheduleCallButton.d.ts.map +1 -0
  331. package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts +4 -0
  332. package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts.map +1 -0
  333. package/lib/typescript/components/Booking/ScheduledCallCard.d.ts +14 -0
  334. package/lib/typescript/components/Booking/ScheduledCallCard.d.ts.map +1 -0
  335. package/lib/typescript/components/Booking/ScheduledCallHost.d.ts +10 -0
  336. package/lib/typescript/components/Booking/ScheduledCallHost.d.ts.map +1 -0
  337. package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts +20 -0
  338. package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts.map +1 -0
  339. package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts +8 -0
  340. package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts.map +1 -0
  341. package/lib/typescript/components/Booking/bookingShared.d.ts +199 -0
  342. package/lib/typescript/components/Booking/bookingShared.d.ts.map +1 -0
  343. package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
  344. package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts +3 -1
  345. package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts.map +1 -1
  346. package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts.map +1 -1
  347. package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
  348. package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
  349. package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -1
  350. package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
  351. package/lib/typescript/components/Modals/UserSettingsModal/LanguageCard.d.ts.map +1 -1
  352. package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts.map +1 -1
  353. package/lib/typescript/components/VideoCalls/CallButtons.d.ts +2 -1
  354. package/lib/typescript/components/VideoCalls/CallButtons.d.ts.map +1 -1
  355. package/lib/typescript/components/VideoCalls/CallControlBar.d.ts +17 -0
  356. package/lib/typescript/components/VideoCalls/CallControlBar.d.ts.map +1 -0
  357. package/lib/typescript/components/VideoCalls/CallVideo.d.ts +23 -0
  358. package/lib/typescript/components/VideoCalls/CallVideo.d.ts.map +1 -0
  359. package/lib/typescript/components/VideoCalls/GroupCallView.d.ts +22 -0
  360. package/lib/typescript/components/VideoCalls/GroupCallView.d.ts.map +1 -0
  361. package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts +2 -0
  362. package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts.map +1 -0
  363. package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -1
  364. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts +10 -12
  365. package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
  366. package/lib/typescript/components/VideoCalls/callActions.d.ts.map +1 -1
  367. package/lib/typescript/components/VideoCalls/callElapsed.d.ts +8 -0
  368. package/lib/typescript/components/VideoCalls/callElapsed.d.ts.map +1 -0
  369. package/lib/typescript/components/VideoCalls/callLive.d.ts +9 -0
  370. package/lib/typescript/components/VideoCalls/callLive.d.ts.map +1 -0
  371. package/lib/typescript/components/VideoCalls/callSessionController.d.ts +10 -31
  372. package/lib/typescript/components/VideoCalls/callSessionController.d.ts.map +1 -1
  373. package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts +60 -0
  374. package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts.map +1 -0
  375. package/lib/typescript/components/VideoCalls/groupLayout.d.ts +23 -0
  376. package/lib/typescript/components/VideoCalls/groupLayout.d.ts.map +1 -0
  377. package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts +31 -0
  378. package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts.map +1 -0
  379. package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -1
  380. package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts.map +1 -1
  381. package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
  382. package/lib/typescript/helpers/callPush.d.ts +11 -1
  383. package/lib/typescript/helpers/callPush.d.ts.map +1 -1
  384. package/lib/typescript/helpers/incomingCallFromPush.d.ts.map +1 -1
  385. package/lib/typescript/helpers/pushPayload.d.ts +1 -1
  386. package/lib/typescript/helpers/pushPayload.d.ts.map +1 -1
  387. package/lib/typescript/helpers/reportRoom.d.ts +19 -0
  388. package/lib/typescript/helpers/reportRoom.d.ts.map +1 -0
  389. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  390. package/lib/typescript/main.d.ts +6 -1
  391. package/lib/typescript/main.d.ts.map +1 -1
  392. package/lib/typescript/networking/api-requests/callState.api.d.ts +25 -0
  393. package/lib/typescript/networking/api-requests/callState.api.d.ts.map +1 -0
  394. package/lib/typescript/networking/api-requests/push.api.d.ts +9 -2
  395. package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
  396. package/lib/typescript/networking/api-requests/rooms.api.d.ts +2 -1
  397. package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
  398. package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts +86 -0
  399. package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts.map +1 -0
  400. package/lib/typescript/networking/callTokenStanza.d.ts.map +1 -1
  401. package/lib/typescript/roomStore/callSlice.d.ts +23 -1
  402. package/lib/typescript/roomStore/callSlice.d.ts.map +1 -1
  403. package/lib/typescript/services/appBadge.d.ts +3 -0
  404. package/lib/typescript/services/appBadge.d.ts.map +1 -0
  405. package/lib/typescript/services/languageSettings.d.ts +7 -0
  406. package/lib/typescript/services/languageSettings.d.ts.map +1 -1
  407. package/lib/typescript/services/pushRegistration.d.ts.map +1 -1
  408. package/lib/typescript/types/types.d.ts +67 -4
  409. package/lib/typescript/types/types.d.ts.map +1 -1
  410. package/lib/typescript/version.d.ts +1 -1
  411. package/package.json +1 -1
  412. package/src/booking/index.ts +10 -0
  413. package/src/booking/pendingScheduledCall.ts +272 -0
  414. package/src/booking/scheduleForm.ts +84 -0
  415. package/src/booking/scheduledCall.ts +163 -0
  416. package/src/booking/scheduledCallActions.ts +141 -0
  417. package/src/booking/scheduledCallLink.ts +145 -0
  418. package/src/booking/scheduledCallStore.ts +69 -0
  419. package/src/booking/startRoomCall.ts +103 -0
  420. package/src/calls/callBusy.ts +10 -0
  421. package/src/calls/callDisplay.ts +74 -0
  422. package/src/calls/callMode.ts +286 -0
  423. package/src/calls/declineReport.ts +16 -0
  424. package/src/calls/p2p/P2PCallController.ts +813 -0
  425. package/src/calls/p2p/icePolicy.ts +99 -0
  426. package/src/calls/p2p/negotiator.ts +186 -0
  427. package/src/calls/p2p/p2pRuntime.ts +164 -0
  428. package/src/calls/p2p/signalInbox.ts +117 -0
  429. package/src/calls/p2p/signalStanza.ts +205 -0
  430. package/src/calls/p2p/webrtcRuntime.ts +60 -0
  431. package/src/calls/senderTrust.ts +40 -0
  432. package/src/calls/startCall.ts +56 -0
  433. package/src/components/Booking/BookingIcons.tsx +44 -0
  434. package/src/components/Booking/ScheduleCallButton.tsx +66 -0
  435. package/src/components/Booking/ScheduleCallSheet.tsx +380 -0
  436. package/src/components/Booking/ScheduledCallCard.tsx +216 -0
  437. package/src/components/Booking/ScheduledCallHost.tsx +18 -0
  438. package/src/components/Booking/ScheduledCallMessage.tsx +62 -0
  439. package/src/components/Booking/ScheduledCallPreJoin.tsx +230 -0
  440. package/src/components/Booking/bookingShared.tsx +295 -0
  441. package/src/components/MainComponents/ChatHeader.tsx +2 -0
  442. package/src/components/MainComponents/LanguageSelectorButton.tsx +9 -2
  443. package/src/components/MainComponents/LanguageSelectorModal.tsx +10 -6
  444. package/src/components/MainComponents/MessageContainer.tsx +15 -0
  445. package/src/components/MainComponents/ReduxWrapper.tsx +10 -0
  446. package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +22 -22
  447. package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +28 -9
  448. package/src/components/Modals/UserSettingsModal/LanguageCard.tsx +9 -7
  449. package/src/components/VideoCalls/ActiveCallBar.tsx +6 -5
  450. package/src/components/VideoCalls/CallButtons.tsx +23 -12
  451. package/src/components/VideoCalls/CallControlBar.tsx +131 -0
  452. package/src/components/VideoCalls/CallVideo.tsx +59 -0
  453. package/src/components/VideoCalls/GroupCallView.tsx +324 -0
  454. package/src/components/VideoCalls/P2PCallRunner.tsx +192 -0
  455. package/src/components/VideoCalls/VideoCallOverlay.tsx +62 -17
  456. package/src/components/VideoCalls/VideoCallSession.tsx +55 -133
  457. package/src/components/VideoCalls/callActions.ts +3 -0
  458. package/src/components/VideoCalls/callElapsed.ts +27 -0
  459. package/src/components/VideoCalls/callLive.ts +13 -0
  460. package/src/components/VideoCalls/callSessionController.ts +130 -55
  461. package/src/components/VideoCalls/callSessionTypes.ts +80 -0
  462. package/src/components/VideoCalls/groupLayout.ts +48 -0
  463. package/src/components/VideoCalls/p2pCallSession.ts +291 -0
  464. package/src/components/VideoCalls/useCallKeep.ts +9 -2
  465. package/src/components/VideoCalls/useOngoingCallNotification.ts +2 -2
  466. package/src/context/xmppProvider.tsx +3 -0
  467. package/src/helpers/callPush.ts +13 -1
  468. package/src/helpers/incomingCallFromPush.ts +65 -7
  469. package/src/helpers/pushPayload.ts +9 -1
  470. package/src/helpers/reportRoom.ts +93 -0
  471. package/src/i18n/strings.ts +444 -0
  472. package/src/main.ts +33 -0
  473. package/src/networking/api-requests/callState.api.ts +83 -0
  474. package/src/networking/api-requests/push.api.ts +28 -3
  475. package/src/networking/api-requests/rooms.api.ts +12 -3
  476. package/src/networking/api-requests/scheduledCalls.api.ts +232 -0
  477. package/src/networking/callTokenStanza.ts +247 -50
  478. package/src/roomStore/callSlice.ts +86 -2
  479. package/src/services/appBadge.ts +85 -0
  480. package/src/services/languageSettings.ts +43 -8
  481. package/src/services/pushRegistration.ts +34 -3
  482. package/src/types/types.ts +70 -4
  483. package/src/version.ts +1 -1
@@ -0,0 +1,230 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
+ import { useSelector } from 'react-redux';
4
+ import type { RootState } from '../../roomStore';
5
+ import { useChatSettingState } from '../../hooks/useChatSettingState';
6
+ import { useT, useUiLocale } from '../../i18n/useT';
7
+ import {
8
+ scheduledCallUi,
9
+ useScheduledCallUi,
10
+ type PreJoinState,
11
+ } from '../../booking/scheduledCallStore';
12
+ import {
13
+ JOIN_WINDOW_BEFORE_MS,
14
+ chatNameOfRoom,
15
+ type ScheduledCallCardData,
16
+ } from '../../booking/scheduledCall';
17
+ import {
18
+ canManageScheduledCall,
19
+ confirmAndCancelScheduledCall,
20
+ joinScheduledCall,
21
+ } from '../../booking/scheduledCallActions';
22
+ import { formatClock } from '../../booking/scheduleForm';
23
+ import {
24
+ BookingSheet,
25
+ CalendarButtons,
26
+ PrimaryButton,
27
+ StatePill,
28
+ describeWhen,
29
+ stateLabelKey,
30
+ useBookingStyles,
31
+ useScheduledCallState,
32
+ } from './bookingShared';
33
+
34
+ const ERROR_KEYS = {
35
+ 'not-a-member': 'booking.error.notMember',
36
+ 'not-found': 'booking.error.notFound',
37
+ cancelled: 'booking.error.cancelled',
38
+ network: 'booking.error.failed',
39
+ } as const;
40
+
41
+ const Ready: React.FC<{
42
+ detail: Extract<PreJoinState, { phase: 'ready' }>['detail'];
43
+ }> = ({ detail }) => {
44
+ const t = useT();
45
+ const locale = useUiLocale();
46
+ const { theme } = useBookingStyles();
47
+ const { user, config } = useChatSettingState();
48
+ const scheduledCalls = config?.scheduledCalls;
49
+ const call = detail.scheduledCall;
50
+ const roomJid = detail.chat?.jid || call.chatName;
51
+ const roomRole = useSelector(
52
+ (state: RootState) =>
53
+ Object.values(state.rooms.rooms).find(
54
+ (room) => chatNameOfRoom(room?.jid || '') === chatNameOfRoom(roomJid)
55
+ )?.role
56
+ );
57
+
58
+ const card: ScheduledCallCardData = {
59
+ slug: call.slug,
60
+ title: call.title,
61
+ startAt: call.startAt,
62
+ startMs: Date.parse(call.startAt),
63
+ durationMinutes: call.durationMinutes,
64
+ kind: call.kind === 'audio' ? 'audio' : 'video',
65
+ status: call.status === 'cancelled' ? 'cancelled' : 'scheduled',
66
+ joinUrl: detail.links.join,
67
+ icsUrl: detail.links.ics || '',
68
+ googleUrl: detail.links.google || '',
69
+ outlookUrl: detail.links.outlook || '',
70
+ createdBy: call.createdBy || '',
71
+ };
72
+ const { state, now } = useScheduledCallState(card);
73
+ const [joining, setJoining] = useState(false);
74
+ const joinAllowed = scheduledCalls?.enabled !== false;
75
+
76
+ const canManage =
77
+ (state === 'upcoming' || state === 'joinable') &&
78
+ canManageScheduledCall({
79
+ createdBy: call.createdBy,
80
+ userId: user?._id,
81
+ roomRole,
82
+ });
83
+
84
+ return (
85
+ <>
86
+ <View style={styles.row}>
87
+ <Text
88
+ testID="prejoin-title"
89
+ style={[styles.callTitle, { color: theme.text }]}
90
+ numberOfLines={3}
91
+ >
92
+ {call.title || t('call.title')}
93
+ </Text>
94
+ <StatePill
95
+ label={t(stateLabelKey(state, card.startMs, now))}
96
+ tone={state === 'joinable' ? 'active' : 'neutral'}
97
+ />
98
+ </View>
99
+ <Text testID="prejoin-when" style={{ color: theme.textSecondary, fontSize: 14 }}>
100
+ {describeWhen(card, t, locale)}
101
+ </Text>
102
+ <Text style={{ color: theme.textSecondary, fontSize: 12 }}>
103
+ {card.kind === 'audio' ? t('call.audioCall') : t('call.videoCall')}
104
+ </Text>
105
+ {!!call.description && (
106
+ <Text style={{ color: theme.text, fontSize: 14 }}>{call.description}</Text>
107
+ )}
108
+
109
+ {joinAllowed && (
110
+ <PrimaryButton
111
+ testID="prejoin-join"
112
+ label={t('booking.action.join')}
113
+ disabled={state !== 'joinable'}
114
+ busy={joining}
115
+ onPress={() => {
116
+ setJoining(true);
117
+ joinScheduledCall(roomJid, card.kind)
118
+ .then((started) => {
119
+ if (started) {scheduledCallUi.closePreJoin();}
120
+ })
121
+ .finally(() => setJoining(false));
122
+ }}
123
+ />
124
+ )}
125
+ <Text style={{ color: theme.textMuted, fontSize: 12, textAlign: 'center' }}>
126
+ {state === 'upcoming'
127
+ ? t('booking.prejoin.joinFrom', {
128
+ time: formatClock(card.startMs - JOIN_WINDOW_BEFORE_MS, locale),
129
+ })
130
+ : t('booking.prejoin.hint')}
131
+ </Text>
132
+
133
+ {(state === 'upcoming' || state === 'joinable') && (
134
+ <CalendarButtons
135
+ t={t}
136
+ googleUrl={card.googleUrl}
137
+ outlookUrl={card.outlookUrl}
138
+ icsUrl={card.icsUrl}
139
+ testIDPrefix="prejoin"
140
+ />
141
+ )}
142
+
143
+ {canManage && (
144
+ <View style={styles.row}>
145
+ <View style={styles.half}>
146
+ <PrimaryButton
147
+ testID="prejoin-edit"
148
+ tone="plain"
149
+ label={t('booking.action.edit')}
150
+ onPress={() => {
151
+ scheduledCallUi.closePreJoin();
152
+ scheduledCallUi.openEdit(roomJid, detail);
153
+ }}
154
+ />
155
+ </View>
156
+ <View style={styles.half}>
157
+ <PrimaryButton
158
+ testID="prejoin-cancel"
159
+ tone="plain"
160
+ label={t('booking.action.cancelCall')}
161
+ onPress={() => {
162
+ void confirmAndCancelScheduledCall(call.slug).then((done) => {
163
+ if (done) {scheduledCallUi.closePreJoin();}
164
+ });
165
+ }}
166
+ />
167
+ </View>
168
+ </View>
169
+ )}
170
+ </>
171
+ );
172
+ };
173
+
174
+ /**
175
+ * The pre-join screen of a call opened from a link or a reminder: what the
176
+ * call is, and a Join button. Nothing is started until Join is tapped.
177
+ */
178
+ export const ScheduledCallPreJoin: React.FC = () => {
179
+ const { preJoin } = useScheduledCallUi();
180
+ const t = useT();
181
+ const { theme } = useBookingStyles();
182
+ // Hold the last content while the modal fades out.
183
+ const [shown, setShown] = useState<PreJoinState | null>(preJoin);
184
+ useEffect(() => {
185
+ if (preJoin) {setShown(preJoin);}
186
+ }, [preJoin]);
187
+ if (!shown) {return null;}
188
+
189
+ return (
190
+ <BookingSheet
191
+ visible={!!preJoin}
192
+ onClose={scheduledCallUi.closePreJoin}
193
+ title={t('booking.prejoin.title')}
194
+ testID="prejoin-sheet"
195
+ >
196
+ {shown.phase === 'loading' && (
197
+ <Text testID="prejoin-loading" style={{ color: theme.textSecondary }}>
198
+ {t('call.connecting')}
199
+ </Text>
200
+ )}
201
+ {shown.phase === 'error' && (
202
+ <>
203
+ {shown.title ? (
204
+ <Text style={{ color: theme.text, fontWeight: '600', fontSize: 16 }}>
205
+ {shown.title}
206
+ </Text>
207
+ ) : null}
208
+ <Text testID="prejoin-error" style={{ color: theme.danger, fontSize: 15 }}>
209
+ {t(ERROR_KEYS[shown.reason])}
210
+ </Text>
211
+ <PrimaryButton
212
+ testID="prejoin-close"
213
+ tone="plain"
214
+ label={t('booking.action.close')}
215
+ onPress={scheduledCallUi.closePreJoin}
216
+ />
217
+ </>
218
+ )}
219
+ {shown.phase === 'ready' && <Ready detail={shown.detail} />}
220
+ </BookingSheet>
221
+ );
222
+ };
223
+
224
+ const styles = StyleSheet.create({
225
+ row: { flexDirection: 'row', alignItems: 'center', gap: 8 },
226
+ callTitle: { flex: 1, fontSize: 18, fontWeight: '600' },
227
+ half: { flex: 1 },
228
+ });
229
+
230
+ export default ScheduledCallPreJoin;
@@ -0,0 +1,295 @@
1
+ import React, { useEffect, useMemo, useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ KeyboardAvoidingView,
5
+ Modal,
6
+ Platform,
7
+ ScrollView,
8
+ StyleSheet,
9
+ Text,
10
+ TouchableOpacity,
11
+ View,
12
+ } from 'react-native';
13
+ import { useTheme } from '../../hooks/useTheme';
14
+ import type { ChatTheme } from '../../theme/theme';
15
+ import {
16
+ MAX_TIMER_MS,
17
+ getScheduledCallCardState,
18
+ nextScheduledCallTransition,
19
+ type ScheduledCallCardData,
20
+ type ScheduledCallCardState,
21
+ } from '../../booking/scheduledCall';
22
+ import { openBackendLink } from '../../booking/scheduledCallActions';
23
+ import { formatClock, formatDay } from '../../booking/scheduleForm';
24
+
25
+ type T = (key: string, vars?: Record<string, string | number>) => string;
26
+
27
+ /**
28
+ * The card's state, re-evaluated when it changes on its own (the join
29
+ * window opens, the call ends) instead of on a poll.
30
+ */
31
+ export const useScheduledCallState = (
32
+ card: Pick<
33
+ ScheduledCallCardData,
34
+ 'startMs' | 'durationMinutes' | 'status'
35
+ >
36
+ ): { state: ScheduledCallCardState; now: number } => {
37
+ const [now, setNow] = useState(() => Date.now());
38
+ const { startMs, durationMinutes, status } = card;
39
+
40
+ useEffect(() => {
41
+ setNow(Date.now());
42
+ }, [startMs, durationMinutes, status]);
43
+
44
+ useEffect(() => {
45
+ const at = nextScheduledCallTransition(
46
+ { startMs, durationMinutes, status },
47
+ now
48
+ );
49
+ if (at === null) {return undefined;}
50
+ // A timer can fire a hair early; the +50 ms keeps the re-check past it.
51
+ const wait = Math.min(MAX_TIMER_MS, Math.max(1000, at - Date.now() + 50));
52
+ const timer = setTimeout(() => setNow(Date.now()), wait);
53
+ return () => clearTimeout(timer);
54
+ }, [startMs, durationMinutes, status, now]);
55
+
56
+ return { state: getScheduledCallCardState(card, now), now };
57
+ };
58
+
59
+ export const stateLabelKey = (
60
+ state: ScheduledCallCardState,
61
+ startMs: number,
62
+ now: number
63
+ ): string => {
64
+ switch (state) {
65
+ case 'cancelled':
66
+ return 'booking.state.cancelled';
67
+ case 'ended':
68
+ return 'booking.state.ended';
69
+ case 'joinable':
70
+ return now >= startMs
71
+ ? 'booking.state.inProgress'
72
+ : 'booking.state.startingSoon';
73
+ default:
74
+ return 'booking.state.upcoming';
75
+ }
76
+ };
77
+
78
+ export const describeWhen = (
79
+ card: Pick<ScheduledCallCardData, 'startMs' | 'durationMinutes'>,
80
+ t: T,
81
+ locale?: string
82
+ ): string =>
83
+ `${t('booking.card.starts', {
84
+ date: formatDay(card.startMs, locale),
85
+ time: formatClock(card.startMs, locale),
86
+ })} · ${t('booking.duration.minutes', { n: card.durationMinutes })}`;
87
+
88
+ export const useBookingStyles = () => {
89
+ const theme = useTheme();
90
+ return useMemo(() => ({ theme, styles: createStyles(theme) }), [theme]);
91
+ };
92
+
93
+ export const StatePill: React.FC<{
94
+ label: string;
95
+ tone: 'neutral' | 'active' | 'danger';
96
+ }> = ({ label, tone }) => {
97
+ const { theme, styles } = useBookingStyles();
98
+ const color =
99
+ tone === 'active'
100
+ ? theme.success
101
+ : tone === 'danger'
102
+ ? theme.danger
103
+ : theme.textSecondary;
104
+ return (
105
+ <View style={[styles.pill, { borderColor: color }]}>
106
+ <Text style={[styles.pillText, { color }]}>{label}</Text>
107
+ </View>
108
+ );
109
+ };
110
+
111
+ /** Add to Google / Outlook / .ics: the backend's links, opened as they are. */
112
+ export const CalendarButtons: React.FC<{
113
+ t: T;
114
+ googleUrl?: string;
115
+ outlookUrl?: string;
116
+ icsUrl?: string;
117
+ testIDPrefix?: string;
118
+ }> = ({ t, googleUrl, outlookUrl, icsUrl, testIDPrefix = 'booking' }) => {
119
+ const { theme, styles } = useBookingStyles();
120
+ const items: Array<[string, string, string | undefined]> = [
121
+ ['google', 'booking.calendar.google', googleUrl],
122
+ ['outlook', 'booking.calendar.outlook', outlookUrl],
123
+ ['ics', 'booking.calendar.ics', icsUrl],
124
+ ];
125
+ const available = items.filter(([, , url]) => !!url);
126
+ if (available.length === 0) {return null;}
127
+ return (
128
+ <View>
129
+ <Text style={styles.sectionLabel}>{t('booking.calendar.add')}</Text>
130
+ <View style={styles.calendarRow}>
131
+ {available.map(([id, labelKey, url]) => (
132
+ <TouchableOpacity
133
+ key={id}
134
+ testID={`${testIDPrefix}-calendar-${id}`}
135
+ accessibilityRole="link"
136
+ activeOpacity={0.7}
137
+ onPress={() => {
138
+ void openBackendLink(url);
139
+ }}
140
+ style={[styles.calendarButton, { borderColor: theme.border }]}
141
+ >
142
+ <Text style={[styles.calendarLabel, { color: theme.primary }]}>
143
+ {t(labelKey)}
144
+ </Text>
145
+ </TouchableOpacity>
146
+ ))}
147
+ </View>
148
+ </View>
149
+ );
150
+ };
151
+
152
+ /** Bottom sheet shell shared by the editor and the pre-join sheet. */
153
+ export const BookingSheet: React.FC<{
154
+ visible: boolean;
155
+ onClose: () => void;
156
+ title: string;
157
+ testID?: string;
158
+ children: React.ReactNode;
159
+ }> = ({ visible, onClose, title, testID, children }) => {
160
+ const { styles } = useBookingStyles();
161
+ return (
162
+ <Modal
163
+ transparent
164
+ visible={visible}
165
+ animationType="fade"
166
+ onRequestClose={onClose}
167
+ statusBarTranslucent
168
+ >
169
+ <KeyboardAvoidingView
170
+ style={styles.backdrop}
171
+ behavior={Platform.OS === 'ios' ? 'padding' : undefined}
172
+ >
173
+ <TouchableOpacity
174
+ testID={testID ? `${testID}-backdrop` : undefined}
175
+ style={StyleSheet.absoluteFill}
176
+ activeOpacity={1}
177
+ onPress={onClose}
178
+ />
179
+ <View style={styles.sheet} testID={testID}>
180
+ <View style={styles.grabber} />
181
+ <Text style={styles.sheetTitle} accessibilityRole="header">
182
+ {title}
183
+ </Text>
184
+ <ScrollView
185
+ keyboardShouldPersistTaps="handled"
186
+ showsVerticalScrollIndicator={false}
187
+ contentContainerStyle={styles.sheetBody}
188
+ >
189
+ {children}
190
+ </ScrollView>
191
+ </View>
192
+ </KeyboardAvoidingView>
193
+ </Modal>
194
+ );
195
+ };
196
+
197
+ export const PrimaryButton: React.FC<{
198
+ label: string;
199
+ onPress: () => void;
200
+ disabled?: boolean;
201
+ busy?: boolean;
202
+ tone?: 'primary' | 'danger' | 'plain';
203
+ testID?: string;
204
+ }> = ({ label, onPress, disabled, busy, tone = 'primary', testID }) => {
205
+ const { theme, styles } = useBookingStyles();
206
+ const background =
207
+ tone === 'primary'
208
+ ? theme.primary
209
+ : tone === 'danger'
210
+ ? theme.danger
211
+ : theme.surfaceSecondary;
212
+ const color = tone === 'plain' ? theme.text : theme.textOnPrimary;
213
+ return (
214
+ <TouchableOpacity
215
+ testID={testID}
216
+ accessibilityRole="button"
217
+ accessibilityState={{ disabled: !!disabled }}
218
+ activeOpacity={0.8}
219
+ disabled={disabled || busy}
220
+ onPress={onPress}
221
+ style={[
222
+ styles.button,
223
+ { backgroundColor: background, opacity: disabled ? 0.45 : 1 },
224
+ ]}
225
+ >
226
+ {busy ? (
227
+ <ActivityIndicator color={color} />
228
+ ) : (
229
+ <Text style={[styles.buttonText, { color }]}>{label}</Text>
230
+ )}
231
+ </TouchableOpacity>
232
+ );
233
+ };
234
+
235
+ export const createStyles = (theme: ChatTheme) =>
236
+ StyleSheet.create({
237
+ pill: {
238
+ borderWidth: 1,
239
+ borderRadius: 10,
240
+ paddingHorizontal: 8,
241
+ paddingVertical: 2,
242
+ },
243
+ pillText: { fontSize: 11, fontWeight: '600' },
244
+ sectionLabel: {
245
+ fontSize: 12,
246
+ fontWeight: '600',
247
+ color: theme.textSecondary,
248
+ marginBottom: 6,
249
+ },
250
+ calendarRow: { flexDirection: 'row', flexWrap: 'wrap', gap: 8 },
251
+ calendarButton: {
252
+ borderWidth: 1,
253
+ borderRadius: 16,
254
+ paddingHorizontal: 12,
255
+ paddingVertical: 6,
256
+ },
257
+ calendarLabel: { fontSize: 13, fontWeight: '500' },
258
+ backdrop: {
259
+ flex: 1,
260
+ backgroundColor: theme.overlay,
261
+ justifyContent: 'flex-end',
262
+ },
263
+ sheet: {
264
+ backgroundColor: theme.surface,
265
+ borderTopLeftRadius: 20,
266
+ borderTopRightRadius: 20,
267
+ paddingHorizontal: 20,
268
+ paddingTop: 8,
269
+ paddingBottom: 24,
270
+ maxHeight: '90%',
271
+ },
272
+ grabber: {
273
+ alignSelf: 'center',
274
+ width: 40,
275
+ height: 4,
276
+ borderRadius: 2,
277
+ backgroundColor: theme.divider,
278
+ marginBottom: 12,
279
+ },
280
+ sheetTitle: {
281
+ fontSize: 18,
282
+ fontWeight: '600',
283
+ color: theme.text,
284
+ marginBottom: 12,
285
+ },
286
+ sheetBody: { gap: 14, paddingBottom: 8 },
287
+ button: {
288
+ minHeight: 44,
289
+ borderRadius: 12,
290
+ alignItems: 'center',
291
+ justifyContent: 'center',
292
+ paddingHorizontal: 16,
293
+ },
294
+ buttonText: { fontSize: 15, fontWeight: '600' },
295
+ });
@@ -15,6 +15,7 @@ import { ProfileImagePlaceholder } from './ProfileImagePlaceholder';
15
15
  import Button from '../styled/Button';
16
16
  import { BackIcon, BurgerMenuIcon, LockIcon } from '../../assets/icons';
17
17
  import { CallButtons } from '../VideoCalls/CallButtons';
18
+ import { ScheduleCallButton } from '../Booking/ScheduleCallButton';
18
19
  import { HeaderCallBar } from '../VideoCalls/ActiveCallBar';
19
20
  import { LanguageSelectorButton } from './LanguageSelectorButton';
20
21
  import { MessageSearchButton } from './MessageSearchButton';
@@ -258,6 +259,7 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
258
259
  1:1 room, so it costs non-call hosts nothing. */}
259
260
  <MessageSearchButton />
260
261
  <LanguageSelectorButton />
262
+ <ScheduleCallButton />
261
263
  <CallButtons />
262
264
  {!config?.disableChatInfo?.disableRoomMenu && (
263
265
  <RoomMenu handleLeaveClick={handleLeaveClick} />
@@ -3,6 +3,7 @@ import { StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import { useChatSettingState } from '../../hooks/useChatSettingState';
4
4
  import { getIconColor } from '../../helpers/getIconColor';
5
5
  import { useT } from '../../i18n/useT';
6
+ import { installTranslateLanguages } from '../../services/languageSettings';
6
7
  import { GlobeIcon, LanguageSelectorModal } from './LanguageSelectorModal';
7
8
 
8
9
  /**
@@ -11,7 +12,9 @@ import { GlobeIcon, LanguageSelectorModal } from './LanguageSelectorModal';
11
12
  * Renders only when translation is on. A host that drives the reader's
12
13
  * language from its own settings screen (via `config.translates
13
14
  * .readerLocale`) can hide this with `showLanguageSelector: false` rather
14
- * than shipping two competing controls.
15
+ * than shipping two competing controls. An install whose get-config
16
+ * reports no translate languages (`translates.languages: []`) has no
17
+ * translation server, so there is nothing to pick either.
15
18
  */
16
19
  export const LanguageSelectorButton: FC = () => {
17
20
  const { config } = useChatSettingState();
@@ -20,7 +23,11 @@ export const LanguageSelectorButton: FC = () => {
20
23
 
21
24
  const translates = config?.translates;
22
25
  const enabled = Boolean(translates?.enabled || config?.enableTranslates);
23
- if (!enabled || translates?.showLanguageSelector === false) {
26
+ if (
27
+ !enabled ||
28
+ translates?.showLanguageSelector === false ||
29
+ installTranslateLanguages(config)?.length === 0
30
+ ) {
24
31
  return null;
25
32
  }
26
33
 
@@ -1,4 +1,4 @@
1
- import React, { FC, useCallback } from 'react';
1
+ import React, { FC, useCallback, useMemo } from 'react';
2
2
  import {
3
3
  Modal,
4
4
  Pressable,
@@ -15,7 +15,7 @@ import {
15
15
  setTranslateMode,
16
16
  } from '../../roomStore/chatSettingsSlice';
17
17
  import { useChatSettingState } from '../../hooks/useChatSettingState';
18
- import { LANGUAGE_OPTIONS } from '../../helpers/constants/LANGUAGE_OPTIONS';
18
+ import { chatLanguageChoices } from '../../services/languageSettings';
19
19
  import { Iso639_1Codes } from '../../types/models/language.model';
20
20
  import {
21
21
  canReaderChooseTranslateMode,
@@ -79,12 +79,16 @@ export const LanguageSelectorModal: FC<{
79
79
  const translates = config?.translates;
80
80
  const effectiveMode = resolveTranslateMode(translates, translateMode);
81
81
  const showModeSwitcher = canReaderChooseTranslateMode(translates);
82
- const showLanguageList = translates?.showLanguageList !== false;
82
+ // The install's translateLanguages (get-config) when the host passed
83
+ // them, the built-in list otherwise; empty hides the list.
84
+ const languageChoices = useMemo(() => chatLanguageChoices(config), [config]);
85
+ const showLanguageList =
86
+ translates?.showLanguageList !== false && languageChoices.length > 0;
83
87
  const activeLocale = translates?.readerLocale || langSource;
84
88
 
85
89
  const selectLanguage = useCallback(
86
- (id: Iso639_1Codes) => {
87
- dispatch(setLangSource(id));
90
+ (id: string) => {
91
+ dispatch(setLangSource(id as Iso639_1Codes));
88
92
  onClose();
89
93
  },
90
94
  [dispatch, onClose]
@@ -166,7 +170,7 @@ export const LanguageSelectorModal: FC<{
166
170
  {t('language.select')}
167
171
  </Text>
168
172
  <ScrollView style={styles.list}>
169
- {LANGUAGE_OPTIONS.map((option) => {
173
+ {languageChoices.map((option) => {
170
174
  // Compare on the base language so a reader on "fr" still
171
175
  // sees "Français" (id fr-CA) ticked.
172
176
  const selected =
@@ -10,6 +10,8 @@ import {
10
10
  import { View } from 'react-native';
11
11
  import { useT } from '../../i18n/useT';
12
12
  import { formatCallLogLabel } from '../../helpers/callLogMessage';
13
+ import { isScheduledCallMessage } from '../../booking/scheduledCall';
14
+ import ScheduledCallMessage from '../Booking/ScheduledCallMessage';
13
15
 
14
16
  interface MessageContainerProps {
15
17
  CustomMessage?: React.ComponentType<{
@@ -54,6 +56,19 @@ const MessageContainerImpl: FC<MessageContainerProps> = ({
54
56
 
55
57
  const messageDate = new Date(message.date);
56
58
 
59
+ // Before the system-message branch: the backend sends the invite from the
60
+ // system account, but it is a card, not a centred pill.
61
+ if (isScheduledCallMessage(message)) {
62
+ return (
63
+ <ScheduledCallMessage
64
+ message={message}
65
+ config={config}
66
+ showDateLabel={showDateLabel}
67
+ CustomDaySeparator={CustomDaySeparator}
68
+ />
69
+ );
70
+ }
71
+
57
72
  if (message?.isSystemMessage === 'true') {
58
73
  const SystemMessageComponent = config?.customSystemMessage;
59
74
  return (
@@ -26,7 +26,9 @@ import '../../helpers/storeConsole';
26
26
  import {installPromiseRejectionTracker} from '../../utils/installPromiseRejectionTracker';
27
27
  import {useChatFonts} from '../../hooks/useChatFonts';
28
28
  import {installPushTokenHook} from '../../services/pushRegistration';
29
+ import {installAppBadgeSync} from '../../services/appBadge';
29
30
  import {setE2eeEnabled} from '../../e2ee';
31
+ import {installScheduledCallHook} from '../../booking/pendingScheduledCall';
30
32
 
31
33
  const gestureRootStyle = {flex: 1};
32
34
 
@@ -41,6 +43,14 @@ installPromiseRejectionTracker();
41
43
  // (one store subscription), no-op for hosts that never use push.
42
44
  installPushTokenHook();
43
45
 
46
+ // The server sets the icon badge only with a push; in the foreground it
47
+ // follows the unread total instead, so opening the app clears a stale one.
48
+ installAppBadgeSync();
49
+
50
+ // Arms the scheduled-call link watcher: a link held before sign-in or before
51
+ // the chat was up opens as soon as both are true.
52
+ installScheduledCallHook();
53
+
44
54
  interface ChatWrapperProps {
45
55
  token?: string;
46
56
  roomJID?: string;