aboutsummaryrefslogtreecommitdiff
path: root/internal/eventutil
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-21 17:06:29 +0100
committerGitHub <noreply@github.com>2023-04-21 17:06:29 +0100
commit1647213facae52e2c8889fbc848ffc5d3a5792f0 (patch)
tree684206b99582df20ae144e19db37591cc35b789d /internal/eventutil
parent71eeccf34a2ea4434c315c19778d80a7b2469270 (diff)
Implement new RoomVersionImpl API (#3062)
As outlined in https://github.com/matrix-org/gomatrixserverlib/pull/368 The main change Dendrite side is that `RoomVersion` no longer has any methods on it. Instead, you need to bounce via `gmsl.GetRoomVersion`. It's very interesting to see where exactly Dendrite cares about this. For some places it's creating events (fine) but others are way more specific. Those areas will need to migrate to GMSL at some point.
Diffstat (limited to 'internal/eventutil')
-rw-r--r--internal/eventutil/events.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/eventutil/events.go b/internal/eventutil/events.go
index c7dee346..283c91d8 100644
--- a/internal/eventutil/events.go
+++ b/internal/eventutil/events.go
@@ -112,10 +112,11 @@ func addPrevEventsToEvent(
return ErrRoomNoExists
}
- eventFormat, err := queryRes.RoomVersion.EventFormat()
+ verImpl, err := gomatrixserverlib.GetRoomVersion(queryRes.RoomVersion)
if err != nil {
- return fmt.Errorf("queryRes.RoomVersion.EventFormat: %w", err)
+ return fmt.Errorf("GetRoomVersion: %w", err)
}
+ eventFormat := verImpl.EventFormat()
builder.Depth = queryRes.Depth