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.