Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

middleware.ts 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /* eslint-disable lines-around-comment */
  2. import debounce from 'lodash/debounce';
  3. import { NativeEventEmitter, NativeModules } from 'react-native';
  4. import { AnyAction } from 'redux';
  5. // @ts-expect-error
  6. import { ENDPOINT_TEXT_MESSAGE_NAME } from '../../../../modules/API/constants';
  7. import { appNavigate } from '../../app/actions.native';
  8. import { IStore } from '../../app/types';
  9. import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app/actionTypes';
  10. import {
  11. AUDIO_MUTED_CHANGED,
  12. CONFERENCE_BLURRED,
  13. CONFERENCE_FAILED,
  14. CONFERENCE_FOCUSED,
  15. CONFERENCE_JOINED,
  16. CONFERENCE_LEFT,
  17. CONFERENCE_WILL_JOIN,
  18. SET_ROOM,
  19. VIDEO_MUTED_CHANGED
  20. } from '../../base/conference/actionTypes';
  21. import { JITSI_CONFERENCE_URL_KEY } from '../../base/conference/constants';
  22. import {
  23. forEachConference,
  24. getCurrentConference,
  25. isRoomValid
  26. } from '../../base/conference/functions';
  27. import { IJitsiConference } from '../../base/conference/reducer';
  28. import { CONNECTION_DISCONNECTED } from '../../base/connection/actionTypes';
  29. import {
  30. JITSI_CONNECTION_CONFERENCE_KEY,
  31. JITSI_CONNECTION_URL_KEY
  32. } from '../../base/connection/constants';
  33. import { getURLWithoutParams } from '../../base/connection/utils';
  34. import {
  35. JitsiConferenceEvents } from '../../base/lib-jitsi-meet';
  36. import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../../base/media/actionTypes';
  37. import { toggleCameraFacingMode } from '../../base/media/actions';
  38. import { MEDIA_TYPE, VIDEO_TYPE } from '../../base/media/constants';
  39. import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../../base/participants/actionTypes';
  40. import {
  41. getLocalParticipant,
  42. getParticipantById,
  43. getRemoteParticipants,
  44. isScreenShareParticipantById
  45. } from '../../base/participants/functions';
  46. import MiddlewareRegistry from '../../base/redux/MiddlewareRegistry';
  47. import StateListenerRegistry from '../../base/redux/StateListenerRegistry';
  48. import { toggleScreensharing } from '../../base/tracks/actions.native';
  49. import { getLocalTracks, isLocalTrackMuted } from '../../base/tracks/functions.native';
  50. import { ITrack } from '../../base/tracks/types';
  51. import { CLOSE_CHAT, OPEN_CHAT } from '../../chat/actionTypes';
  52. import { closeChat, openChat, sendMessage, setPrivateMessageRecipient } from '../../chat/actions.native';
  53. import { setRequestingSubtitles } from '../../subtitles/actions.any';
  54. import { muteLocal } from '../../video-menu/actions.native';
  55. import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture/actionTypes';
  56. // @ts-ignore
  57. import { isExternalAPIAvailable } from '../react-native-sdk/functions';
  58. import { READY_TO_CLOSE } from './actionTypes';
  59. import { setParticipantsWithScreenShare } from './actions';
  60. import { participantToParticipantInfo, sendEvent } from './functions';
  61. import logger from './logger';
  62. /**
  63. * Event which will be emitted on the native side when a chat message is received
  64. * through the channel.
  65. */
  66. const CHAT_MESSAGE_RECEIVED = 'CHAT_MESSAGE_RECEIVED';
  67. /**
  68. * Event which will be emitted on the native side when the chat dialog is displayed/closed.
  69. */
  70. const CHAT_TOGGLED = 'CHAT_TOGGLED';
  71. /**
  72. * Event which will be emitted on the native side to indicate the conference
  73. * has ended either by user request or because an error was produced.
  74. */
  75. const CONFERENCE_TERMINATED = 'CONFERENCE_TERMINATED';
  76. /**
  77. * Event which will be emitted on the native side to indicate a message was received
  78. * through the channel.
  79. */
  80. const ENDPOINT_TEXT_MESSAGE_RECEIVED = 'ENDPOINT_TEXT_MESSAGE_RECEIVED';
  81. /**
  82. * Event which will be emitted on the native side to indicate a participant togggles
  83. * the screen share.
  84. */
  85. const SCREEN_SHARE_TOGGLED = 'SCREEN_SHARE_TOGGLED';
  86. /**
  87. * Event which will be emitted on the native side with the participant info array.
  88. */
  89. const PARTICIPANTS_INFO_RETRIEVED = 'PARTICIPANTS_INFO_RETRIEVED';
  90. const externalAPIEnabled = isExternalAPIAvailable();
  91. let eventEmitter: any;
  92. const { ExternalAPI } = NativeModules;
  93. if (externalAPIEnabled) {
  94. eventEmitter = new NativeEventEmitter(ExternalAPI);
  95. }
  96. /**
  97. * Middleware that captures Redux actions and uses the ExternalAPI module to
  98. * turn them into native events so the application knows about them.
  99. *
  100. * @param {Store} store - Redux store.
  101. * @returns {Function}
  102. */
  103. externalAPIEnabled && MiddlewareRegistry.register(store => next => action => {
  104. const oldAudioMuted = store.getState()['features/base/media'].audio.muted;
  105. const result = next(action);
  106. const { type } = action;
  107. switch (type) {
  108. case APP_WILL_MOUNT:
  109. _registerForNativeEvents(store);
  110. break;
  111. case APP_WILL_UNMOUNT:
  112. _unregisterForNativeEvents();
  113. break;
  114. case CONFERENCE_FAILED: {
  115. const { error, ...data } = action;
  116. // XXX Certain CONFERENCE_FAILED errors are recoverable i.e. they have
  117. // prevented the user from joining a specific conference but the app may
  118. // be able to eventually join the conference. For example, the app will
  119. // ask the user for a password upon
  120. // JitsiConferenceErrors.PASSWORD_REQUIRED and will retry joining the
  121. // conference afterwards. Such errors are to not reach the native
  122. // counterpart of the External API (or at least not in the
  123. // fatality/finality semantics attributed to
  124. // conferenceFailed:/onConferenceFailed).
  125. if (!error.recoverable) {
  126. _sendConferenceEvent(store, /* action */ {
  127. error: _toErrorString(error),
  128. ...data
  129. });
  130. }
  131. break;
  132. }
  133. case CONFERENCE_LEFT:
  134. _sendConferenceEvent(store, action);
  135. break;
  136. case CONFERENCE_JOINED:
  137. _sendConferenceEvent(store, action);
  138. _registerForEndpointTextMessages(store);
  139. break;
  140. case CONFERENCE_BLURRED:
  141. sendEvent(store, CONFERENCE_BLURRED, {});
  142. break;
  143. case AUDIO_MUTED_CHANGED:
  144. sendEvent(store, AUDIO_MUTED_CHANGED,
  145. /* data */ { muted: action.muted });
  146. break;
  147. case VIDEO_MUTED_CHANGED:
  148. sendEvent(store, VIDEO_MUTED_CHANGED,
  149. /* data */ { muted: action.muted });
  150. break;
  151. case CONFERENCE_FOCUSED:
  152. sendEvent(store, CONFERENCE_FOCUSED, {});
  153. break;
  154. case CONNECTION_DISCONNECTED: {
  155. // FIXME: This is a hack. See the description in the JITSI_CONNECTION_CONFERENCE_KEY constant definition.
  156. // Check if this connection was attached to any conference.
  157. // If it wasn't, fake a CONFERENCE_TERMINATED event.
  158. const { connection } = action;
  159. const conference = connection[JITSI_CONNECTION_CONFERENCE_KEY];
  160. if (!conference) {
  161. // This action will arrive late, so the locationURL stored on the state is no longer valid.
  162. const locationURL = connection[JITSI_CONNECTION_URL_KEY];
  163. sendEvent(
  164. store,
  165. CONFERENCE_TERMINATED,
  166. /* data */ {
  167. url: _normalizeUrl(locationURL)
  168. });
  169. }
  170. break;
  171. }
  172. case ENTER_PICTURE_IN_PICTURE:
  173. sendEvent(store, type, /* data */ {});
  174. break;
  175. case OPEN_CHAT:
  176. case CLOSE_CHAT: {
  177. sendEvent(
  178. store,
  179. CHAT_TOGGLED,
  180. /* data */ {
  181. isOpen: action.type === OPEN_CHAT
  182. });
  183. break;
  184. }
  185. case PARTICIPANT_JOINED:
  186. case PARTICIPANT_LEFT: {
  187. // Skip these events while not in a conference. SDK users can still retrieve them.
  188. const { conference } = store.getState()['features/base/conference'];
  189. if (!conference) {
  190. break;
  191. }
  192. const { participant } = action;
  193. const isVirtualScreenshareParticipant = isScreenShareParticipantById(store.getState(), participant.id);
  194. if (isVirtualScreenshareParticipant) {
  195. break;
  196. }
  197. sendEvent(
  198. store,
  199. action.type,
  200. participantToParticipantInfo(participant) /* data */
  201. );
  202. break;
  203. }
  204. case READY_TO_CLOSE:
  205. sendEvent(store, type, /* data */ {});
  206. break;
  207. case SET_ROOM:
  208. _maybeTriggerEarlyConferenceWillJoin(store, action);
  209. break;
  210. case SET_AUDIO_MUTED:
  211. if (action.muted !== oldAudioMuted) {
  212. sendEvent(
  213. store,
  214. 'AUDIO_MUTED_CHANGED',
  215. /* data */ {
  216. muted: action.muted
  217. });
  218. }
  219. break;
  220. case SET_VIDEO_MUTED:
  221. sendEvent(
  222. store,
  223. 'VIDEO_MUTED_CHANGED',
  224. /* data */ {
  225. muted: action.muted
  226. });
  227. break;
  228. }
  229. return result;
  230. });
  231. /**
  232. * Listen for changes to the known media tracks and look
  233. * for updates to screen shares for emitting native events.
  234. * The listener is debounced to avoid state thrashing that might occur,
  235. * especially when switching in or out of p2p.
  236. */
  237. externalAPIEnabled && StateListenerRegistry.register(
  238. /* selector */ state => state['features/base/tracks'],
  239. /* listener */ debounce((tracks: ITrack[], store: IStore) => {
  240. const oldScreenShares = store.getState()['features/mobile/external-api'].screenShares || [];
  241. const newScreenShares = tracks
  242. .filter(track => track.mediaType === MEDIA_TYPE.SCREENSHARE || track.videoType === VIDEO_TYPE.DESKTOP)
  243. .map(track => track.participantId);
  244. oldScreenShares.forEach(participantId => {
  245. if (!newScreenShares.includes(participantId)) {
  246. sendEvent(
  247. store,
  248. SCREEN_SHARE_TOGGLED,
  249. /* data */ {
  250. participantId,
  251. sharing: false
  252. });
  253. }
  254. });
  255. newScreenShares.forEach(participantId => {
  256. if (!oldScreenShares.includes(participantId)) {
  257. sendEvent(
  258. store,
  259. SCREEN_SHARE_TOGGLED,
  260. /* data */ {
  261. participantId,
  262. sharing: true
  263. });
  264. }
  265. });
  266. store.dispatch(setParticipantsWithScreenShare(newScreenShares));
  267. }, 100));
  268. /**
  269. * Registers for events sent from the native side via NativeEventEmitter.
  270. *
  271. * @param {Store} store - The redux store.
  272. * @private
  273. * @returns {void}
  274. */
  275. function _registerForNativeEvents(store: IStore) {
  276. const { getState, dispatch } = store;
  277. eventEmitter.addListener(ExternalAPI.HANG_UP, () => {
  278. dispatch(appNavigate(undefined));
  279. });
  280. eventEmitter.addListener(ExternalAPI.SET_AUDIO_MUTED, ({ muted }: any) => {
  281. dispatch(muteLocal(muted, MEDIA_TYPE.AUDIO));
  282. });
  283. eventEmitter.addListener(ExternalAPI.SET_VIDEO_MUTED, ({ muted }: any) => {
  284. dispatch(muteLocal(muted, MEDIA_TYPE.VIDEO));
  285. });
  286. eventEmitter.addListener(ExternalAPI.SEND_ENDPOINT_TEXT_MESSAGE, ({ to, message }: any) => {
  287. const conference = getCurrentConference(getState());
  288. try {
  289. conference?.sendEndpointMessage(to, {
  290. name: ENDPOINT_TEXT_MESSAGE_NAME,
  291. text: message
  292. });
  293. } catch (error) {
  294. logger.warn('Cannot send endpointMessage', error);
  295. }
  296. });
  297. eventEmitter.addListener(ExternalAPI.TOGGLE_SCREEN_SHARE, ({ enabled }: any) => {
  298. dispatch(toggleScreensharing(enabled));
  299. });
  300. eventEmitter.addListener(ExternalAPI.RETRIEVE_PARTICIPANTS_INFO, ({ requestId }: any) => {
  301. const participantsInfo = [];
  302. const remoteParticipants = getRemoteParticipants(store);
  303. const localParticipant = getLocalParticipant(store);
  304. localParticipant && participantsInfo.push(participantToParticipantInfo(localParticipant));
  305. remoteParticipants.forEach(participant => {
  306. if (!participant.fakeParticipant) {
  307. participantsInfo.push(participantToParticipantInfo(participant));
  308. }
  309. });
  310. sendEvent(
  311. store,
  312. PARTICIPANTS_INFO_RETRIEVED,
  313. /* data */ {
  314. participantsInfo,
  315. requestId
  316. });
  317. });
  318. eventEmitter.addListener(ExternalAPI.OPEN_CHAT, ({ to }: any) => {
  319. const participant = getParticipantById(store, to);
  320. dispatch(openChat(participant));
  321. });
  322. eventEmitter.addListener(ExternalAPI.CLOSE_CHAT, () => {
  323. dispatch(closeChat());
  324. });
  325. eventEmitter.addListener(ExternalAPI.SEND_CHAT_MESSAGE, ({ message, to }: any) => {
  326. const participant = getParticipantById(store, to);
  327. if (participant) {
  328. dispatch(setPrivateMessageRecipient(participant));
  329. }
  330. dispatch(sendMessage(message));
  331. });
  332. eventEmitter.addListener(ExternalAPI.SET_CLOSED_CAPTIONS_ENABLED, ({ enabled }: any) => {
  333. dispatch(setRequestingSubtitles(enabled));
  334. });
  335. eventEmitter.addListener(ExternalAPI.TOGGLE_CAMERA, () => {
  336. dispatch(toggleCameraFacingMode());
  337. });
  338. }
  339. /**
  340. * Unregister for events sent from the native side via NativeEventEmitter.
  341. *
  342. * @private
  343. * @returns {void}
  344. */
  345. function _unregisterForNativeEvents() {
  346. eventEmitter.removeAllListeners(ExternalAPI.HANG_UP);
  347. eventEmitter.removeAllListeners(ExternalAPI.SET_AUDIO_MUTED);
  348. eventEmitter.removeAllListeners(ExternalAPI.SET_VIDEO_MUTED);
  349. eventEmitter.removeAllListeners(ExternalAPI.SEND_ENDPOINT_TEXT_MESSAGE);
  350. eventEmitter.removeAllListeners(ExternalAPI.TOGGLE_SCREEN_SHARE);
  351. eventEmitter.removeAllListeners(ExternalAPI.RETRIEVE_PARTICIPANTS_INFO);
  352. eventEmitter.removeAllListeners(ExternalAPI.OPEN_CHAT);
  353. eventEmitter.removeAllListeners(ExternalAPI.CLOSE_CHAT);
  354. eventEmitter.removeAllListeners(ExternalAPI.SEND_CHAT_MESSAGE);
  355. eventEmitter.removeAllListeners(ExternalAPI.SET_CLOSED_CAPTIONS_ENABLED);
  356. eventEmitter.removeAllListeners(ExternalAPI.TOGGLE_CAMERA);
  357. }
  358. /**
  359. * Registers for endpoint messages sent on conference data channel.
  360. *
  361. * @param {Store} store - The redux store.
  362. * @private
  363. * @returns {void}
  364. */
  365. function _registerForEndpointTextMessages(store: IStore) {
  366. const conference = getCurrentConference(store.getState());
  367. conference?.on(
  368. JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
  369. (...args: any[]) => {
  370. if (args && args.length >= 2) {
  371. const [ sender, eventData ] = args;
  372. if (eventData.name === ENDPOINT_TEXT_MESSAGE_NAME) {
  373. sendEvent(
  374. store,
  375. ENDPOINT_TEXT_MESSAGE_RECEIVED,
  376. /* data */ {
  377. message: eventData.text,
  378. senderId: sender._id
  379. });
  380. }
  381. }
  382. });
  383. conference?.on(
  384. JitsiConferenceEvents.MESSAGE_RECEIVED,
  385. (id: string, message: string, timestamp: number) => {
  386. sendEvent(
  387. store,
  388. CHAT_MESSAGE_RECEIVED,
  389. /* data */ {
  390. senderId: id,
  391. message,
  392. isPrivate: false,
  393. timestamp
  394. });
  395. }
  396. );
  397. conference?.on(
  398. JitsiConferenceEvents.PRIVATE_MESSAGE_RECEIVED,
  399. (id: string, message: string, timestamp: number) => {
  400. sendEvent(
  401. store,
  402. CHAT_MESSAGE_RECEIVED,
  403. /* data */ {
  404. senderId: id,
  405. message,
  406. isPrivate: true,
  407. timestamp
  408. });
  409. }
  410. );
  411. }
  412. /**
  413. * Returns a {@code String} representation of a specific error {@code Object}.
  414. *
  415. * @param {Error|Object|string} error - The error {@code Object} to return a
  416. * {@code String} representation of.
  417. * @returns {string} A {@code String} representation of the specified
  418. * {@code error}.
  419. */
  420. function _toErrorString(
  421. error: Error | { message?: string; name?: string; } | string) {
  422. // XXX In lib-jitsi-meet and jitsi-meet we utilize errors in the form of
  423. // strings, Error instances, and plain objects which resemble Error.
  424. return (
  425. error
  426. ? typeof error === 'string'
  427. ? error
  428. : Error.prototype.toString.apply(error)
  429. : '');
  430. }
  431. /**
  432. * If {@link SET_ROOM} action happens for a valid conference room this method
  433. * will emit an early {@link CONFERENCE_WILL_JOIN} event to let the external API
  434. * know that a conference is being joined. Before that happens a connection must
  435. * be created and only then base/conference feature would emit
  436. * {@link CONFERENCE_WILL_JOIN}. That is fine for the Jitsi Meet app, because
  437. * that's the a conference instance gets created, but it's too late for
  438. * the external API to learn that. The latter {@link CONFERENCE_WILL_JOIN} is
  439. * swallowed in {@link _swallowEvent}.
  440. *
  441. * @param {Store} store - The redux store.
  442. * @param {Action} action - The redux action.
  443. * @returns {void}
  444. */
  445. function _maybeTriggerEarlyConferenceWillJoin(store: IStore, action: AnyAction) {
  446. const { locationURL } = store.getState()['features/base/connection'];
  447. const { room } = action;
  448. isRoomValid(room) && locationURL && sendEvent(
  449. store,
  450. CONFERENCE_WILL_JOIN,
  451. /* data */ {
  452. url: _normalizeUrl(locationURL)
  453. });
  454. }
  455. /**
  456. * Normalizes the given URL for presentation over the external API.
  457. *
  458. * @param {URL} url -The URL to normalize.
  459. * @returns {string} - The normalized URL as a string.
  460. */
  461. function _normalizeUrl(url: URL) {
  462. return getURLWithoutParams(url).href;
  463. }
  464. /**
  465. * Sends an event to the native counterpart of the External API for a specific
  466. * conference-related redux action.
  467. *
  468. * @param {Store} store - The redux store.
  469. * @param {Action} action - The redux action.
  470. * @returns {void}
  471. */
  472. function _sendConferenceEvent(
  473. store: IStore,
  474. action: {
  475. conference: IJitsiConference;
  476. isAudioMuted?: boolean;
  477. type: string;
  478. url?: string;
  479. }) {
  480. const { conference, type, ...data } = action;
  481. // For these (redux) actions, conference identifies a JitsiConference
  482. // instance. The external API cannot transport such an object so we have to
  483. // transport an "equivalent".
  484. if (conference) { // @ts-ignore
  485. data.url = _normalizeUrl(conference[JITSI_CONFERENCE_URL_KEY]);
  486. const localTracks = getLocalTracks(store.getState()['features/base/tracks']);
  487. const isAudioMuted = isLocalTrackMuted(localTracks, MEDIA_TYPE.AUDIO);
  488. data.isAudioMuted = isAudioMuted;
  489. }
  490. if (_swallowEvent(store, action, data)) {
  491. return;
  492. }
  493. let type_;
  494. switch (type) {
  495. case CONFERENCE_FAILED:
  496. case CONFERENCE_LEFT:
  497. type_ = CONFERENCE_TERMINATED;
  498. break;
  499. default:
  500. type_ = type;
  501. break;
  502. }
  503. sendEvent(store, type_, data);
  504. }
  505. /**
  506. * Determines whether to not send a {@code CONFERENCE_LEFT} event to the native
  507. * counterpart of the External API.
  508. *
  509. * @param {Object} store - The redux store.
  510. * @param {Action} action - The redux action which is causing the sending of the
  511. * event.
  512. * @param {Object} data - The details/specifics of the event to send determined
  513. * by/associated with the specified {@code action}.
  514. * @returns {boolean} If the specified event is to not be sent, {@code true};
  515. * otherwise, {@code false}.
  516. */
  517. function _swallowConferenceLeft({ getState }: IStore, action: AnyAction, { url }: { url: string; }) {
  518. // XXX Internally, we work with JitsiConference instances. Externally
  519. // though, we deal with URL strings. The relation between the two is many to
  520. // one so it's technically and practically possible (by externally loading
  521. // the same URL string multiple times) to try to send CONFERENCE_LEFT
  522. // externally for a URL string which identifies a JitsiConference that the
  523. // app is internally legitimately working with.
  524. let swallowConferenceLeft = false;
  525. url
  526. && forEachConference(getState, (conference, conferenceURL) => {
  527. if (conferenceURL && conferenceURL.toString() === url) {
  528. swallowConferenceLeft = true;
  529. }
  530. return !swallowConferenceLeft;
  531. });
  532. return swallowConferenceLeft;
  533. }
  534. /**
  535. * Determines whether to not send a specific event to the native counterpart of
  536. * the External API.
  537. *
  538. * @param {Object} store - The redux store.
  539. * @param {Action} action - The redux action which is causing the sending of the
  540. * event.
  541. * @param {Object} data - The details/specifics of the event to send determined
  542. * by/associated with the specified {@code action}.
  543. * @returns {boolean} If the specified event is to not be sent, {@code true};
  544. * otherwise, {@code false}.
  545. */
  546. function _swallowEvent(store: IStore, action: AnyAction, data: any) {
  547. switch (action.type) {
  548. case CONFERENCE_LEFT:
  549. return _swallowConferenceLeft(store, action, data);
  550. default:
  551. return false;
  552. }
  553. }