aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/membership.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-08-10 14:18:04 +0100
committerGitHub <noreply@github.com>2020-08-10 14:18:04 +0100
commit4b09f445c992fd0a389efc34d75aaa7e5bd50e9c (patch)
tree18d6168718ac06e569eb271f25ed4dc064010b50 /clientapi/routing/membership.go
parentfdabba1851c489d801ea4029bce9dec7d415b2df (diff)
Configuration format v1 (#1230)
* Initial pass at refactoring config (not finished) * Don't forget current state and EDU servers * More shifting around * Update server key API tests * Fix roomserver test * Fix more tests * Further tweaks * Fix current state server test (sort of) * Maybe fix appservices * Fix client API test * Include database connection string in database options * Fix sync API build * Update config test * Fix unit tests * Fix federation sender build * Fix gobind build * Set Listen address for all services in HTTP monolith mode * Validate config, reinstate appservice derived in directory, tweaks * Tweak federation API test * Set MaxOpenConnections/MaxIdleConnections to previous values * Update generate-config
Diffstat (limited to 'clientapi/routing/membership.go')
-rw-r--r--clientapi/routing/membership.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go
index 90ddb699..8303a68e 100644
--- a/clientapi/routing/membership.go
+++ b/clientapi/routing/membership.go
@@ -41,7 +41,7 @@ var errMissingUserID = errors.New("'user_id' must be supplied")
func SendBan(
req *http.Request, accountDB accounts.Database, device *userapi.Device,
- roomID string, cfg *config.Dendrite,
+ roomID string, cfg *config.ClientAPI,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI,
) util.JSONResponse {
body, evTime, roomVer, reqErr := extractRequestData(req, roomID, rsAPI)
@@ -52,7 +52,7 @@ func SendBan(
}
func sendMembership(ctx context.Context, accountDB accounts.Database, device *userapi.Device,
- roomID, membership, reason string, cfg *config.Dendrite, targetUserID string, evTime time.Time,
+ roomID, membership, reason string, cfg *config.ClientAPI, targetUserID string, evTime time.Time,
roomVer gomatrixserverlib.RoomVersion,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI) util.JSONResponse {
@@ -94,7 +94,7 @@ func sendMembership(ctx context.Context, accountDB accounts.Database, device *us
func SendKick(
req *http.Request, accountDB accounts.Database, device *userapi.Device,
- roomID string, cfg *config.Dendrite,
+ roomID string, cfg *config.ClientAPI,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI,
stateAPI currentstateAPI.CurrentStateInternalAPI,
) util.JSONResponse {
@@ -135,7 +135,7 @@ func SendKick(
func SendUnban(
req *http.Request, accountDB accounts.Database, device *userapi.Device,
- roomID string, cfg *config.Dendrite,
+ roomID string, cfg *config.ClientAPI,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI,
) util.JSONResponse {
body, evTime, roomVer, reqErr := extractRequestData(req, roomID, rsAPI)
@@ -170,7 +170,7 @@ func SendUnban(
func SendInvite(
req *http.Request, accountDB accounts.Database, device *userapi.Device,
- roomID string, cfg *config.Dendrite,
+ roomID string, cfg *config.ClientAPI,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI,
) util.JSONResponse {
body, evTime, roomVer, reqErr := extractRequestData(req, roomID, rsAPI)
@@ -236,7 +236,7 @@ func buildMembershipEvent(
targetUserID, reason string, accountDB accounts.Database,
device *userapi.Device,
membership, roomID string, isDirect bool,
- cfg *config.Dendrite, evTime time.Time,
+ cfg *config.ClientAPI, evTime time.Time,
rsAPI roomserverAPI.RoomserverInternalAPI, asAPI appserviceAPI.AppServiceQueryAPI,
) (*gomatrixserverlib.HeaderedEvent, error) {
profile, err := loadProfile(ctx, targetUserID, cfg, accountDB, asAPI)
@@ -263,7 +263,7 @@ func buildMembershipEvent(
return nil, err
}
- return eventutil.BuildEvent(ctx, &builder, cfg, evTime, rsAPI, nil)
+ return eventutil.BuildEvent(ctx, &builder, cfg.Matrix, evTime, rsAPI, nil)
}
// loadProfile lookups the profile of a given user from the database and returns
@@ -273,7 +273,7 @@ func buildMembershipEvent(
func loadProfile(
ctx context.Context,
userID string,
- cfg *config.Dendrite,
+ cfg *config.ClientAPI,
accountDB accounts.Database,
asAPI appserviceAPI.AppServiceQueryAPI,
) (*authtypes.Profile, error) {
@@ -326,7 +326,7 @@ func checkAndProcessThreepid(
req *http.Request,
device *userapi.Device,
body *threepid.MembershipRequest,
- cfg *config.Dendrite,
+ cfg *config.ClientAPI,
rsAPI roomserverAPI.RoomserverInternalAPI,
accountDB accounts.Database,
roomID string,