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

@ -21,7 +21,6 @@ import (
"time"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/clientapi/producers"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/dendrite/roomserver/api"
@ -144,7 +143,6 @@ func SendJoin(
request *gomatrixserverlib.FederationRequest,
cfg *config.Dendrite,
rsAPI api.RoomserverInternalAPI,
producer *producers.RoomserverProducer,
keys gomatrixserverlib.KeyRing,
roomID, eventID string,
) util.JSONResponse {
@ -267,8 +265,8 @@ func SendJoin(
// We are responsible for notifying other servers that the user has joined
// the room, so set SendAsServer to cfg.Matrix.ServerName
if !alreadyJoined {
_, err = producer.SendEvents(
httpReq.Context(),
_, err = api.SendEvents(
httpReq.Context(), rsAPI,
[]gomatrixserverlib.HeaderedEvent{
event.Headered(stateAndAuthChainResponse.RoomVersion),
},
@ -276,7 +274,7 @@ func SendJoin(
nil,
)
if err != nil {
util.GetLogger(httpReq.Context()).WithError(err).Error("producer.SendEvents failed")
util.GetLogger(httpReq.Context()).WithError(err).Error("SendEvents failed")
return jsonerror.InternalServerError()
}
}