mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Remove userAPI from federationapi
This commit is contained in:
parent
32b39d28d3
commit
92657ccf45
|
|
@ -23,6 +23,11 @@ import (
|
||||||
|
|
||||||
"github.com/getsentry/sentry-go"
|
"github.com/getsentry/sentry-go"
|
||||||
"github.com/gorilla/mux"
|
"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"
|
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||||
federationAPI "github.com/matrix-org/dendrite/federationapi/api"
|
federationAPI "github.com/matrix-org/dendrite/federationapi/api"
|
||||||
fedInternal "github.com/matrix-org/dendrite/federationapi/internal"
|
fedInternal "github.com/matrix-org/dendrite/federationapi/internal"
|
||||||
|
|
@ -34,10 +39,6 @@ import (
|
||||||
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
|
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
|
||||||
"github.com/matrix-org/dendrite/setup/config"
|
"github.com/matrix-org/dendrite/setup/config"
|
||||||
userapi "github.com/matrix-org/dendrite/userapi/api"
|
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.
|
// 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 {
|
func(httpReq *http.Request, request *gomatrixserverlib.FederationRequest, vars map[string]string) util.JSONResponse {
|
||||||
return Send(
|
return Send(
|
||||||
httpReq, request, gomatrixserverlib.TransactionID(vars["txnID"]),
|
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)
|
)).Methods(http.MethodPut, http.MethodOptions)
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ func Send(
|
||||||
cfg *config.FederationAPI,
|
cfg *config.FederationAPI,
|
||||||
rsAPI api.FederationRoomserverAPI,
|
rsAPI api.FederationRoomserverAPI,
|
||||||
keyAPI keyapi.FederationKeyAPI,
|
keyAPI keyapi.FederationKeyAPI,
|
||||||
userAPI userapi.FederationUserAPI,
|
|
||||||
keys gomatrixserverlib.JSONVerifier,
|
keys gomatrixserverlib.JSONVerifier,
|
||||||
federation federationAPI.FederationClient,
|
federation federationAPI.FederationClient,
|
||||||
mu *internal.MutexByRoom,
|
mu *internal.MutexByRoom,
|
||||||
|
|
@ -133,7 +132,6 @@ func Send(
|
||||||
roomsMu: mu,
|
roomsMu: mu,
|
||||||
producer: producer,
|
producer: producer,
|
||||||
inboundPresenceEnabled: cfg.Matrix.Presence.EnableInbound,
|
inboundPresenceEnabled: cfg.Matrix.Presence.EnableInbound,
|
||||||
userAPI: userAPI,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var txnEvents struct {
|
var txnEvents struct {
|
||||||
|
|
@ -187,7 +185,6 @@ type txnReq struct {
|
||||||
gomatrixserverlib.Transaction
|
gomatrixserverlib.Transaction
|
||||||
rsAPI api.FederationRoomserverAPI
|
rsAPI api.FederationRoomserverAPI
|
||||||
keyAPI keyapi.FederationKeyAPI
|
keyAPI keyapi.FederationKeyAPI
|
||||||
userAPI userapi.FederationUserAPI
|
|
||||||
ourServerName gomatrixserverlib.ServerName
|
ourServerName gomatrixserverlib.ServerName
|
||||||
keys gomatrixserverlib.JSONVerifier
|
keys gomatrixserverlib.JSONVerifier
|
||||||
federation txnFederationClient
|
federation txnFederationClient
|
||||||
|
|
|
||||||
|
|
@ -98,13 +98,6 @@ func NewInternalAPI(
|
||||||
logrus.WithError(err).Panic("failed to start user API streamed event consumer")
|
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()
|
var cleanOldNotifs func()
|
||||||
cleanOldNotifs = func() {
|
cleanOldNotifs = func() {
|
||||||
logrus.Infof("Cleaning old notifications")
|
logrus.Infof("Cleaning old notifications")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue