-
Notifications
You must be signed in to change notification settings - Fork 44
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
Constrain the ement-room--event-mentions-user-p regexp #240
Comments
Makes sense. Thanks. |
I looked to see if there were restrictions on characters used for a user's display name, and I'm not seeing anything. Searching for So we can't simply wrap the quoted display name with word boundaries, but I suspect that even if the user had non-word characters at the start or end of their display name, we could assume that any mention of their name will have non-word characters (or bol/eol) surrounding the display name. So maybe something like this:
Possibly in the form of a |
It's kind of hidden here: https://spec.matrix.org/v1.8/appendices/#user-identifiers |
Ah, yes, we have different rules for username and displayname (I was only thinking about displayname). At present
Where |
IIUC, doing this would fix the issue for both username and useid, right?
Can we do this first and deal with the user displayname after? |
About the displayname, it sounds like there is no silver bullet. For example, I think the displayname ":-) me :-)" can be considered a mention in "Hello :-) me :-)" but also in "Hello:-) me :-)". But the displayname ". Therefore" would be matched against "Bla bla. Therefore bla bla", which seems counterintuitive. I guess that to deal with all cases, we should provide a custom fonction that the user may define to match per own displayname, and provide one by default. My opinion would be to provide one that keep the current behavior. |
At present the word
uphill
in a message is treated as mentioning the usernamephil
:)Let's at minimum wrap the pattern with word boundaries?
(Or do we then worry about usernames which do not begin/end with word characters? Either way, I'm sure we can improve this...)
The text was updated successfully, but these errors were encountered: