under CI: more logging and enable mscs, nil fix

This commit is contained in:
Kegan Dougal 2020-11-24 17:22:36 +00:00
parent 1bd676a257
commit e278ce93af
2 changed files with 5 additions and 2 deletions

View file

@ -63,6 +63,8 @@ func main() {
if *defaultsForCI { if *defaultsForCI {
cfg.ClientAPI.RateLimiting.Enabled = false cfg.ClientAPI.RateLimiting.Enabled = false
cfg.FederationSender.DisableTLSValidation = true cfg.FederationSender.DisableTLSValidation = true
cfg.MSCs.MSCs = []string{"msc2836"}
cfg.Logging[0].Level = "trace"
} }
j, err := yaml.Marshal(cfg) j, err := yaml.Marshal(cfg)

View file

@ -110,7 +110,7 @@ func Enable(
}) })
base.PublicClientAPIMux.Handle("/unstable/event_relationships", base.PublicClientAPIMux.Handle("/unstable/event_relationships",
httputil.MakeAuthAPI("eventRelationships", userAPI, eventRelationshipHandler(db, rsAPI)), httputil.MakeAuthAPI("eventRelationships", userAPI, eventRelationshipHandler(db, rsAPI, fsAPI)),
).Methods(http.MethodPost, http.MethodOptions) ).Methods(http.MethodPost, http.MethodOptions)
base.PublicFederationAPIMux.Handle("/unstable/event_relationships", httputil.MakeExternalAPI( base.PublicFederationAPIMux.Handle("/unstable/event_relationships", httputil.MakeExternalAPI(
@ -141,7 +141,7 @@ type reqCtx struct {
fsAPI fs.FederationSenderInternalAPI fsAPI fs.FederationSenderInternalAPI
} }
func eventRelationshipHandler(db Database, rsAPI roomserver.RoomserverInternalAPI) func(*http.Request, *userapi.Device) util.JSONResponse { func eventRelationshipHandler(db Database, rsAPI roomserver.RoomserverInternalAPI, fsAPI fs.FederationSenderInternalAPI) func(*http.Request, *userapi.Device) util.JSONResponse {
return func(req *http.Request, device *userapi.Device) util.JSONResponse { return func(req *http.Request, device *userapi.Device) util.JSONResponse {
relation, err := NewEventRelationshipRequest(req.Body) relation, err := NewEventRelationshipRequest(req.Body)
if err != nil { if err != nil {
@ -156,6 +156,7 @@ func eventRelationshipHandler(db Database, rsAPI roomserver.RoomserverInternalAP
req: relation, req: relation,
userID: device.UserID, userID: device.UserID,
rsAPI: rsAPI, rsAPI: rsAPI,
fsAPI: fsAPI,
isFederatedRequest: false, isFederatedRequest: false,
db: db, db: db,
authorisedRoomIDs: make(map[string]gomatrixserverlib.RoomVersion), authorisedRoomIDs: make(map[string]gomatrixserverlib.RoomVersion),