mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
refactor: update GMSL (#3058)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
This commit is contained in:
parent
9fa39263c0
commit
72285b2659
306 changed files with 2117 additions and 1934 deletions
|
@ -37,6 +37,7 @@ import (
|
|||
"github.com/matrix-org/dendrite/setup/config"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
"github.com/matrix-org/gomatrixserverlib/tokens"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
@ -206,10 +207,10 @@ var (
|
|||
// previous parameters with the ones supplied. This mean you cannot "build up" request params.
|
||||
type registerRequest struct {
|
||||
// registration parameters
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
ServerName gomatrixserverlib.ServerName `json:"-"`
|
||||
Admin bool `json:"admin"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
ServerName spec.ServerName `json:"-"`
|
||||
Admin bool `json:"admin"`
|
||||
// user-interactive auth params
|
||||
Auth authDict `json:"auth"`
|
||||
|
||||
|
@ -478,7 +479,7 @@ func Register(
|
|||
}
|
||||
|
||||
var r registerRequest
|
||||
host := gomatrixserverlib.ServerName(req.Host)
|
||||
host := spec.ServerName(req.Host)
|
||||
if v := cfg.Matrix.VirtualHostForHTTPHost(host); v != nil {
|
||||
r.ServerName = v.ServerName
|
||||
} else {
|
||||
|
@ -824,7 +825,7 @@ func checkAndCompleteFlow(
|
|||
func completeRegistration(
|
||||
ctx context.Context,
|
||||
userAPI userapi.ClientUserAPI,
|
||||
username string, serverName gomatrixserverlib.ServerName, displayName string,
|
||||
username string, serverName spec.ServerName, displayName string,
|
||||
password, appserviceID, ipAddr, userAgent, sessionID string,
|
||||
inhibitLogin eventutil.WeakBoolean,
|
||||
deviceDisplayName, deviceID *string,
|
||||
|
@ -994,7 +995,7 @@ func RegisterAvailable(
|
|||
// Squash username to all lowercase letters
|
||||
username = strings.ToLower(username)
|
||||
domain := cfg.Matrix.ServerName
|
||||
host := gomatrixserverlib.ServerName(req.Host)
|
||||
host := spec.ServerName(req.Host)
|
||||
if v := cfg.Matrix.VirtualHostForHTTPHost(host); v != nil {
|
||||
domain = v.ServerName
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue