fix(sounds): fall back when the server has no play-sounds capability - #19239
Open
bakiburakogun wants to merge 1 commit into
Open
fix(sounds): fall back when the server has no play-sounds capability#19239bakiburakogun wants to merge 1 commit into
bakiburakogun wants to merge 1 commit into
Conversation
Since Talk 24 the sounds store takes the user's "play sounds" setting from the capabilities (config.call.play-sounds). Servers before Talk 24 don't expose it there, so against such a server getTalkConfig() returns undefined, sounds are off after every start and the toggle in the settings dialog doesn't stick. Keep the capability as the first source and fall back to the value remembered in browser storage, then to the initial state older servers still provide, and finally to enabled. When the capability is missing, also mirror the setting to browser storage on change so the next start can pick it up. Ref nextcloud/talk-desktop#1087 Signed-off-by: Baki Burak Ogun <63836730+bakiburakogun@users.noreply.github.com>
Member
|
Hi @bakiburakogun thanks for your frequent involvement. In case you are interested you can send me an email to |
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.
☑️ Resolves
Since Talk 24 the sounds store reads the user's "play sounds" setting from the capabilities (
config.call.play-sounds). That works against a Talk 24+ server, but servers before Talk 24 don't have that capability at all, sogetTalkConfig('local', 'call', 'play-sounds')returnsundefinedthere: sounds are off after every start and the toggle in the settings dialog doesn't stick, which is the talk-desktop issue above again (the 2.2.x desktop client bundles the Talk 24 frontend and still supports NC 32/33 servers), just with the default flipped to silent.This keeps the capability as the first source and adds fallbacks for older servers:
play_sounds) that the web page of older servers still providesWhen the capability is missing,
setShouldPlaySoundsadditionally mirrors the value to browser storage so the next start can pick it up. Guests are unchanged (storage first, then capability, then initial state). Against Talk 24+ nothing changes.Known limitation on older servers: a change made in another browser/device isn't picked up until the toggle is used locally, since there is no way to read the value back. That's the same trade-off @Antreesy described in the linked issue.
Added a small spec for the store's initial value and the action; the store computes its initial value at import time, so the tests reload the module.
🖼️ Screenshots
n/a
🚧 Tasks
🏁 Checklist
docs/is updated or not required