mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 04:52:46 +00:00
Remove QueryKnownUsers from current state server (#1393)
* Remove QueryKnownUsers from current state server * Fix HTTP mode
This commit is contained in:
parent
c63abc8660
commit
67cc8619d3
8 changed files with 8 additions and 62 deletions
|
@ -639,7 +639,7 @@ func Setup(
|
|||
req.Context(),
|
||||
device,
|
||||
userAPI,
|
||||
stateAPI,
|
||||
rsAPI,
|
||||
cfg.Matrix.ServerName,
|
||||
postContent.SearchString,
|
||||
postContent.Limit,
|
||||
|
|
|
@ -19,7 +19,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
|
||||
currentstateAPI "github.com/matrix-org/dendrite/currentstateserver/api"
|
||||
"github.com/matrix-org/dendrite/roomserver/api"
|
||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
|
@ -34,7 +34,7 @@ func SearchUserDirectory(
|
|||
ctx context.Context,
|
||||
device *userapi.Device,
|
||||
userAPI userapi.UserInternalAPI,
|
||||
stateAPI currentstateAPI.CurrentStateInternalAPI,
|
||||
rsAPI api.RoomserverInternalAPI,
|
||||
serverName gomatrixserverlib.ServerName,
|
||||
searchString string,
|
||||
limit int,
|
||||
|
@ -81,14 +81,14 @@ func SearchUserDirectory(
|
|||
// start searching for known users from joined rooms.
|
||||
|
||||
if len(results) <= limit {
|
||||
stateReq := ¤tstateAPI.QueryKnownUsersRequest{
|
||||
stateReq := &api.QueryKnownUsersRequest{
|
||||
UserID: device.UserID,
|
||||
SearchString: searchString,
|
||||
Limit: limit - len(results),
|
||||
}
|
||||
stateRes := ¤tstateAPI.QueryKnownUsersResponse{}
|
||||
if err := stateAPI.QueryKnownUsers(ctx, stateReq, stateRes); err != nil {
|
||||
errRes := util.ErrorResponse(fmt.Errorf("stateAPI.QueryKnownUsers: %w", err))
|
||||
stateRes := &api.QueryKnownUsersResponse{}
|
||||
if err := rsAPI.QueryKnownUsers(ctx, stateReq, stateRes); err != nil {
|
||||
errRes := util.ErrorResponse(fmt.Errorf("rsAPI.QueryKnownUsers: %w", err))
|
||||
return &errRes
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue