mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-23 14:53:10 -06:00
reinstate federated peeks in the roomserver (doh)
This commit is contained in:
parent
df29509e7e
commit
410ac724a6
|
|
@ -151,11 +151,27 @@ func (r *Peeker) performPeekRoomByID(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the server name in the room ID isn't ours then it's a
|
// handle federated peeks
|
||||||
// possible candidate for finding the room via federation. Add
|
|
||||||
// it to the list of servers to try.
|
|
||||||
if domain != r.Cfg.Matrix.ServerName {
|
if domain != r.Cfg.Matrix.ServerName {
|
||||||
|
// If the server name in the room ID isn't ours then it's a
|
||||||
|
// possible candidate for finding the room via federation. Add
|
||||||
|
// it to the list of servers to try.
|
||||||
req.ServerNames = append(req.ServerNames, domain)
|
req.ServerNames = append(req.ServerNames, domain)
|
||||||
|
|
||||||
|
// Try peeking by all of the supplied server names.
|
||||||
|
fedReq := fsAPI.PerformPeekRequest{
|
||||||
|
RoomID: req.RoomIDOrAlias, // the room ID to try and peek
|
||||||
|
ServerNames: req.ServerNames, // the servers to try peeking via
|
||||||
|
}
|
||||||
|
fedRes := fsAPI.PerformPeekResponse{}
|
||||||
|
r.FSAPI.PerformPeek(ctx, &fedReq, &fedRes)
|
||||||
|
if fedRes.LastError != nil {
|
||||||
|
return "", &api.PerformError{
|
||||||
|
Code: api.PerformErrRemote,
|
||||||
|
Msg: fedRes.LastError.Message,
|
||||||
|
RemoteCode: fedRes.LastError.Code,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this room isn't world_readable, we reject.
|
// If this room isn't world_readable, we reject.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue