Tweak fallback
This commit is contained in:
parent
c059de4f2a
commit
0227613214
|
@ -551,6 +551,7 @@ func Register(
|
||||||
}
|
}
|
||||||
|
|
||||||
var r registerRequest
|
var r registerRequest
|
||||||
|
r.ServerName = cfg.Matrix.ServerName
|
||||||
if v := cfg.Matrix.VirtualHostForHTTPHost(gomatrixserverlib.ServerName(req.Host)); v != nil {
|
if v := cfg.Matrix.VirtualHostForHTTPHost(gomatrixserverlib.ServerName(req.Host)); v != nil {
|
||||||
r.ServerName = v.ServerName
|
r.ServerName = v.ServerName
|
||||||
}
|
}
|
||||||
|
@ -578,7 +579,6 @@ func Register(
|
||||||
if resErr := httputil.UnmarshalJSON(reqBody, &r); resErr != nil {
|
if resErr := httputil.UnmarshalJSON(reqBody, &r); resErr != nil {
|
||||||
return *resErr
|
return *resErr
|
||||||
}
|
}
|
||||||
r.ServerName = cfg.Matrix.ServerName
|
|
||||||
if l, d, err := cfg.Matrix.SplitLocalID('@', r.Username); err == nil {
|
if l, d, err := cfg.Matrix.SplitLocalID('@', r.Username); err == nil {
|
||||||
r.Username, r.ServerName = l, d
|
r.Username, r.ServerName = l, d
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue