aboutsummaryrefslogtreecommitdiff
path: root/internal/transactionrequest.go
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/transactionrequest.go
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/transactionrequest.go')
-rw-r--r--internal/transactionrequest.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/transactionrequest.go b/internal/transactionrequest.go
index a7c192e3..bb16cefe 100644
--- a/internal/transactionrequest.go
+++ b/internal/transactionrequest.go
@@ -137,7 +137,11 @@ func (t *TxnReq) ProcessTransaction(ctx context.Context) (*fclient.RespSend, *ut
continue
}
roomVersion := getRoomVersion(header.RoomID)
- event, err := roomVersion.NewEventFromUntrustedJSON(pdu)
+ verImpl, err := gomatrixserverlib.GetRoomVersion(roomVersion)
+ if err != nil {
+ continue
+ }
+ event, err := verImpl.NewEventFromUntrustedJSON(pdu)
if err != nil {
if _, ok := err.(gomatrixserverlib.BadJSONError); ok {
// Room version 6 states that homeservers should strictly enforce canonical JSON