diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-11-16 15:44:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 15:44:53 +0000 |
commit | 20a01bceb2869c810932eac217d96dc221953685 (patch) | |
tree | 639cd8656282ae231a46531f063d7d010320a582 /internal | |
parent | d8b526b603683879c012972707cdce44fff3c802 (diff) |
Pass pointers to events — reloaded (#1583)
* Pass events as pointers
* Fix lint errors
* Update gomatrixserverlib
* Update gomatrixserverlib
* Update to matrix-org/gomatrixserverlib#240
Diffstat (limited to 'internal')
-rw-r--r-- | internal/eventutil/events.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/eventutil/events.go b/internal/eventutil/events.go index 0b878961..a650b4b3 100644 --- a/internal/eventutil/events.go +++ b/internal/eventutil/events.go @@ -73,8 +73,7 @@ func BuildEvent( return nil, err } - h := event.Headered(queryRes.RoomVersion) - return &h, nil + return event.Headered(queryRes.RoomVersion), nil } // queryRequiredEventsForBuilder queries the roomserver for auth/prev events needed for this builder. @@ -120,7 +119,7 @@ func addPrevEventsToEvent( authEvents := gomatrixserverlib.NewAuthEvents(nil) for i := range queryRes.StateEvents { - err = authEvents.AddEvent(&queryRes.StateEvents[i].Event) + err = authEvents.AddEvent(queryRes.StateEvents[i].Event) if err != nil { return fmt.Errorf("authEvents.AddEvent: %w", err) } @@ -186,5 +185,5 @@ func RedactEvent(redactionEvent, redactedEvent *gomatrixserverlib.Event) (*gomat if err != nil { return nil, err } - return &r, nil + return r, nil } |