diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-04-03 14:29:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 14:29:06 +0100 |
commit | 067b87506357c996fd6ddb11271db9469ad4ce80 (patch) | |
tree | e9127d78567b7676ba5ee607e9381ef4e0358911 /clientapi/producers | |
parent | 955244c09298d0e6c870377dad3af2ffa1f5e578 (diff) |
Invites v2 endpoint (#952)
* Start converting v1 invite endpoint to v2
* Update gomatrixserverlib
* Early federationsender code for sending invites
* Sending invites sorta happens now
* Populate invite request with stripped state
* Remodel a bit, don't reflect received invites
* Handle invite_room_state
* Handle room versions a bit better
* Update gomatrixserverlib
* Tweak order in destinationQueue.next
* Revert check in processMessage
* Tweak federation sender destination queue code a bit
* Add comments
Diffstat (limited to 'clientapi/producers')
-rw-r--r-- | clientapi/producers/roomserver.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clientapi/producers/roomserver.go b/clientapi/producers/roomserver.go index 06af5440..391ea07b 100644 --- a/clientapi/producers/roomserver.go +++ b/clientapi/producers/roomserver.go @@ -104,18 +104,14 @@ func (c *RoomserverProducer) SendInputRoomEvents( // This should only be needed for invite events that occur outside of a known room. // If we are in the room then the event should be sent using the SendEvents method. func (c *RoomserverProducer) SendInvite( - ctx context.Context, inviteEvent gomatrixserverlib.Event, + ctx context.Context, inviteEvent gomatrixserverlib.HeaderedEvent, + inviteRoomState []gomatrixserverlib.InviteV2StrippedState, ) error { - verReq := api.QueryRoomVersionForRoomRequest{RoomID: inviteEvent.RoomID()} - verRes := api.QueryRoomVersionForRoomResponse{} - err := c.QueryAPI.QueryRoomVersionForRoom(ctx, &verReq, &verRes) - if err != nil { - return err - } - request := api.InputRoomEventsRequest{ InputInviteEvents: []api.InputInviteEvent{{ - Event: inviteEvent.Headered(verRes.RoomVersion), + Event: inviteEvent, + InviteRoomState: inviteRoomState, + RoomVersion: inviteEvent.RoomVersion, }}, } var response api.InputRoomEventsResponse |