Add togglable autoLeave to call config (#706)#707
Open
mvanhorn wants to merge 1 commit intoSableClient:devfrom
Open
Add togglable autoLeave to call config (#706)#707mvanhorn wants to merge 1 commit intoSableClient:devfrom
mvanhorn wants to merge 1 commit intoSableClient:devfrom
Conversation
Element Call supports an autoLeave URL parameter that controls whether
a call auto-terminates when all other participants leave. Sable was
never forwarding it, so the Element Call default (true for DM-style
calls) always applied with no way to override.
This adds an optional callOptions section to the client config with
an autoLeaveWhenOthersLeft boolean. When set, it flows from
useClientConfig -> useCallStart -> createCallEmbed -> CallEmbed.getWidget,
which translates it into the autoLeave URL parameter. When absent, the
current behavior is unchanged.
Example config.json:
"callOptions": {
"autoLeaveWhenOthersLeft": false
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
callOptionssection to the Sable client config so admins can opt out of Element Call's default "auto leave when all other participants leave" behavior.Closes #706
Why
Element Call exposes an
autoLeaveURL parameter that defaults totruefor DM-style calls; Sable currently hardcodes the widget URL insrc/app/plugins/call/CallEmbed.tsand never passes it, so there's no way to override the default. Issue #706 asks for a config-driven toggle.Changes
src/app/hooks/useClientConfig.ts: newCallOptionsConfigtype + optionalcallOptionsonClientConfig.src/app/plugins/call/CallEmbed.ts: export aCallOptionstype;getWidgetaccepts an optionalcallOptionsargument and, whenautoLeaveWhenOthersLeftis defined, sets theautoLeaveURL parameter to that boolean as a string.src/app/hooks/useCallEmbed.ts:createCallEmbedforwardscallOptions;useCallStartreadsclientConfig.callOptionsand threads it through.Default behavior is unchanged when
callOptionsis absent.Usage
{ "callOptions": { "autoLeaveWhenOthersLeft": false } }Testing
npx tsc --noEmitclean.npx eslintclean for the touched files (two pre-existingno-consolewarnings elsewhere inCallEmbed.tsare not from this change).npx prettier --checkclean.