aboutsummaryrefslogtreecommitdiff
path: root/clientapi/threepid
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-06-10 12:17:54 +0100
committerGitHub <noreply@github.com>2020-06-10 12:17:54 +0100
commitb7187a9a354530c1846c2a97be701ea484f91c2c (patch)
tree6d14903a444fa8bca964247dbe85ae8d9709d4c8 /clientapi/threepid
parentd9d6f4568ce891ae0ae9d2a3449974d3777bd21d (diff)
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
Diffstat (limited to 'clientapi/threepid')
-rw-r--r--clientapi/threepid/invites.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/clientapi/threepid/invites.go b/clientapi/threepid/invites.go
index 8f173bf8..b0df0dd4 100644
--- a/clientapi/threepid/invites.go
+++ b/clientapi/threepid/invites.go
@@ -26,7 +26,6 @@ import (
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
- "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"
@@ -88,7 +87,7 @@ func CheckAndProcessInvite(
ctx context.Context,
device *authtypes.Device, body *MembershipRequest, cfg *config.Dendrite,
rsAPI api.RoomserverInternalAPI, db accounts.Database,
- producer *producers.RoomserverProducer, membership string, roomID string,
+ membership string, roomID string,
evTime time.Time,
) (inviteStoredOnIDServer bool, err error) {
if membership != gomatrixserverlib.Invite || (body.Address == "" && body.IDServer == "" && body.Medium == "") {
@@ -112,7 +111,7 @@ func CheckAndProcessInvite(
// "m.room.third_party_invite" have to be emitted from the data in
// storeInviteRes.
err = emit3PIDInviteEvent(
- ctx, body, storeInviteRes, device, roomID, cfg, rsAPI, producer, evTime,
+ ctx, body, storeInviteRes, device, roomID, cfg, rsAPI, evTime,
)
inviteStoredOnIDServer = err == nil
@@ -331,7 +330,7 @@ func emit3PIDInviteEvent(
ctx context.Context,
body *MembershipRequest, res *idServerStoreInviteResponse,
device *authtypes.Device, roomID string, cfg *config.Dendrite,
- rsAPI api.RoomserverInternalAPI, producer *producers.RoomserverProducer,
+ rsAPI api.RoomserverInternalAPI,
evTime time.Time,
) error {
builder := &gomatrixserverlib.EventBuilder{
@@ -359,8 +358,8 @@ func emit3PIDInviteEvent(
return err
}
- _, err = producer.SendEvents(
- ctx,
+ _, err = api.SendEvents(
+ ctx, rsAPI,
[]gomatrixserverlib.HeaderedEvent{
(*event).Headered(queryRes.RoomVersion),
},