Skip to content

[Feature Request] Togglable autoLeave in config.json #706

@elch01

Description

@elch01

Describe the problem

Description

Currently, when Sable launches Element Call, it hardcodes call URL parameters in src/app/plugins/call/CallEmbed.ts.
There is no mechanism to pass Element Call configuration options (like autoLeaveWhenOthersLeft) from the admin configuration.

Reasoning

I want to disable the automatic call termination when all other participants leave a call.

This behavior is configured in Element Call via the autoLeave URL parameter, which defaults to true for DM-style calls.
However, Sable never passes this parameter, so im guessing default is set to true for any calls.

Technical Details

Relevant Code:

  • Sable: src/app/plugins/call/CallEmbed.ts (lines 78-93) constructs the widget URL
  • SableCall: src/UrlParams.ts (line 504) reads the autoLeave parameter
  • SableCall: src/state/CallViewModel/CallNotificationLifecycle.ts (lines 116-124) uses the autoLeaveWhenOthersLeft option

What's Missing:
Sable needs to:

  1. Read call configuration from config.json
  2. Pass these options as URL parameters when launching Element Call

Suggested Solution:

Add a new optional callOptions section to config.json:

{
  "callOptions": {
    "autoLeaveWhenOthersLeft": false
  }
}

Describe the solution you'd like

In src/app/plugins/call/CallEmbed.ts

const callConfig = getCallConfig();
const params = new URLSearchParams({
  widgetId,
  parentUrl: clientOrigin,
  baseUrl: mx.baseUrl,
  roomId: room.roomId,
  userId,
  deviceId,
  intent,
  skipLobby: 'true',
  confineToRoom: 'true',
  appPrompt: 'false',
  perParticipantE2EE: room.hasEncryptionStateEvent().toString(),
  lang: 'en-EN',
  theme: themeKind,
  
  // Something like this
  ...(callConfig.autoLeaveWhenOthersLeft !== undefined && {
    autoLeave: callConfig.autoLeaveWhenOthersLeft.toString()
  }),
});

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions