From 82c82a3412ec4a8bd400f095280c922c48e47abb Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 12 Sep 2017 16:54:37 +0100 Subject: [PATCH] Explain when we should use SendEvents instead of SendInvite. Because it's easy to get confused between the two methods. --- .../matrix-org/dendrite/clientapi/producers/roomserver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go b/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go index cd146b856..962a1cf6b 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go +++ b/src/github.com/matrix-org/dendrite/clientapi/producers/roomserver.go @@ -86,6 +86,8 @@ func (c *RoomserverProducer) SendInputRoomEvents(ires []api.InputRoomEvent) erro } // SendInvite writes the invite event to the roomserver input API. +// 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(inviteEvent gomatrixserverlib.Event) error { request := api.InputRoomEventsRequest{ InputInviteEvents: []api.InputInviteEvent{{Event: inviteEvent}},