-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add the register_mxid_from_3pid setting #3096
Conversation
|
@ara4n |
* [x] strip invalid characters from generated mxid
* [x] append numbers to disambiguate clashing mxids
* [x] generate displayanames from 3pids using a dodgy heuristic
* [x] get rid of the create_profile_with_localpart and instead
explicitly set displaynames so they propagate correctly
|
@giomfo oops; fixed now (hopefully). Needs review though. |
|
|
||
| # XXX: a nasty heuristic to turn an email address into | ||
| # a displayname, as part of register_mxid_from_3pid | ||
| parts = address.replace('.', ' ').split('@') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're doing this for msisdns too - is this going to fail for these (presumably there just won't be a parts[1])
| m = re.match(r'^(.*)(\d+)$', desired_username) | ||
| if m: | ||
| desired_username = m.group(1) + str( | ||
| int(m.group(2)) + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a '1' on the end could be a bit confusing for msisdns
|
@dbkr hopefully ^ fixes that. |
|
tests are borked; investigating. |
|
well, that was a mess. going to merge now, but some retrospective review from @dbkr would be appreciated, especially as it touches on the profile replication stuff. |
Adds a setting to prohibit users from picking their own mxid, but instead derive it from the 3PID that they provide during signup.
I need to test this and then seek review from @dbkr probably - opening the PR in order to link to it from elsewhere.