From f99c919416469e91bc25126480653db303416720 Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Wed, 31 Mar 2021 15:51:53 +0300 Subject: [PATCH] code review changes --- react/features/invite/constants.js | 4 ++-- react/features/invite/functions.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react/features/invite/constants.js b/react/features/invite/constants.js index d894f34da..b73aeed23 100644 --- a/react/features/invite/constants.js +++ b/react/features/invite/constants.js @@ -44,7 +44,7 @@ export const OUTGOING_CALL_RINGING_SOUND_ID = 'OUTGOING_CALL_RINGING_SOUND_ID'; export const OUTGOING_CALL_START_SOUND_ID = 'OUTGOING_CALL_START_SOUND_ID'; /** - * Regex for matching email addresses. + * Regex for matching sip addresses. */ // eslint-disable-next-line max-len -export const EMAIL_ADDRESS_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; +export const SIP_ADDRESS_REGEX = /^[a-zA-Z]+(?:([^\s>:@]+)(?::([^\s@>]+))?@)?([\w\-.]+)(?::(\d+))?((?:;[^\s=?>;]+(?:=[^\s?;]+)?)*)(?:\?(([^\s&=>]+=[^\s&=>]+)(&[^\s&=>]+=[^\s&=>]+)*))?$/; diff --git a/react/features/invite/functions.js b/react/features/invite/functions.js index 26954a646..83dd3c38a 100644 --- a/react/features/invite/functions.js +++ b/react/features/invite/functions.js @@ -10,7 +10,7 @@ import { toState } from '../base/redux'; import { doGetJSON, parseURIString } from '../base/util'; import { isVpaasMeeting } from '../billing-counter/functions'; -import { EMAIL_ADDRESS_REGEX } from './constants'; +import { SIP_ADDRESS_REGEX } from './constants'; import logger from './logger'; declare var $: Function; @@ -428,7 +428,7 @@ function isMaybeAPhoneNumber(text: string): boolean { * @returns {boolean} True if provided text matches a sip address format. */ function isASipAddress(text: string): boolean { - return EMAIL_ADDRESS_REGEX.test(text); + return SIP_ADDRESS_REGEX.test(text); } /** @@ -807,7 +807,7 @@ export function isSharingEnabled(sharingFeature: string) { /** * Sends a post request to an invite service. * - * @param {Immutable.List} inviteItems - The list of the "sip" type items to invite. + * @param {Array} inviteItems - The list of the "sip" type items to invite. * @param {string} sipInviteUrl - The invite service that generates the invitation. * @param {string} jwt - The jwt token. * @param {string} roomName - The name to the conference.