element-hq / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://element-hq.github.io/synapse
GNU Affero General Public License v3.0
1.44k stars 171 forks source link

Improvement: add the ability to limit certain tags for users #17831

Open lamoboos223 opened 4 days ago

lamoboos223 commented 4 days ago

In current matrix synapse you can set as many tags as you want, but I’m proposing to add an attribute in homeserver.yaml to restrict applying some tags to specific max amount. For example: a user can add the tag u.pin to 3 rooms only if these directive exist in homeserver.yaml

tags:

sandhose commented 4 days ago

The API for setting new tags only specifies a 200 OK status: https://spec.matrix.org/v1.12/client-server-api/#put_matrixclientv3useruseridroomsroomidtagstag

I feel like this would require a spec change to add possible error messages to tell the client that they can't set more tags, or even an API for the client to discover the limit

lamoboos223 commented 4 days ago

I can do the logic and the error as PR, but I have no clue how to add discovery to let clients know about tags restrictions. Can you elaborate?

@sandhose

sandhose commented 4 days ago

What I mean is that to do this change properly, so that clients can properly react to this change, you'd need to propose a spec change through the Matrix Spec Change process outlined here: https://github.com/matrix-org/matrix-spec-proposals?tab=readme-ov-file#summary-of-the-process