mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Rename FS queue package to internal (#997)
This commit is contained in:
parent
17e046f18f
commit
908108c23e
5 changed files with 6 additions and 6 deletions
39
federationsender/internal/query.go
Normal file
39
federationsender/internal/query.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/matrix-org/dendrite/federationsender/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
// QueryJoinedHostsInRoom implements api.FederationSenderInternalAPI
|
||||
func (f *FederationSenderInternalAPI) QueryJoinedHostsInRoom(
|
||||
ctx context.Context,
|
||||
request *api.QueryJoinedHostsInRoomRequest,
|
||||
response *api.QueryJoinedHostsInRoomResponse,
|
||||
) (err error) {
|
||||
response.JoinedHosts, err = f.db.GetJoinedHosts(ctx, request.RoomID)
|
||||
return
|
||||
}
|
||||
|
||||
// QueryJoinedHostServerNamesInRoom implements api.FederationSenderInternalAPI
|
||||
func (f *FederationSenderInternalAPI) QueryJoinedHostServerNamesInRoom(
|
||||
ctx context.Context,
|
||||
request *api.QueryJoinedHostServerNamesInRoomRequest,
|
||||
response *api.QueryJoinedHostServerNamesInRoomResponse,
|
||||
) (err error) {
|
||||
joinedHosts, err := f.db.GetJoinedHosts(ctx, request.RoomID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response.ServerNames = make([]gomatrixserverlib.ServerName, 0, len(joinedHosts))
|
||||
for _, host := range joinedHosts {
|
||||
response.ServerNames = append(response.ServerNames, host.ServerName)
|
||||
}
|
||||
|
||||
// TODO: remove duplicates?
|
||||
|
||||
return
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue