Open mxandreas opened 3 weeks ago
It seems the Matrix spec does not define a clear grammar for the local part (#local_part:homeserver.com) of the room alias, and thus what's implemented on EW, seems to be its own best practice. As there is no good reason to change it, and we want the clients to be in sync - @florianduros could you please point out the code in EW which validates the room alias, so we can use this as a reference when implementing in EX and also use to describe to user on UI what is allowed and what is not.
@jmartinesp Has found the corresponding code in EW, this prevents using:
:
, ,
and #
We will stick to this implementation as a change is currently not justified, and not directly related to the scope. The tips on the UI for the end user may be slightly more restrictive for the purpose of keeping it understandable for them.
FWIW this is already handled in Rust in the Ruma crate. Maybe instead of adding custom logic per-client we should create a shared fn is_valid_room_alias(raw: String) -> bool
in Rust that tries to create an alias from a raw string, and returns true if it can be created?
Description
Since this a functionality that already exists in EW, the algorithm for checking for invalid symbols and other constraints is borrowed from EW which currently prevents using the following symbols:
:
,,
and#
(Note that Matrix spec on identifiers unfortunately does not specify any specific rules for the local part of room alias.)
Same goes for checking if the room address is available - the approach for this can be borrowed from EW and adjusted as necessary.
Note that these checks would need to be applied both at room creation and when changing room settings later.
Designs:
Acceptance criteria
Size estimate
None
Dependencies
Out of scope
Open questions
Subtasks