From fc8c62a47e7fa5574cea2deba3f7a80c8eb555e7 Mon Sep 17 00:00:00 2001 From: Adhwaith Menon <111346225+adhmenon@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:46:09 +0530 Subject: [PATCH] fix(sdk): fixed-join-link-parsing (#4114) Co-authored-by: rsarika <95286093+rsarika@users.noreply.github.com> --- .../@webex/plugin-meetings/src/constants.ts | 2 ++ .../plugin-meetings/src/meeting-info/utilv2.ts | 4 +++- .../test/unit/spec/meeting-info/utilv2.js | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/@webex/plugin-meetings/src/constants.ts b/packages/@webex/plugin-meetings/src/constants.ts index ddacfbf27f0..d3223f8a56a 100644 --- a/packages/@webex/plugin-meetings/src/constants.ts +++ b/packages/@webex/plugin-meetings/src/constants.ts @@ -36,6 +36,8 @@ export const HOST = 'host'; export const JOIN = 'join'; +export const JOIN_LINK_MTID = 'MTID'; + export const LEAVE = 'leave'; export const LIVE = 'live'; export const LOCAL = 'local'; diff --git a/packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts b/packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts index fec6e17d496..b6349ce1591 100644 --- a/packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts +++ b/packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts @@ -19,6 +19,7 @@ import { UUID_REG, VALID_EMAIL_ADDRESS, DEFAULT_MEETING_INFO_REQUEST_BODY, + JOIN_LINK_MTID, } from '../constants'; import ParameterError from '../common/errors/parameter'; import LoggerProxy from '../common/logs/logger-proxy'; @@ -70,7 +71,8 @@ export default class MeetingInfoUtil { parsedUrl.pathname.includes(`/${MEET_M}`) || parsedUrl.pathname.includes(`/${MEET_CISCO}`) || parsedUrl.pathname.includes(`/${MEET_CO}`) || - parsedUrl.pathname.includes(`/${JOIN}`)); + parsedUrl.pathname.includes(`/${JOIN}`) || + (parsedUrl.search && parsedUrl.search.includes(JOIN_LINK_MTID))); } return hostNameBool && pathNameBool; diff --git a/packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js b/packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js index 722b6585eb0..9a158568250 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js @@ -345,5 +345,22 @@ describe('plugin-meetings', () => { ); }); }); + + describe('#isMeetingLink', () => { + it('should return true for valid join meeting link with MTID', () => { + const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php?MTID=m9fe0afd8c435e892afcce9ea25b97046'); + expect(result).to.be.true; + }); + + it('should return true for valid join meeting link without cisco domain', () => { + const result = MeetingInfoUtil.isMeetingLink('https://test.webex.com/test/j.php?MTID=m9fe0afd8c435e892afcce9ea25b97046'); + expect(result).to.be.true; + }); + + it('should return false for an invalid meeting link', () => { + const result = MeetingInfoUtil.isMeetingLink('https://test.webex.com/test/j.php?MiD=m9fe0afd8c435e892afcce9ea25b97046'); + expect(result).to.be.false; + }); + }); }); });