Placate the almighty linter

One day I will nuke `gocyclo` from orbit and everything in the world will be much better for it.
This commit is contained in:
Neil Alexander 2022-05-24 16:47:45 +01:00
parent 553814f810
commit f442abfa0c
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 3 additions and 1 deletions

View file

@ -161,6 +161,7 @@ func (r *Joiner) performJoinRoomByAlias(
}
// TODO: Break this function up a bit
// nolint:gocyclo
func (r *Joiner) performJoinRoomByID(
ctx context.Context,
req *rsAPI.PerformJoinRequest,

View file

@ -799,7 +799,8 @@ func (r *Queryer) QueryRestrictedJoinAllowed(ctx context.Context, req *api.Query
// If the user is already invited to the room then the join is allowed
// but we don't specify an authorised via user, since the event auth
// will allow the join anyway.
if pending, _, _, err := helpers.IsInvitePending(ctx, r.DB, req.RoomID, req.UserID); err != nil {
var pending bool
if pending, _, _, err = helpers.IsInvitePending(ctx, r.DB, req.RoomID, req.UserID); err != nil {
return fmt.Errorf("helpers.IsInvitePending: %w", err)
} else if pending {
res.Allowed = true