2020-05-01 07:01:50 -05:00
|
|
|
package internal
|
2019-08-22 06:47:52 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/matrix-org/dendrite/federationsender/api"
|
|
|
|
)
|
|
|
|
|
2020-04-29 05:34:31 -05:00
|
|
|
// QueryJoinedHostServerNamesInRoom implements api.FederationSenderInternalAPI
|
|
|
|
func (f *FederationSenderInternalAPI) QueryJoinedHostServerNamesInRoom(
|
2019-08-22 06:47:52 -05:00
|
|
|
ctx context.Context,
|
|
|
|
request *api.QueryJoinedHostServerNamesInRoomRequest,
|
|
|
|
response *api.QueryJoinedHostServerNamesInRoomResponse,
|
|
|
|
) (err error) {
|
2020-11-19 05:34:59 -06:00
|
|
|
joinedHosts, err := f.db.GetJoinedHostsForRooms(ctx, []string{request.RoomID})
|
2019-08-22 06:47:52 -05:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
2020-11-19 05:34:59 -06:00
|
|
|
response.ServerNames = joinedHosts
|
2019-08-22 06:47:52 -05:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|