refactor(conversations): read the conversation types from the server - #6650
Conversation
ac1ee9b to
11427d7
Compare
eb2dcca to
b6bd25c
Compare
11427d7 to
094f236
Compare
b6bd25c to
0d12eca
Compare
094f236 to
2b80ea9
Compare
0d12eca to
86afe4c
Compare
2b80ea9 to
b398f3d
Compare
6f175b7 to
f916e09
Compare
f916e09 to
bfd84fb
Compare
9039f52 to
0280b71
Compare
The conversation type cards were hardcoded, so the presets an installation offers, the parameters they apply and the values an administrator configured as the default were all ignored. They now come from the presets endpoint, and the grid renders whatever it reports. Parameters are applied in the documented order: the administrator configured defaults, then the selected type, then the parameters the user chose. Selecting a type drops the choices the user made for the parameters that type defines, so a type can still configure the visibility of a conversation. Assisted-by: Claude Code:claude-opus-5 Claude-Session: https://claude.ai/code/session_014YnDswTbCmRrVETnwE4twB Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
CapabilitiesUtil.isAdmin read config => conversations => is-admin, a capability the server does not publish, so it always returned false. Its last caller is gone now that the presets endpoint decides which conversation types a user is offered. Assisted-by: Claude Code:claude-opus-5 Claude-Session: https://claude.ai/code/session_014YnDswTbCmRrVETnwE4twB Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
0280b71 to
04e2c46
Compare
|
/backport to stable-25.0.x |
|
APK file: https://github.com/nextcloud/talk-android/actions/runs/34131149409/artifacts/10022352511 |
|
Just a summary from claude which might help whenever coming back to this PR: The problem this branch solves Before this branch, the four "conversation type" cards (Default / Voice room / Channel / Announcement) and what settings each one applied were hardcoded in the Android app (ConversationPresetParameters — deleted in this branch). If the server admin wanted to change what "Channel" means, or add a new type, or restrict who could create an "Announcement," the Android app The three building blocks
The server returns a list of these — normally something like default, voiceroom, channel, announcement, plus the two special ones below. The client turns each into a selectable card (ConversationPresetCards.kt).
The two special identifiers Most identifiers (channel, voiceroom, ...) are ordinary, user-pickable conversation types. Two are not — they're structural, and parametersFor() treats them differently:
End-to-end flow
The CreateConversationParamsTest suite exercises each layer of that fold in isolation — untouched fields staying put, a preset overriding the default, the user overriding the preset, forced overriding the user, and an unknown/out-of-range value being ignored rather than crashing the request. |
The conversation type cards were hardcoded, so which types an installation offers, the parameters
they apply and the values an administrator configured as the default were all ignored.
docs/capabilities.mddescribesconversation-presetsas "should be used by clients", so the listnow comes from
GET /ocs/v2.php/apps/spreed/api/v1/presets/roomand the grid renders whatever itreports. A type the server adds needs no app change beyond an icon and a label.
Parameters are applied in the order the server documents: the administrator configured defaults,
then the selected type, then the parameters the user chose. Selecting a type drops the user's choices
for the parameters that type defines, so a type can still configure the visibility of a conversation.
The hardcoded parameter table from the previous PR is deleted; only its shape survives, which was the
point of introducing it there.
This PR is stacked on #6649 and targets its branch, not
master. GitHub retargets it tomasteronce that one merges. The three missing conversation types (webinar, presentation, classified) follow
in the next PR on top of this one.
🖼️ Screenshots
🚧 TODO
🏁 Checklist
/backport to stable-xx.xCapabilities checked:
conversation-presetsgates the whole section,announcement-presetplus theadministrator check gate the announcement type. The presets endpoint is API v1 by its own route
definition, unlike the v4 room endpoints.
🤖 AI (if applicable)
🤖 Generated with Claude Code
https://claude.ai/code/session_014YnDswTbCmRrVETnwE4twB