From 486ecbfda080f00d009b9eeb09e5b3318fc46502 Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Tue, 8 Sep 2026 17:14:55 +0200 Subject: [PATCH] Stop offering media downloads on the component's host bridge `downloadMedia` exists because a widget's client cannot fetch media: it has no access token, and its only route to a file is MSC4039 over the widget API. A component host hands over a client that does hold credentials, so Element Call fetches media with it and the callback was never needed there. It comes off `ElementCallHostBridge`, leaving a host with only what it must understand, and stays on the internal HostBridge for the widget. Co-Authored-By: Claude Fable 5.1 --- component/host.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/component/host.ts b/component/host.ts index 701d92102..7e4a0afbb 100644 --- a/component/host.ts +++ b/component/host.ts @@ -64,12 +64,6 @@ export interface ElementCallHostBridge { * Defaults to true. */ readonly supportsReactions?: boolean; - /** - * Fetches media on Element Call's behalf, for hosts that do not want it - * touching the homeserver's media endpoints itself. Absent, Element Call - * fetches media with the client it was given. - */ - downloadMedia?(mxcUri: string): Promise; } /** @@ -164,13 +158,9 @@ export function useComponentHostBridge( ? undefined : async (): Promise => await close(); }, - get downloadMedia() { - const downloadMedia = latest.current.downloadMedia; - return downloadMedia === undefined - ? undefined - : async (mxcUri: string): Promise => - await downloadMedia(mxcUri); - }, + // Not offered to a component host: the client it hands over holds the + // credentials to fetch media itself. A widget's client does not, which + // is what the internal bridge's `downloadMedia` is for. get supportsReactions(): boolean { return latest.current.supportsReactions ?? true; },