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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. });
  21. };
  22. }
  23. /**
  24. * Ends the UI procedure to share a specific conference/room URL.
  25. *
  26. * @param {string} roomURL - The URL of the conference/room which was shared.
  27. * @param {boolean} shared - True if the URL was shared successfully; false,
  28. * otherwise.
  29. * @public
  30. * @returns {{
  31. * type: END_SHARE_ROOM,
  32. * roomURL: string,
  33. * shared: boolean
  34. * }}
  35. */
  36. export function endShareRoom(roomURL: string, shared: boolean): Object {
  37. return {
  38. type: END_SHARE_ROOM,
  39. roomURL,
  40. shared
  41. };
  42. }