aboutsummaryrefslogtreecommitdiff
path: root/internal/eventutil
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-11-16 15:44:53 +0000
committerGitHub <noreply@github.com>2020-11-16 15:44:53 +0000
commit20a01bceb2869c810932eac217d96dc221953685 (patch)
tree639cd8656282ae231a46531f063d7d010320a582 /internal/eventutil
parentd8b526b603683879c012972707cdce44fff3c802 (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/eventutil')
-rw-r--r--internal/eventutil/events.go7
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
}