Skip to content

Feat/split chat react permissions#16920

Merged
nickvergessen merged 19 commits intomainfrom
feat/split-chat-react-permissions
Jan 30, 2026
Merged

Feat/split chat react permissions#16920
nickvergessen merged 19 commits intomainfrom
feat/split-chat-react-permissions

Conversation

@nickvergessen
Copy link
Member

☑️ Resolves

luflow and others added 19 commits January 30, 2026 09:16
This change separates the combined "chat" permission into two distinct permissions:
- PERMISSIONS_CHAT (128): For posting messages
- PERMISSIONS_REACT (256): For adding/removing reactions

This allows admins to create "announcement channels" where only moderators
can post messages, but all users can still react to those messages.

Backend changes:
- Added PERMISSIONS_REACT constant to Attendee model
- Added REACT permission check in InjectionMiddleware
- Updated ReactionController to use REACT permission instead of CHAT
- Added database migration to grant REACT permission to users with CHAT
- Fixed hardcoded 255 validation in RoomService

Frontend changes:
- Added REACT constant to constants.ts
- Split PermissionsEditor into two separate checkboxes
- Updated MessageItem to check REACT permission for canReact

Resolves: #11329
Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Florian Ludwig <florian@krautnerds.de>
Add 'react-permission' to the FEATURES array and document
it in capabilities.md for Talk 24.

This allows clients to detect when the server supports the
separate REACT permission (256) for adding reactions.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Check for 'react-permission' capability and fall back to CHAT
permission when federating with older servers that don't support
the separate REACT permission.

Also adds 'react-permission' to mocked capabilities for tests.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Update expected participantPermissions from 254 to 510 to reflect
the new MAX_DEFAULT value that includes the REACT permission (256).

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Document the changes needed for Android, iOS, and desktop clients
to support the new separate reaction permission.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Add config.permissions.max-default and config.permissions.max-custom
to the capabilities API. This allows clients to read the maximum
permission values from the server instead of hardcoding them.

- lib/Capabilities.php: Add permissions config section with values
  from Attendee::PERMISSIONS_MAX_DEFAULT (510) and MAX_CUSTOM (511)
- lib/ResponseDefinitions.php: Add psalm type for permissions config
- openapi-full.json: Add permissions object to Capabilities schema
- Regenerate TypeScript types

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Update permissions UI components to respect the react-permission
capability and read MAX values from the API when available.

PermissionsEditor.vue:
- Add hasReactPermissions computed property
- Show combined "Can post messages and reactions" for older servers
- Conditionally show separate REACT checkbox when capability exists
- Use maxDefaultPermission from API with bitwise fallback

ConversationPermissionsSettings.vue:
- Add maxDefaultPermission/maxCustomPermission computed properties
- Read values from config.permissions API when available
- Fall back to PERMISSIONS.MAX_DEFAULT & ~PERMISSIONS.REACT for
  older servers without the capability

Mock capabilities updated for tests.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
- Add config.permissions.max-default and max-custom to capabilities.md
- Rename variable to hasReactPermissions in MessageItem.vue for clarity

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
The OpenAPI schema was validating permissions input against the old
maximum value of 255, which blocked setting the new REACT permission
(256). Updated annotations and schema to allow values up to 511
(PERMISSIONS_MAX_CUSTOM).

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
…lowed

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Button was showing a color change on click even though button was disabled. Action Buttons (attachments + voice recording) did not have this weird behavior when disabled. Might be actually a bug in the vue components - hotfixed via :deep selector

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
- Remove disabled button CSS hotfixes (to be fixed upstream)
- Fix chatReactions logic to only set when capability exists

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
The new permissions config section was added but the OpenAPI specs
weren't regenerated and the PHP unit tests weren't updated with
the expected permissions values.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
The testCapabilitiesDocumentation test iterates over all config
sections from OpenAPI and checks LOCAL_CONFIGS for each. The new
permissions section was missing, causing a TypeError.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
Since permissions has no local (user-specific) configs, its LOCAL_CONFIGS
entry is an empty array. The type must allow list<string> instead of
non-empty-list<string> to accommodate this.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
The change from non-empty-list<string> to list<string> in
ResponseDefinitions requires removing minItems: 1 from the
config-local arrays in the OpenAPI specs.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
@nickvergessen
Copy link
Member Author

  • federation 33->34: is a bit annoying, but the federation test will fail if we don't backport the skip to the stable branch with reverse number match (skip34)
  • chat-2 tests are a problem with nextcloud server and a PR is open in Talk to adjust, so not blocking
  • sharing-1 and sharing-4 are server issues and will be adressed by PRs in server

@nickvergessen nickvergessen merged commit 165e0b6 into main Jan 30, 2026
77 of 83 checks passed
@nickvergessen nickvergessen deleted the feat/split-chat-react-permissions branch January 30, 2026 12:31
@nickvergessen nickvergessen added this to the 🏖️ Next Major (34) milestone Jan 30, 2026
@nickvergessen nickvergessen added 3. to review feature: chat 💬 Chat and system messages feature: reactions 👍 feature: api 🛠️ OCS API for conversations, chats and participants feature: frontend 🖌️ "Web UI" client enhancement labels Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement feature: api 🛠️ OCS API for conversations, chats and participants feature: chat 💬 Chat and system messages feature: frontend 🖌️ "Web UI" client feature: reactions 👍

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants