From 80018bccff1d2b8492054f0a9cec41363d61a1dd Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 15 Oct 2024 12:38:16 +0100 Subject: [PATCH] Supporting change for CVE-2024-47771 / GHSA-963w-49j9-gxj6 --- src/@types/global.d.ts | 1 + src/vector/platform/ElectronPlatform.tsx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 4d36054ce8..a5b3189334 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -26,6 +26,7 @@ type ElectronChannel = | "userDownloadAction" | "openDesktopCapturerSourcePicker" | "userAccessToken" + | "homeserverUrl" | "serverSupportedVersions"; declare global { diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 0f650e7dbb..3772497597 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -126,6 +126,11 @@ export default class ElectronPlatform extends VectorBasePlatform { window.electron!.send("userAccessToken", MatrixClientPeg.get()?.getAccessToken()); }); + // `homeserverUrl` (IPC) is requested by the main process. A reply is sent over the same channel. + window.electron.on("homeserverUrl", () => { + window.electron!.send("homeserverUrl", MatrixClientPeg.get()?.getHomeserverUrl()); + }); + // `serverSupportedVersions` is requested by the main process when it needs to know if the // server supports a particular version. This is primarily used to detect authenticated media // support. A reply is sent over the same channel.