您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.js 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. declare var interfaceConfig: Object;
  3. /**
  4. * Returns a displayable name for the knocking participant.
  5. *
  6. * @param {string} name - The received name.
  7. * @returns {string}
  8. */
  9. export function getKnockingParticipantDisplayName(name: string) {
  10. if (name) {
  11. return name;
  12. }
  13. return typeof interfaceConfig === 'object'
  14. ? interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME
  15. : 'Fellow Jitster';
  16. }
  17. /**
  18. * Approves (lets in) or rejects a knocking participant.
  19. *
  20. * @param {Function} getState - Function to get the Redux state.
  21. * @param {string} id - The id of the knocking participant.
  22. * @param {boolean} approved - True if the participant is approved, false otherwise.
  23. * @returns {Function}
  24. */
  25. export function setKnockingParticipantApproval(getState: Function, id: string, approved: boolean) {
  26. const { conference } = getState()['features/base/conference'];
  27. if (conference) {
  28. if (approved) {
  29. conference.lobbyApproveAccess(id);
  30. } else {
  31. conference.lobbyDenyAccess(id);
  32. }
  33. }
  34. }