mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-10 21:55:19 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
b722cc277e
commit
486ecbfda0
+3
-13
@@ -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<Blob>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,13 +158,9 @@ export function useComponentHostBridge(
|
||||
? undefined
|
||||
: async (): Promise<void> => await close();
|
||||
},
|
||||
get downloadMedia() {
|
||||
const downloadMedia = latest.current.downloadMedia;
|
||||
return downloadMedia === undefined
|
||||
? undefined
|
||||
: async (mxcUri: string): Promise<Blob> =>
|
||||
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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user