aboutsummaryrefslogtreecommitdiff
path: root/appservice
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-04 18:16:53 +0100
committerGitHub <noreply@github.com>2023-04-04 17:16:53 +0000
commit3691423626c94418388c48c1a91ac69dcd8b196b (patch)
treeab93bff2fe0ad7ba8c0417c55832abc57e14b167 /appservice
parent985298cfc46cb6b33ab44d32a63a933d03e16429 (diff)
Move GMSL client types to Dendrite (#3045)
GMSL is intended for Federation only. Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/357
Diffstat (limited to 'appservice')
-rw-r--r--appservice/appservice_test.go3
-rw-r--r--appservice/consumers/roomserver.go11
2 files changed, 11 insertions, 3 deletions
diff --git a/appservice/appservice_test.go b/appservice/appservice_test.go
index 5189bdf9..282c6312 100644
--- a/appservice/appservice_test.go
+++ b/appservice/appservice_test.go
@@ -18,6 +18,7 @@ import (
"github.com/matrix-org/dendrite/appservice"
"github.com/matrix-org/dendrite/appservice/api"
+ "github.com/matrix-org/dendrite/appservice/consumers"
"github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/roomserver"
@@ -338,7 +339,7 @@ func TestRoomserverConsumerOneInvite(t *testing.T) {
evChan := make(chan struct{})
// create a dummy AS url, handling the events
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- var txn gomatrixserverlib.ApplicationServiceTransaction
+ var txn consumers.ApplicationServiceTransaction
err := json.NewDecoder(r.Body).Decode(&txn)
if err != nil {
t.Fatal(err)
diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go
index 308b0367..586ca33a 100644
--- a/appservice/consumers/roomserver.go
+++ b/appservice/consumers/roomserver.go
@@ -32,10 +32,17 @@ import (
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/setup/jetstream"
"github.com/matrix-org/dendrite/setup/process"
+ "github.com/matrix-org/dendrite/syncapi/synctypes"
log "github.com/sirupsen/logrus"
)
+// ApplicationServiceTransaction is the transaction that is sent off to an
+// application service.
+type ApplicationServiceTransaction struct {
+ Events []synctypes.ClientEvent `json:"events"`
+}
+
// OutputRoomEventConsumer consumes events that originated in the room server.
type OutputRoomEventConsumer struct {
ctx context.Context
@@ -171,8 +178,8 @@ func (s *OutputRoomEventConsumer) sendEvents(
) error {
// Create the transaction body.
transaction, err := json.Marshal(
- gomatrixserverlib.ApplicationServiceTransaction{
- Events: gomatrixserverlib.HeaderedToClientEvents(events, gomatrixserverlib.FormatAll),
+ ApplicationServiceTransaction{
+ Events: synctypes.HeaderedToClientEvents(events, synctypes.FormatAll),
},
)
if err != nil {