aboutsummaryrefslogtreecommitdiff
path: root/syncapi/routing/relations.go
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 /syncapi/routing/relations.go
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 'syncapi/routing/relations.go')
-rw-r--r--syncapi/routing/relations.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/syncapi/routing/relations.go b/syncapi/routing/relations.go
index fee61b0d..79533883 100644
--- a/syncapi/routing/relations.go
+++ b/syncapi/routing/relations.go
@@ -27,14 +27,15 @@ import (
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/syncapi/internal"
"github.com/matrix-org/dendrite/syncapi/storage"
+ "github.com/matrix-org/dendrite/syncapi/synctypes"
"github.com/matrix-org/dendrite/syncapi/types"
userapi "github.com/matrix-org/dendrite/userapi/api"
)
type RelationsResponse struct {
- Chunk []gomatrixserverlib.ClientEvent `json:"chunk"`
- NextBatch string `json:"next_batch,omitempty"`
- PrevBatch string `json:"prev_batch,omitempty"`
+ Chunk []synctypes.ClientEvent `json:"chunk"`
+ NextBatch string `json:"next_batch,omitempty"`
+ PrevBatch string `json:"prev_batch,omitempty"`
}
// nolint:gocyclo
@@ -85,7 +86,7 @@ func Relations(
defer sqlutil.EndTransactionWithCheck(snapshot, &succeeded, &err)
res := &RelationsResponse{
- Chunk: []gomatrixserverlib.ClientEvent{},
+ Chunk: []synctypes.ClientEvent{},
}
var events []types.StreamEvent
events, res.PrevBatch, res.NextBatch, err = snapshot.RelationsFor(
@@ -108,11 +109,11 @@ func Relations(
// Convert the events into client events, and optionally filter based on the event
// type if it was specified.
- res.Chunk = make([]gomatrixserverlib.ClientEvent, 0, len(filteredEvents))
+ res.Chunk = make([]synctypes.ClientEvent, 0, len(filteredEvents))
for _, event := range filteredEvents {
res.Chunk = append(
res.Chunk,
- gomatrixserverlib.ToClientEvent(event.Event, gomatrixserverlib.FormatAll),
+ synctypes.ToClientEvent(event.Event, synctypes.FormatAll),
)
}