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 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* @flow */
  2. import { getInviteURL } from '../base/connection';
  3. import { BEGIN_SHARE_ROOM, END_SHARE_ROOM } from './actionTypes';
  4. /**
  5. * Begins the UI procedure to share the URL for the current conference/room.
  6. *
  7. * @param {string} roomURL - The URL of the room to share.
  8. * @public
  9. * @returns {Function}
  10. */
  11. export function beginShareRoom(roomURL: ?string): Function {
  12. return (dispatch, getState) => {
  13. if (!roomURL) {
  14. // eslint-disable-next-line no-param-reassign
  15. roomURL = getInviteURL(getState);
  16. }
  17. roomURL && dispatch({
  18. type: BEGIN_SHARE_ROOM,
  19. roomURL,
  20. includeDialInfo: getState()['features/base/config']
  21. .dialInNumbersUrl !== undefined
  22. });
  23. };
  24. }
  25. /**
  26. * Ends the UI procedure to share a specific conference/room URL.
  27. *
  28. * @param {string} roomURL - The URL of the conference/room which was shared.
  29. * @param {boolean} shared - True if the URL was shared successfully; false,
  30. * otherwise.
  31. * @public
  32. * @returns {{
  33. * type: END_SHARE_ROOM,
  34. * roomURL: string,
  35. * shared: boolean
  36. * }}
  37. */
  38. export function endShareRoom(roomURL: string, shared: boolean): Object {
  39. return {
  40. type: END_SHARE_ROOM,
  41. roomURL,
  42. shared
  43. };
  44. }