Remove clientapi producers which aren't actually producers (#1111)

* Remove clientapi producers which aren't actually producers

They are actually just convenience wrappers around the internal APIs
for roomserver/eduserver. Move their logic to their respective `api`
packages and call them directly.

* Remove TODO

* unbreak ygg
This commit is contained in:
Kegsay 2020-06-10 12:17:54 +01:00 committed by GitHub
parent d9d6f4568c
commit b7187a9a35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 160 additions and 226 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/matrix-org/dendrite/clientapi"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
"github.com/matrix-org/dendrite/clientapi/producers"
eduServerAPI "github.com/matrix-org/dendrite/eduserver/api"
"github.com/matrix-org/dendrite/federationapi"
federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api"
@ -41,8 +40,6 @@ type Monolith struct {
RoomserverAPI roomserverAPI.RoomserverInternalAPI
ServerKeyAPI serverKeyAPI.ServerKeyInternalAPI
// TODO: remove, this isn't even a producer
EDUProducer *producers.EDUServerProducer
// TODO: can we remove this? It's weird that we are required the database
// yet every other component can do that on its own. libp2p-demo uses a custom
// database though annoyingly.
@ -65,7 +62,7 @@ func (m *Monolith) AddAllPublicRoutes(publicMux *mux.Router) {
federationapi.AddPublicRoutes(
publicMux, m.Config, m.AccountDB, m.DeviceDB, m.FedClient,
m.KeyRing, m.RoomserverAPI, m.AppserviceAPI, m.FederationSenderAPI,
m.EDUProducer,
m.EDUInternalAPI,
)
mediaapi.AddPublicRoutes(publicMux, m.Config, m.DeviceDB)
publicroomsapi.AddPublicRoutes(