You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import {
  4. createStartMutedConfigurationEvent,
  5. sendAnalytics
  6. } from '../../analytics';
  7. import { getName } from '../../app/functions';
  8. import { endpointMessageReceived } from '../../subtitles';
  9. import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection';
  10. import { JitsiConferenceEvents } from '../lib-jitsi-meet';
  11. import { setAudioMuted, setVideoMuted } from '../media';
  12. import {
  13. dominantSpeakerChanged,
  14. getLocalParticipant,
  15. getNormalizedDisplayName,
  16. participantConnectionStatusChanged,
  17. participantKicked,
  18. participantMutedUs,
  19. participantPresenceChanged,
  20. participantRoleChanged,
  21. participantUpdated
  22. } from '../participants';
  23. import { getLocalTracks, trackAdded, trackRemoved } from '../tracks';
  24. import {
  25. getBackendSafePath,
  26. getBackendSafeRoomName,
  27. getJitsiMeetGlobalNS
  28. } from '../util';
  29. import {
  30. AUTH_STATUS_CHANGED,
  31. CONFERENCE_FAILED,
  32. CONFERENCE_JOINED,
  33. CONFERENCE_LEFT,
  34. CONFERENCE_SUBJECT_CHANGED,
  35. CONFERENCE_TIMESTAMP_CHANGED,
  36. CONFERENCE_WILL_JOIN,
  37. CONFERENCE_WILL_LEAVE,
  38. DATA_CHANNEL_OPENED,
  39. KICKED_OUT,
  40. LOCK_STATE_CHANGED,
  41. P2P_STATUS_CHANGED,
  42. SEND_TONES,
  43. SET_FOLLOW_ME,
  44. SET_PASSWORD,
  45. SET_PASSWORD_FAILED,
  46. SET_ROOM,
  47. SET_PENDING_SUBJECT_CHANGE,
  48. SET_START_MUTED_POLICY
  49. } from './actionTypes';
  50. import {
  51. AVATAR_URL_COMMAND,
  52. EMAIL_COMMAND,
  53. JITSI_CONFERENCE_URL_KEY
  54. } from './constants';
  55. import {
  56. _addLocalTracksToConference,
  57. commonUserJoinedHandling,
  58. commonUserLeftHandling,
  59. getCurrentConference,
  60. sendLocalParticipant
  61. } from './functions';
  62. import logger from './logger';
  63. declare var APP: Object;
  64. /**
  65. * Adds conference (event) listeners.
  66. *
  67. * @param {JitsiConference} conference - The JitsiConference instance.
  68. * @param {Dispatch} dispatch - The Redux dispatch function.
  69. * @private
  70. * @returns {void}
  71. */
  72. function _addConferenceListeners(conference, dispatch) {
  73. // A simple logger for conference errors received through
  74. // the listener. These errors are not handled now, but logged.
  75. conference.on(JitsiConferenceEvents.CONFERENCE_ERROR,
  76. error => logger.error('Conference error.', error));
  77. // Dispatches into features/base/conference follow:
  78. conference.on(
  79. JitsiConferenceEvents.CONFERENCE_FAILED,
  80. (...args) => dispatch(conferenceFailed(conference, ...args)));
  81. conference.on(
  82. JitsiConferenceEvents.CONFERENCE_JOINED,
  83. (...args) => dispatch(conferenceJoined(conference, ...args)));
  84. conference.on(
  85. JitsiConferenceEvents.CONFERENCE_LEFT,
  86. (...args) => {
  87. dispatch(conferenceTimestampChanged(0));
  88. dispatch(conferenceLeft(conference, ...args));
  89. });
  90. conference.on(JitsiConferenceEvents.SUBJECT_CHANGED,
  91. (...args) => dispatch(conferenceSubjectChanged(...args)));
  92. conference.on(JitsiConferenceEvents.CONFERENCE_CREATED_TIMESTAMP,
  93. (...args) => dispatch(conferenceTimestampChanged(...args)));
  94. conference.on(
  95. JitsiConferenceEvents.KICKED,
  96. (...args) => dispatch(kickedOut(conference, ...args)));
  97. conference.on(
  98. JitsiConferenceEvents.PARTICIPANT_KICKED,
  99. (kicker, kicked) => dispatch(participantKicked(kicker, kicked)));
  100. conference.on(
  101. JitsiConferenceEvents.LOCK_STATE_CHANGED,
  102. (...args) => dispatch(lockStateChanged(conference, ...args)));
  103. // Dispatches into features/base/media follow:
  104. conference.on(
  105. JitsiConferenceEvents.STARTED_MUTED,
  106. () => {
  107. const audioMuted = Boolean(conference.startAudioMuted);
  108. const videoMuted = Boolean(conference.startVideoMuted);
  109. sendAnalytics(createStartMutedConfigurationEvent(
  110. 'remote', audioMuted, videoMuted));
  111. logger.log(`Start muted: ${audioMuted ? 'audio, ' : ''}${
  112. videoMuted ? 'video' : ''}`);
  113. // XXX Jicofo tells lib-jitsi-meet to start with audio and/or video
  114. // muted i.e. Jicofo expresses an intent. Lib-jitsi-meet has turned
  115. // Jicofo's intent into reality by actually muting the respective
  116. // tracks. The reality is expressed in base/tracks already so what
  117. // is left is to express Jicofo's intent in base/media.
  118. // TODO Maybe the app needs to learn about Jicofo's intent and
  119. // transfer that intent to lib-jitsi-meet instead of lib-jitsi-meet
  120. // acting on Jicofo's intent without the app's knowledge.
  121. dispatch(setAudioMuted(audioMuted));
  122. dispatch(setVideoMuted(videoMuted));
  123. });
  124. // Dispatches into features/base/tracks follow:
  125. conference.on(
  126. JitsiConferenceEvents.TRACK_ADDED,
  127. t => t && !t.isLocal() && dispatch(trackAdded(t)));
  128. conference.on(
  129. JitsiConferenceEvents.TRACK_REMOVED,
  130. t => t && !t.isLocal() && dispatch(trackRemoved(t)));
  131. conference.on(
  132. JitsiConferenceEvents.TRACK_MUTE_CHANGED,
  133. (_, participantThatMutedUs) => {
  134. if (participantThatMutedUs) {
  135. dispatch(participantMutedUs(participantThatMutedUs));
  136. }
  137. });
  138. // Dispatches into features/base/participants follow:
  139. conference.on(
  140. JitsiConferenceEvents.DISPLAY_NAME_CHANGED,
  141. (id, displayName) => dispatch(participantUpdated({
  142. conference,
  143. id,
  144. name: getNormalizedDisplayName(displayName)
  145. })));
  146. conference.on(
  147. JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
  148. id => dispatch(dominantSpeakerChanged(id, conference)));
  149. conference.on(
  150. JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
  151. (...args) => dispatch(endpointMessageReceived(...args)));
  152. conference.on(
  153. JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
  154. (...args) => dispatch(participantConnectionStatusChanged(...args)));
  155. conference.on(
  156. JitsiConferenceEvents.USER_JOINED,
  157. (id, user) => commonUserJoinedHandling({ dispatch }, conference, user));
  158. conference.on(
  159. JitsiConferenceEvents.USER_LEFT,
  160. (id, user) => commonUserLeftHandling({ dispatch }, conference, user));
  161. conference.on(
  162. JitsiConferenceEvents.USER_ROLE_CHANGED,
  163. (...args) => dispatch(participantRoleChanged(...args)));
  164. conference.on(
  165. JitsiConferenceEvents.USER_STATUS_CHANGED,
  166. (...args) => dispatch(participantPresenceChanged(...args)));
  167. conference.on(
  168. JitsiConferenceEvents.BOT_TYPE_CHANGED,
  169. (id, botType) => dispatch(participantUpdated({
  170. conference,
  171. id,
  172. botType
  173. })));
  174. conference.addCommandListener(
  175. AVATAR_URL_COMMAND,
  176. (data, id) => dispatch(participantUpdated({
  177. conference,
  178. id,
  179. avatarURL: data.value
  180. })));
  181. conference.addCommandListener(
  182. EMAIL_COMMAND,
  183. (data, id) => dispatch(participantUpdated({
  184. conference,
  185. id,
  186. email: data.value
  187. })));
  188. }
  189. /**
  190. * Updates the current known state of server-side authentication.
  191. *
  192. * @param {boolean} authEnabled - Whether or not server authentication is
  193. * enabled.
  194. * @param {string} authLogin - The current name of the logged in user, if any.
  195. * @returns {{
  196. * type: AUTH_STATUS_CHANGED,
  197. * authEnabled: boolean,
  198. * authLogin: string
  199. * }}
  200. */
  201. export function authStatusChanged(authEnabled: boolean, authLogin: string) {
  202. return {
  203. type: AUTH_STATUS_CHANGED,
  204. authEnabled,
  205. authLogin
  206. };
  207. }
  208. /**
  209. * Signals that a specific conference has failed.
  210. *
  211. * @param {JitsiConference} conference - The JitsiConference that has failed.
  212. * @param {string} error - The error describing/detailing the cause of the
  213. * failure.
  214. * @param {any} params - Rest of the params that we receive together with the event.
  215. * @returns {{
  216. * type: CONFERENCE_FAILED,
  217. * conference: JitsiConference,
  218. * error: Error
  219. * }}
  220. * @public
  221. */
  222. export function conferenceFailed(conference: Object, error: string, ...params: any) {
  223. return {
  224. type: CONFERENCE_FAILED,
  225. conference,
  226. // Make the error resemble an Error instance (to the extent that
  227. // jitsi-meet needs it).
  228. error: {
  229. name: error,
  230. params,
  231. recoverable: undefined
  232. }
  233. };
  234. }
  235. /**
  236. * Signals that a specific conference has been joined.
  237. *
  238. * @param {JitsiConference} conference - The JitsiConference instance which was
  239. * joined by the local participant.
  240. * @returns {{
  241. * type: CONFERENCE_JOINED,
  242. * conference: JitsiConference
  243. * }}
  244. */
  245. export function conferenceJoined(conference: Object) {
  246. return {
  247. type: CONFERENCE_JOINED,
  248. conference
  249. };
  250. }
  251. /**
  252. * Signals that a specific conference has been left.
  253. *
  254. * @param {JitsiConference} conference - The JitsiConference instance which was
  255. * left by the local participant.
  256. * @returns {{
  257. * type: CONFERENCE_LEFT,
  258. * conference: JitsiConference
  259. * }}
  260. */
  261. export function conferenceLeft(conference: Object) {
  262. return {
  263. type: CONFERENCE_LEFT,
  264. conference
  265. };
  266. }
  267. /**
  268. * Signals that the conference subject has been changed.
  269. *
  270. * @param {string} subject - The new subject.
  271. * @returns {{
  272. * type: CONFERENCE_SUBJECT_CHANGED,
  273. * subject: string
  274. * }}
  275. */
  276. export function conferenceSubjectChanged(subject: string) {
  277. return {
  278. type: CONFERENCE_SUBJECT_CHANGED,
  279. subject
  280. };
  281. }
  282. /**
  283. * Signals that the conference timestamp has been changed.
  284. *
  285. * @param {number} conferenceTimestamp - The UTC timestamp.
  286. * @returns {{
  287. * type: CONFERENCE_TIMESTAMP_CHANGED,
  288. * conferenceTimestamp
  289. * }}
  290. */
  291. export function conferenceTimestampChanged(conferenceTimestamp: number) {
  292. return {
  293. type: CONFERENCE_TIMESTAMP_CHANGED,
  294. conferenceTimestamp
  295. };
  296. }
  297. /**
  298. * Adds any existing local tracks to a specific conference before the conference
  299. * is joined. Then signals the intention of the application to have the local
  300. * participant join the specified conference.
  301. *
  302. * @param {JitsiConference} conference - The {@code JitsiConference} instance
  303. * the local participant will (try to) join.
  304. * @returns {Function}
  305. */
  306. function _conferenceWillJoin(conference: Object) {
  307. return (dispatch: Dispatch<any>, getState: Function) => {
  308. const localTracks
  309. = getLocalTracks(getState()['features/base/tracks'])
  310. .map(t => t.jitsiTrack);
  311. if (localTracks.length) {
  312. _addLocalTracksToConference(conference, localTracks);
  313. }
  314. dispatch(conferenceWillJoin(conference));
  315. };
  316. }
  317. /**
  318. * Signals the intention of the application to have the local participant
  319. * join the specified conference.
  320. *
  321. * @param {JitsiConference} conference - The {@code JitsiConference} instance
  322. * the local participant will (try to) join.
  323. * @returns {{
  324. * type: CONFERENCE_WILL_JOIN,
  325. * conference: JitsiConference
  326. * }}
  327. */
  328. export function conferenceWillJoin(conference: Object) {
  329. return {
  330. type: CONFERENCE_WILL_JOIN,
  331. conference
  332. };
  333. }
  334. /**
  335. * Signals the intention of the application to have the local participant leave
  336. * a specific conference. Similar in fashion to CONFERENCE_LEFT. Contrary to it
  337. * though, it's not guaranteed because CONFERENCE_LEFT may be triggered by
  338. * lib-jitsi-meet and not the application.
  339. *
  340. * @param {JitsiConference} conference - The JitsiConference instance which will
  341. * be left by the local participant.
  342. * @returns {{
  343. * type: CONFERENCE_LEFT,
  344. * conference: JitsiConference
  345. * }}
  346. */
  347. export function conferenceWillLeave(conference: Object) {
  348. return {
  349. type: CONFERENCE_WILL_LEAVE,
  350. conference
  351. };
  352. }
  353. /**
  354. * Initializes a new conference.
  355. *
  356. * @returns {Function}
  357. */
  358. export function createConference() {
  359. return (dispatch: Function, getState: Function) => {
  360. const state = getState();
  361. const { connection, locationURL } = state['features/base/connection'];
  362. if (!connection) {
  363. throw new Error('Cannot create a conference without a connection!');
  364. }
  365. const { password, room } = state['features/base/conference'];
  366. if (!room) {
  367. throw new Error('Cannot join a conference without a room name!');
  368. }
  369. const config = state['features/base/config'];
  370. const { tenant } = state['features/base/jwt'];
  371. const { email, name: nick } = getLocalParticipant(state);
  372. const conference
  373. = connection.initJitsiConference(
  374. getBackendSafeRoomName(room), {
  375. ...config,
  376. applicationName: getName(),
  377. getWiFiStatsMethod: getJitsiMeetGlobalNS().getWiFiStats,
  378. confID: `${locationURL.host}${getBackendSafePath(locationURL.pathname)}`,
  379. siteID: tenant,
  380. statisticsDisplayName: config.enableDisplayNameInStats ? nick : undefined,
  381. statisticsId: config.enableEmailInStats ? email : undefined
  382. });
  383. connection[JITSI_CONNECTION_CONFERENCE_KEY] = conference;
  384. conference[JITSI_CONFERENCE_URL_KEY] = locationURL;
  385. dispatch(_conferenceWillJoin(conference));
  386. _addConferenceListeners(conference, dispatch);
  387. sendLocalParticipant(state, conference);
  388. conference.join(password);
  389. };
  390. }
  391. /**
  392. * Will try to join the conference again in case it failed earlier with
  393. * {@link JitsiConferenceErrors.AUTHENTICATION_REQUIRED}. It means that Jicofo
  394. * did not allow to create new room from anonymous domain, but it can be tried
  395. * again later in case authenticated user created it in the meantime.
  396. *
  397. * @returns {Function}
  398. */
  399. export function checkIfCanJoin() {
  400. return (dispatch: Function, getState: Function) => {
  401. const { authRequired, password }
  402. = getState()['features/base/conference'];
  403. authRequired && dispatch(_conferenceWillJoin(authRequired));
  404. authRequired && authRequired.join(password);
  405. };
  406. }
  407. /**
  408. * Signals the data channel with the bridge has successfully opened.
  409. *
  410. * @returns {{
  411. * type: DATA_CHANNEL_OPENED
  412. * }}
  413. */
  414. export function dataChannelOpened() {
  415. return {
  416. type: DATA_CHANNEL_OPENED
  417. };
  418. }
  419. /**
  420. * Signals that we've been kicked out of the conference.
  421. *
  422. * @param {JitsiConference} conference - The {@link JitsiConference} instance
  423. * for which the event is being signaled.
  424. * @param {JitsiParticipant} participant - The {@link JitsiParticipant}
  425. * instance which initiated the kick event.
  426. * @returns {{
  427. * type: KICKED_OUT,
  428. * conference: JitsiConference,
  429. * participant: JitsiParticipant
  430. * }}
  431. */
  432. export function kickedOut(conference: Object, participant: Object) {
  433. return {
  434. type: KICKED_OUT,
  435. conference,
  436. participant
  437. };
  438. }
  439. /**
  440. * Signals that the lock state of a specific JitsiConference changed.
  441. *
  442. * @param {JitsiConference} conference - The JitsiConference which had its lock
  443. * state changed.
  444. * @param {boolean} locked - If the specified conference became locked, true;
  445. * otherwise, false.
  446. * @returns {{
  447. * type: LOCK_STATE_CHANGED,
  448. * conference: JitsiConference,
  449. * locked: boolean
  450. * }}
  451. */
  452. export function lockStateChanged(conference: Object, locked: boolean) {
  453. return {
  454. type: LOCK_STATE_CHANGED,
  455. conference,
  456. locked
  457. };
  458. }
  459. /**
  460. * Updates the known state of start muted policies.
  461. *
  462. * @param {boolean} audioMuted - Whether or not members will join the conference
  463. * as audio muted.
  464. * @param {boolean} videoMuted - Whether or not members will join the conference
  465. * as video muted.
  466. * @returns {{
  467. * type: SET_START_MUTED_POLICY,
  468. * startAudioMutedPolicy: boolean,
  469. * startVideoMutedPolicy: boolean
  470. * }}
  471. */
  472. export function onStartMutedPolicyChanged(
  473. audioMuted: boolean, videoMuted: boolean) {
  474. return {
  475. type: SET_START_MUTED_POLICY,
  476. startAudioMutedPolicy: audioMuted,
  477. startVideoMutedPolicy: videoMuted
  478. };
  479. }
  480. /**
  481. * Sets whether or not peer2peer is currently enabled.
  482. *
  483. * @param {boolean} p2p - Whether or not peer2peer is currently active.
  484. * @returns {{
  485. * type: P2P_STATUS_CHANGED,
  486. * p2p: boolean
  487. * }}
  488. */
  489. export function p2pStatusChanged(p2p: boolean) {
  490. return {
  491. type: P2P_STATUS_CHANGED,
  492. p2p
  493. };
  494. }
  495. /**
  496. * Signals to play touch tones.
  497. *
  498. * @param {string} tones - The tones to play.
  499. * @param {number} [duration] - How long to play each tone.
  500. * @param {number} [pause] - How long to pause between each tone.
  501. * @returns {{
  502. * type: SEND_TONES,
  503. * tones: string,
  504. * duration: number,
  505. * pause: number
  506. * }}
  507. */
  508. export function sendTones(tones: string, duration: number, pause: number) {
  509. return {
  510. type: SEND_TONES,
  511. tones,
  512. duration,
  513. pause
  514. };
  515. }
  516. /**
  517. * Enables or disables the Follow Me feature.
  518. *
  519. * @param {boolean} enabled - Whether or not Follow Me should be enabled.
  520. * @returns {{
  521. * type: SET_FOLLOW_ME,
  522. * enabled: boolean
  523. * }}
  524. */
  525. export function setFollowMe(enabled: boolean) {
  526. return {
  527. type: SET_FOLLOW_ME,
  528. enabled
  529. };
  530. }
  531. /**
  532. * Sets the password to join or lock a specific JitsiConference.
  533. *
  534. * @param {JitsiConference} conference - The JitsiConference which requires a
  535. * password to join or is to be locked with the specified password.
  536. * @param {Function} method - The JitsiConference method of password protection
  537. * such as join or lock.
  538. * @param {string} password - The password with which the specified conference
  539. * is to be joined or locked.
  540. * @returns {Function}
  541. */
  542. export function setPassword(
  543. conference: Object,
  544. method: Function,
  545. password: string) {
  546. return (dispatch: Dispatch<any>, getState: Function): ?Promise<void> => {
  547. switch (method) {
  548. case conference.join: {
  549. let state = getState()['features/base/conference'];
  550. dispatch({
  551. type: SET_PASSWORD,
  552. conference,
  553. method,
  554. password
  555. });
  556. // Join the conference with the newly-set password.
  557. // Make sure that the action did set the password.
  558. state = getState()['features/base/conference'];
  559. if (state.password === password
  560. // Make sure that the application still wants the
  561. // conference joined.
  562. && !state.conference) {
  563. method.call(conference, password);
  564. }
  565. break;
  566. }
  567. case conference.lock: {
  568. const state = getState()['features/base/conference'];
  569. if (state.conference === conference) {
  570. return (
  571. method.call(conference, password)
  572. .then(() => dispatch({
  573. type: SET_PASSWORD,
  574. conference,
  575. method,
  576. password
  577. }))
  578. .catch(error => dispatch({
  579. type: SET_PASSWORD_FAILED,
  580. error
  581. }))
  582. );
  583. }
  584. return Promise.reject();
  585. }
  586. }
  587. };
  588. }
  589. /**
  590. * Sets (the name of) the room of the conference to be joined.
  591. *
  592. * @param {(string|undefined)} room - The name of the room of the conference to
  593. * be joined.
  594. * @returns {{
  595. * type: SET_ROOM,
  596. * room: string
  597. * }}
  598. */
  599. export function setRoom(room: ?string) {
  600. return {
  601. type: SET_ROOM,
  602. room
  603. };
  604. }
  605. /**
  606. * Sets whether or not members should join audio and/or video muted.
  607. *
  608. * @param {boolean} startAudioMuted - Whether or not members will join the
  609. * conference as audio muted.
  610. * @param {boolean} startVideoMuted - Whether or not members will join the
  611. * conference as video muted.
  612. * @returns {Function}
  613. */
  614. export function setStartMutedPolicy(
  615. startAudioMuted: boolean, startVideoMuted: boolean) {
  616. return (dispatch: Dispatch<any>, getState: Function) => {
  617. const conference = getCurrentConference(getState());
  618. conference && conference.setStartMutedPolicy({
  619. audio: startAudioMuted,
  620. video: startVideoMuted
  621. });
  622. return dispatch(
  623. onStartMutedPolicyChanged(startAudioMuted, startVideoMuted));
  624. };
  625. }
  626. /**
  627. * Changing conference subject.
  628. *
  629. * @param {string} subject - The new subject.
  630. * @returns {void}
  631. */
  632. export function setSubject(subject: string) {
  633. return (dispatch: Dispatch<any>, getState: Function) => {
  634. const { conference } = getState()['features/base/conference'];
  635. if (conference) {
  636. conference.setSubject(subject || '');
  637. } else {
  638. dispatch({
  639. type: SET_PENDING_SUBJECT_CHANGE,
  640. subject
  641. });
  642. }
  643. };
  644. }