Skip to content

Commit

Permalink
fix(plugin-meetings): add alias in joinMeeting request body: SPARK-51…
Browse files Browse the repository at this point in the history
…4797 (#3532)

Co-authored-by: stawang2 <[email protected]>
  • Loading branch information
2 people authored and sreenara committed Apr 19, 2024
1 parent 4a95273 commit a978d15
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/@webex/plugin-meetings/src/meeting/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
* @param {String} options.locale,
* @param {Array} options.deviceCapabilities
* @param {boolean} options.liveAnnotationSupported
* @param {String} options.alias
* @returns {Promise}
*/
async joinMeeting(options: {
Expand All @@ -128,6 +129,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
deviceCapabilities?: Array<string>;
liveAnnotationSupported: boolean;
ipVersion?: IP_VERSION;
alias?: string;
}) {
const {
asResourceOccupant,
Expand All @@ -151,6 +153,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
deviceCapabilities = [],
liveAnnotationSupported,
ipVersion,
alias,
} = options;

LoggerProxy.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);
Expand Down Expand Up @@ -180,6 +183,10 @@ export default class MeetingRequest extends StatelessWebexPlugin {
},
};

if (alias) {
body.alias = alias;
}

if (breakoutsSupported) {
deviceCapabilities.push(BREAKOUTS.BREAKOUTS_SUPPORTED);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ describe('plugin-meetings', () => {
assert.equal(requestParams.body.permissionToken, 'permission-token');
assert.equal(requestParams.body.device.regionCode, 'WEST-COAST');
assert.include(requestParams.body.device.localIp, '127.0.0');
assert.deepEqual(requestParams.body.localMedias, [{localSdp: '{"roapMessage":"roap-message","reachability":"reachability"}'}]);
assert.deepEqual(requestParams.body.localMedias, [
{localSdp: '{"roapMessage":"roap-message","reachability":"reachability"}'},
]);

assert.calledOnceWithExactly(anonymizeIpSpy, '127.0.0.1');
});
Expand Down Expand Up @@ -368,6 +370,22 @@ describe('plugin-meetings', () => {
assert.deepEqual(requestParams.body.locale, undefined);
});

it('adds alias to request when they are provided', async () => {
await meetingsRequest.joinMeeting({
alias: 'assigned name',
});
const requestParams = meetingsRequest.request.getCall(0).args[0];

assert.deepEqual(requestParams.body.alias, 'assigned name');
});

it('does not add alias to request when they are not provided', async () => {
await meetingsRequest.joinMeeting({});
const requestParams = meetingsRequest.request.getCall(0).args[0];

assert.deepEqual(requestParams.body.alias, undefined);
});

it('includes joinCookie and ipver correctly', async () => {
const locusUrl = 'locusURL';
const deviceUrl = 'deviceUrl';
Expand Down

0 comments on commit a978d15

Please sign in to comment.