From 87d8e9e826c3d456a853c71c616008c1c592102a Mon Sep 17 00:00:00 2001 From: ramukaritik Date: Fri, 5 Apr 2024 14:21:29 +0530 Subject: [PATCH] Fix Teams chat link in WebExtensionContext.ts and getTeamChatURL in commonUtil.ts --- src/web/client/WebExtensionContext.ts | 2 +- src/web/client/utilities/commonUtil.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/client/WebExtensionContext.ts b/src/web/client/WebExtensionContext.ts index 53f02347..e5c2c4d1 100644 --- a/src/web/client/WebExtensionContext.ts +++ b/src/web/client/WebExtensionContext.ts @@ -802,7 +802,7 @@ class WebExtensionContext implements IWebExtensionContext { return; } else { const teamsChatLink = getTeamChatURL(mail); - vscode.env.openExternal(vscode.Uri.parse(teamsChatLink.href)); + vscode.env.openExternal(vscode.Uri.parse(teamsChatLink)); } }); } diff --git a/src/web/client/utilities/commonUtil.ts b/src/web/client/utilities/commonUtil.ts index 7182456b..5c5598be 100644 --- a/src/web/client/utilities/commonUtil.ts +++ b/src/web/client/utilities/commonUtil.ts @@ -267,8 +267,8 @@ export function getImageFileContent(fileFsPath: string, fileContent: Uint8Array) return webFileV2 ? fileContent : convertContentToString(fileContent, true); } -export function getTeamChatURL (mail: string) { - return new URL(mail, "https://teams.microsoft.com/l/chat/0/0?users="); +export function getTeamChatURL(mail: string) { + return "https://teams.microsoft.com/l/chat/0/0?users=" + encodeURIComponent(mail); } export function getMailToPath (mail: string) {