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 /syncapi/storage/sqlite3/invites_table.go | |
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 'syncapi/storage/sqlite3/invites_table.go')
-rw-r--r-- | syncapi/storage/sqlite3/invites_table.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/syncapi/storage/sqlite3/invites_table.go b/syncapi/storage/sqlite3/invites_table.go index 1a36ad40..f9dcfdbc 100644 --- a/syncapi/storage/sqlite3/invites_table.go +++ b/syncapi/storage/sqlite3/invites_table.go @@ -91,7 +91,7 @@ func NewSqliteInvitesTable(db *sql.DB, streamID *streamIDStatements) (tables.Inv } func (s *inviteEventsStatements) InsertInviteEvent( - ctx context.Context, txn *sql.Tx, inviteEvent gomatrixserverlib.HeaderedEvent, + ctx context.Context, txn *sql.Tx, inviteEvent *gomatrixserverlib.HeaderedEvent, ) (streamPos types.StreamPosition, err error) { streamPos, err = s.streamIDStatements.nextStreamID(ctx, txn) if err != nil { @@ -132,15 +132,15 @@ func (s *inviteEventsStatements) DeleteInviteEvent( // active invites for the target user ID in the supplied range. func (s *inviteEventsStatements) SelectInviteEventsInRange( ctx context.Context, txn *sql.Tx, targetUserID string, r types.Range, -) (map[string]gomatrixserverlib.HeaderedEvent, map[string]gomatrixserverlib.HeaderedEvent, error) { +) (map[string]*gomatrixserverlib.HeaderedEvent, map[string]*gomatrixserverlib.HeaderedEvent, error) { stmt := sqlutil.TxStmt(txn, s.selectInviteEventsInRangeStmt) rows, err := stmt.QueryContext(ctx, targetUserID, r.Low(), r.High()) if err != nil { return nil, nil, err } defer internal.CloseAndLogIfError(ctx, rows, "selectInviteEventsInRange: rows.close() failed") - result := map[string]gomatrixserverlib.HeaderedEvent{} - retired := map[string]gomatrixserverlib.HeaderedEvent{} + result := map[string]*gomatrixserverlib.HeaderedEvent{} + retired := map[string]*gomatrixserverlib.HeaderedEvent{} for rows.Next() { var ( roomID string @@ -159,7 +159,7 @@ func (s *inviteEventsStatements) SelectInviteEventsInRange( continue } - var event gomatrixserverlib.HeaderedEvent + var event *gomatrixserverlib.HeaderedEvent if err := json.Unmarshal(eventJSON, &event); err != nil { return nil, nil, err } |