Don't fail hard, let roomserver reject event if it fails auth

This commit is contained in:
Neil Alexander 2021-11-11 12:29:33 +00:00
parent 498fbc277b
commit b1c024c9c1
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -246,15 +246,10 @@ func (r *Joiner) performJoinRoomByID(
if restricted, roomIDs, rerr := r.checkIfRestrictedJoin(ctx, req); rerr != nil {
return "", "", fmt.Errorf("r.performRestrictedJoinChecks: %w", rerr)
} else if restricted {
success := false
for _, roomID := range roomIDs {
if err = r.attemptRestrictedJoinUsingRoomID(ctx, req, roomID, &eb); err != nil {
continue
if err = r.attemptRestrictedJoinUsingRoomID(ctx, req, roomID, &eb); err == nil {
break
}
success = true
}
if !success {
return "", "", fmt.Errorf("restricted join failed")
}
}