Skip to content

Commit 01d14da

Browse files
author
balbany
committed
isValidTeamsChannelId - Fixing regex to
allow 'tacv2' channel id format.
1 parent ee3c531 commit 01d14da

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/Utils.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ describe('Utils', () => {
106106
assert.strictEqual(result, true);
107107
});
108108

109+
it('isValidTeamsChannelId returns true if valid channelId with new tacv2 format', () => {
110+
const result = Utils.isValidTeamsChannelId('19:[email protected]');
111+
assert.strictEqual(result, true);
112+
});
113+
109114
it('isValidTeamsChannelId returns false if invalid channelId (missing colon)', () => {
110115
const result = Utils.isValidTeamsChannelId('[email protected]');
111116
assert.strictEqual(result, false);

src/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class Utils {
5656
}
5757

5858
public static isValidTeamsChannelId(guid: string): boolean {
59-
const guidRegEx: RegExp = new RegExp(/^19:[0-9a-zA-Z]+@thread\.skype$/i);
59+
const guidRegEx: RegExp = new RegExp(/^19:[0-9a-zA-Z]+@thread\.(skype|tacv2)$/i);
6060

6161
return guidRegEx.test(guid);
6262
}

0 commit comments

Comments
 (0)