diff options
Diffstat (limited to 'clientapi/routing/createroom.go')
-rw-r--r-- | clientapi/routing/createroom.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clientapi/routing/createroom.go b/clientapi/routing/createroom.go index 043e60ee..3962dccc 100644 --- a/clientapi/routing/createroom.go +++ b/clientapi/routing/createroom.go @@ -24,6 +24,7 @@ import ( appserviceAPI "github.com/matrix-org/dendrite/appservice/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/roomserver/types" roomserverVersion "github.com/matrix-org/dendrite/roomserver/version" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib/fclient" @@ -431,7 +432,7 @@ func createRoom( // TODO: invite events // TODO: 3pid invite events - var builtEvents []*gomatrixserverlib.HeaderedEvent + var builtEvents []*types.HeaderedEvent authEvents := gomatrixserverlib.NewAuthEvents(nil) for i, e := range eventsToMake { depth := i + 1 // depth starts at 1 @@ -464,7 +465,7 @@ func createRoom( } // Add the event to the list of auth events - builtEvents = append(builtEvents, ev.Headered(roomVersion)) + builtEvents = append(builtEvents, &types.HeaderedEvent{Event: ev}) err = authEvents.AddEvent(ev) if err != nil { util.GetLogger(ctx).WithError(err).Error("authEvents.AddEvent failed") @@ -559,11 +560,11 @@ func createRoom( ) // Send the invite event to the roomserver. var inviteRes roomserverAPI.PerformInviteResponse - event := inviteEvent.Headered(roomVersion) + event := inviteEvent if err := rsAPI.PerformInvite(ctx, &roomserverAPI.PerformInviteRequest{ Event: event, InviteRoomState: inviteStrippedState, - RoomVersion: event.RoomVersion, + RoomVersion: event.Version(), SendAsServer: string(userDomain), }, &inviteRes); err != nil { util.GetLogger(ctx).WithError(err).Error("PerformInvite failed") |