Update username checks#1892
Conversation
5616455 to
fa501a9
Compare
HassanAbouelela
left a comment
There was a problem hiding this comment.
All clear! The alphabetical sorting was unexpected, but appreciated, nicely done.
fa501a9 to
5645f79
Compare
|
Normalizing strings before checking if they match on all filters removes our ability to match specific unnormalized forms. I guess this should be ok, although we should look into our current filters and see what can no longer match. I'm not sure how aggressive the normalization by confusables is. |
6a5a3fa to
2fbcec6
Compare
|
I had a bit more of a look into the string normalisation stuff, so I just want to outline my findings.
''.join(
c
for c in unicodedata.normalize("NFKD", text)
if not unicodedata.combining(c)
)
Our solution doesn't need to be perfect so we can probably just go with the simple option (2) and revisit it if we feel it's necessary. |
f12b5f2 to
7e395ae
Compare
onerandomusername
left a comment
There was a problem hiding this comment.
this looks good to me, keep up the moderation tooling! ![]()
(side: I agree with bluenix's comments)
jchristgit
left a comment
There was a problem hiding this comment.
Nice use of unicodedata 👍
7e395ae to
16f389e
Compare
Ss soon as we get a match for a bad name, return it, rather than running it against the rest of the filters.
16f389e to
d0dc7a0
Compare
Closes #1891
Currently, we check people's usernames when they send a message on the server, to ensure it isn't inappropriate. To get more coverage, we should actually be checking member join and member update events, as people can still have their nickname be visible on server without ever sending a message. They can also update their usernames after sending a message.
I have also:
check_send_alert()call to the first thing we do, as a redis call is cheaper than checking all our filter tokens