mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 18:13:09 -06:00
Fix linter errors
This commit is contained in:
parent
e573010cd2
commit
b426961d84
|
|
@ -61,17 +61,17 @@ func InviteV2(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
invitedUser, err := spec.NewUserID(*inviteReq.Event().StateKey(), true)
|
invitedUser, userErr := spec.NewUserID(*inviteReq.Event().StateKey(), true)
|
||||||
if err != nil {
|
if userErr != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.InvalidParam(fmt.Sprintf("The user ID is invalid")),
|
JSON: spec.InvalidParam("The user ID is invalid"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !cfg.Matrix.IsLocalServerName(invitedUser.Domain()) {
|
if !cfg.Matrix.IsLocalServerName(invitedUser.Domain()) {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.InvalidParam(fmt.Sprintf("The invited user domain does not belong to this server")),
|
JSON: spec.InvalidParam("The invited user domain does not belong to this server"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,7 +134,7 @@ func InviteV1(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var strippedState []gomatrixserverlib.InviteStrippedState
|
var strippedState []gomatrixserverlib.InviteStrippedState
|
||||||
if err := json.Unmarshal(event.Unsigned(), &strippedState); err != nil {
|
if jsonErr := json.Unmarshal(event.Unsigned(), &strippedState); jsonErr != nil {
|
||||||
// just warn, they may not have added any.
|
// just warn, they may not have added any.
|
||||||
util.GetLogger(httpReq.Context()).Warnf("failed to extract stripped state from invite event")
|
util.GetLogger(httpReq.Context()).Warnf("failed to extract stripped state from invite event")
|
||||||
}
|
}
|
||||||
|
|
@ -150,13 +150,13 @@ func InviteV1(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.InvalidParam(fmt.Sprintf("The user ID is invalid")),
|
JSON: spec.InvalidParam("The user ID is invalid"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !cfg.Matrix.IsLocalServerName(invitedUser.Domain()) {
|
if !cfg.Matrix.IsLocalServerName(invitedUser.Domain()) {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: spec.InvalidParam(fmt.Sprintf("The invited user domain does not belong to this server")),
|
JSON: spec.InvalidParam("The invited user domain does not belong to this server"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue