mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 09:43:10 -06:00
Add missing AccountType to return value
This commit is contained in:
parent
587fda0b6f
commit
b5c8fc922c
|
|
@ -78,6 +78,7 @@ func (a *UserInternalAPI) PerformAccountCreation(ctx context.Context, req *api.P
|
|||
Localpart: req.Localpart,
|
||||
ServerName: a.ServerName,
|
||||
UserID: fmt.Sprintf("@%s:%s", req.Localpart, a.ServerName),
|
||||
AccountType: req.AccountType,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ func (s *accountsStatements) insertAccount(
|
|||
UserID: userutil.MakeUserID(localpart, s.serverName),
|
||||
ServerName: s.serverName,
|
||||
AppServiceID: appserviceID,
|
||||
AccountType: accountType,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
@ -148,10 +149,9 @@ func (s *accountsStatements) selectAccountByLocalpart(
|
|||
) (*api.Account, error) {
|
||||
var appserviceIDPtr sql.NullString
|
||||
var acc api.Account
|
||||
var accType api.AccountType
|
||||
|
||||
stmt := s.selectAccountByLocalpartStmt
|
||||
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr, &accType)
|
||||
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr, &acc.AccountType)
|
||||
if err != nil {
|
||||
if err != sql.ErrNoRows {
|
||||
log.WithError(err).Error("Unable to retrieve user from the db")
|
||||
|
|
@ -164,7 +164,6 @@ func (s *accountsStatements) selectAccountByLocalpart(
|
|||
|
||||
acc.UserID = userutil.MakeUserID(localpart, s.serverName)
|
||||
acc.ServerName = s.serverName
|
||||
acc.AccountType = accType
|
||||
|
||||
return &acc, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,10 +148,9 @@ func (s *accountsStatements) selectAccountByLocalpart(
|
|||
) (*api.Account, error) {
|
||||
var appserviceIDPtr sql.NullString
|
||||
var acc api.Account
|
||||
var accType api.AccountType
|
||||
|
||||
stmt := s.selectAccountByLocalpartStmt
|
||||
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr, &accType)
|
||||
err := stmt.QueryRowContext(ctx, localpart).Scan(&acc.Localpart, &appserviceIDPtr, &acc.AccountType)
|
||||
if err != nil {
|
||||
if err != sql.ErrNoRows {
|
||||
log.WithError(err).Error("Unable to retrieve user from the db")
|
||||
|
|
@ -164,7 +163,6 @@ func (s *accountsStatements) selectAccountByLocalpart(
|
|||
|
||||
acc.UserID = userutil.MakeUserID(localpart, s.serverName)
|
||||
acc.ServerName = s.serverName
|
||||
acc.AccountType = accType
|
||||
|
||||
return &acc, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue