From 92657ccf4557fa1e1b8b8d87c6c5d0e92b5a04db Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Wed, 5 Oct 2022 09:16:53 +0200 Subject: [PATCH] Remove userAPI from federationapi --- federationapi/routing/routing.go | 11 ++++++----- federationapi/routing/send.go | 3 --- userapi/userapi.go | 7 ------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index 3b447db2e..723f75591 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -23,6 +23,11 @@ import ( "github.com/getsentry/sentry-go" "github.com/gorilla/mux" + "github.com/matrix-org/gomatrixserverlib" + "github.com/matrix-org/util" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" + "github.com/matrix-org/dendrite/clientapi/jsonerror" federationAPI "github.com/matrix-org/dendrite/federationapi/api" fedInternal "github.com/matrix-org/dendrite/federationapi/internal" @@ -34,10 +39,6 @@ import ( roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" - "github.com/matrix-org/gomatrixserverlib" - "github.com/matrix-org/util" - "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" ) // Setup registers HTTP handlers with the given ServeMux. @@ -128,7 +129,7 @@ func Setup( func(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, vars map[string]string) util.JSONResponse { return Send( httpReq, request, gomatrixserverlib.TransactionID(vars["txnID"]), - cfg, rsAPI, keyAPI, userAPI, keys, federation, mu, servers, producer, + cfg, rsAPI, keyAPI, keys, federation, mu, servers, producer, ) }, )).Methods(http.MethodPut, http.MethodOptions) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index d368d3f0d..060af676d 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -85,7 +85,6 @@ func Send( cfg *config.FederationAPI, rsAPI api.FederationRoomserverAPI, keyAPI keyapi.FederationKeyAPI, - userAPI userapi.FederationUserAPI, keys gomatrixserverlib.JSONVerifier, federation federationAPI.FederationClient, mu *internal.MutexByRoom, @@ -133,7 +132,6 @@ func Send( roomsMu: mu, producer: producer, inboundPresenceEnabled: cfg.Matrix.Presence.EnableInbound, - userAPI: userAPI, } var txnEvents struct { @@ -187,7 +185,6 @@ type txnReq struct { gomatrixserverlib.Transaction rsAPI api.FederationRoomserverAPI keyAPI keyapi.FederationKeyAPI - userAPI userapi.FederationUserAPI ourServerName gomatrixserverlib.ServerName keys gomatrixserverlib.JSONVerifier federation txnFederationClient diff --git a/userapi/userapi.go b/userapi/userapi.go index be1b6a21d..d26b4e19a 100644 --- a/userapi/userapi.go +++ b/userapi/userapi.go @@ -98,13 +98,6 @@ func NewInternalAPI( logrus.WithError(err).Panic("failed to start user API streamed event consumer") } - roomserverConsumer := consumers.NewOutputRoomEventConsumer( - base, js, db, - ) - if err := roomserverConsumer.Start(); err != nil { - logrus.WithError(err).Panic("failed to start user API roomserver event consumer") - } - var cleanOldNotifs func() cleanOldNotifs = func() { logrus.Infof("Cleaning old notifications")