Remove ServerACLs from the current state server (#1390)

* Remove ServerACLs from the current state server

Functionality moved to roomserver

* Nothing to see here, move along
This commit is contained in:
Kegsay 2020-09-04 10:40:58 +01:00 committed by GitHub
parent f1a98e1193
commit 2570418f42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 43 additions and 421 deletions

View file

@ -16,18 +16,15 @@ package internal
import (
"context"
"errors"
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
"github.com/matrix-org/dendrite/currentstateserver/acls"
"github.com/matrix-org/dendrite/currentstateserver/api"
"github.com/matrix-org/dendrite/currentstateserver/storage"
"github.com/matrix-org/gomatrixserverlib"
)
type CurrentStateInternalAPI struct {
DB storage.Database
ServerACLs *acls.ServerACLs
DB storage.Database
}
func (a *CurrentStateInternalAPI) QueryCurrentState(ctx context.Context, req *api.QueryCurrentStateRequest, res *api.QueryCurrentStateResponse) error {
@ -115,11 +112,3 @@ func (a *CurrentStateInternalAPI) QuerySharedUsers(ctx context.Context, req *api
res.UserIDsToCount = users
return nil
}
func (a *CurrentStateInternalAPI) QueryServerBannedFromRoom(ctx context.Context, req *api.QueryServerBannedFromRoomRequest, res *api.QueryServerBannedFromRoomResponse) error {
if a.ServerACLs == nil {
return errors.New("no server ACL tracking")
}
res.Banned = a.ServerACLs.IsServerBannedFromRoom(req.ServerName, req.RoomID)
return nil
}