Tweak fallback

This commit is contained in:
Neil Alexander 2022-11-18 12:25:49 +00:00
parent c059de4f2a
commit 0227613214
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -551,6 +551,7 @@ func Register(
}
var r registerRequest
r.ServerName = cfg.Matrix.ServerName
if v := cfg.Matrix.VirtualHostForHTTPHost(gomatrixserverlib.ServerName(req.Host)); v != nil {
r.ServerName = v.ServerName
}
@ -578,7 +579,6 @@ func Register(
if resErr := httputil.UnmarshalJSON(reqBody, &r); resErr != nil {
return *resErr
}
r.ServerName = cfg.Matrix.ServerName
if l, d, err := cfg.Matrix.SplitLocalID('@', r.Username); err == nil {
r.Username, r.ServerName = l, d
}