-
Notifications
You must be signed in to change notification settings - Fork 108
feat: Add support for separate react permission (Talk 24+) #2366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hello @luflow, thanks a lot for your PRs - much appreciated! I didn't look too closely yet, but one thing I noticed is we loose the fallback (of the fallback): So for very old servers, we need to keep that check. |
9bcd41c to
621f6b9
Compare
True story, did a small refactoring and introduced room.canChat - so now it quite readable and better maintainable, duplicate checks are removed too :) |
8dd5964 to
f98ced8
Compare
|
Thanks a lot, that looks indeed very nice now! Just FYI, we will wait until the server part is merged, before we move forward with this one, but it is on our radar :) |
ef3d8e2 to
06510f4
Compare
Implement support for the new react-permission capability introduced in Talk 24 (Nextcloud 34). Previously, the CHAT permission (128) controlled both posting messages and adding reactions. This has been split into: - CHAT (128): Post messages and share items - REACT (256): Add/remove reactions Changes: - Add NCPermissionReact (256) permission constant - Add kCapabilityReactPermission capability constant - Add canReact computed property to NCRoom that checks for the react-permission capability and falls back to chat permission for older servers - Update ChatViewController to use room.canReact for reaction permission checks Signed-off-by: Florian Ludwig <[email protected]>
Preserve backward compatibility for servers that don't have the chat-permission capability by allowing reactions unconditionally, matching the original behavior before the react-permission refactor. Signed-off-by: Florian Ludwig <[email protected]>
Centralize chat permission check with fallback for very old servers into a reusable canChat property, similar to other permission helpers. Update ChatViewController and ShareViewController to use it. Signed-off-by: Florian Ludwig <[email protected]>
Instead of generic "could not be added/removed" errors, show a clear message when the user lacks permission to react in the conversation. Signed-off-by: Florian Ludwig <[email protected]>
Signed-off-by: Florian Ludwig <[email protected]>
06510f4 to
ba64962
Compare
Signed-off-by: Florian Ludwig <[email protected]>
ce471ca to
ca7afae
Compare
- Use capability check instead of branch name for react-permission - Centralize SERVER_URL and add reusable has_capability function - Fix chat API endpoint (v1 instead of v4) - Fix test to wait for message instead of call button - Simplify chat message payload to required fields only Signed-off-by: Florian Ludwig <[email protected]>
Signed-off-by: Florian Ludwig <[email protected]>
0367151 to
e09bd7a
Compare
Co-authored-by: Marcel Müller <[email protected]> Signed-off-by: Florian Ludwig <[email protected]>
Summary
This PR implements support for the new
react-permissioncapability that will be introduced in Talk 24 (Nextcloud 34) via nextcloud/spreed#11329.Migration guide: https://github.com/luflow/spreed/blob/93bedef92873edbf7a4ae28730c0d514a1cd2f97/docs/react-permission-integration.md
Previously, the CHAT permission (128) controlled both posting messages and adding reactions. This has been split into two separate permissions:
Changes
NCPermissionReact = 256permission constant toNCRoom.hkCapabilityReactPermissioncapability constant toNCDatabaseManagercanReactcomputed property toNCRoomthat:react-permissioncapability (Talk 24+)ChatViewControllerto useroom.canReactfor reaction permission checksBackward Compatibility
The implementation maintains backward compatibility with older Talk servers by falling back to the CHAT permission check when the
react-permissioncapability is not present.