Say outright whether the profile is ours to change

Whether to offer the profile settings was inferred from whether the host
could close Element Call. For a component with no host bridge — the
default — nothing could, so an embedded Element Call let the user edit
the profile of an account that belongs to the host application.

`HostBridge.supportsProfileChanges` states it directly: true standalone,
where Element Call signed the user in itself; false for a widget's host
and for anything embedding the component (which sets it itself, since
the client it hands over is its own). The profile tab and the profile
shortcut follow that. What a host's ability to close us still decides —
what to show after the call ends — is a question about who owns our
lifetime, and stays keyed on `close`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Timo K.
2026-09-08 15:38:59 +02:00
co-authored by Claude Fable 5.1
parent f0359259f9
commit 7cd21476f7
7 changed files with 53 additions and 17 deletions
+15 -1
View File
@@ -96,8 +96,16 @@ export interface HostBridge {
/** The host wants to change, or read back, the device mute state. */
deviceMute$: Observable<HostRequest<DeviceMuteRequest, DeviceMuteState>>;
// What the host is capable of.
// What the host is, and is capable of.
/**
* Whether Element Call may offer to change the user's profile — their
* display name and avatar. Only when the account is Element Call's own,
* which is to say standalone: a widget's host and an application embedding
* Element Call both signed the user in themselves, so the profile is theirs
* to manage and Element Call must not offer to edit it.
*/
readonly supportsProfileChanges: boolean;
/** Whether the host permits Element Call to send and receive reactions. */
readonly supportsReactions: boolean;
/**
@@ -122,6 +130,9 @@ export const nullHostBridge: HostBridge = {
join$: NEVER,
hangUp$: NEVER,
deviceMute$: NEVER,
// Standalone, the account is Element Call's own: it signed the user in, so
// it may offer to change the profile.
supportsProfileChanges: true,
// Standalone Element Call reaches the homeserver itself, so nothing is
// withholding these from it.
supportsReactions: true,
@@ -176,6 +187,9 @@ export function createWidgetHostBridge(widget: WidgetHelpers): HostBridge {
join$: requests(ElementWidgetActions.JoinCall),
hangUp$: requests(ElementWidgetActions.HangupCall),
deviceMute$: requests(ElementWidgetActions.DeviceMute),
// The client we are a widget of signed the user in, so the profile is its
// to manage
supportsProfileChanges: false,
// Element Call needs the host's permission to send reactions on its behalf.
// Read on access rather than up front: the widget API negotiates its
// capabilities asynchronously, and the bridge is built before that settles.