mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 21:32:46 +00:00
Fall back to federation if we can't satisfy with any of our local users
This commit is contained in:
parent
2890218c4b
commit
0c3d2f0f64
3 changed files with 11 additions and 4 deletions
|
@ -250,11 +250,19 @@ func (r *Joiner) performJoinRoomByID(
|
|||
if restricted, roomIDs, rerr := r.checkIfRestrictedJoin(ctx, req); rerr != nil {
|
||||
return "", "", err
|
||||
} else if restricted {
|
||||
success := false
|
||||
for _, roomID := range roomIDs {
|
||||
if err = r.attemptRestrictedJoinUsingRoomID(ctx, req, roomID, &eb); err == nil {
|
||||
success = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !success {
|
||||
// We haven't been able to validate the join using any of our own
|
||||
// local users, so we now need to depend on a remote server to help.
|
||||
joinedVia, err = r.performFederatedJoinRoomByID(ctx, req)
|
||||
return req.RoomIDOrAlias, joinedVia, err
|
||||
}
|
||||
}
|
||||
|
||||
// Try to construct an actual join event from the template.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue