diff options
author | Kegsay <kegan@matrix.org> | 2020-05-15 09:41:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 09:41:12 +0100 |
commit | 2b5052eccfca49e736b39a9879ebde2ab196f6da (patch) | |
tree | ebd43e4ea84cf403a0c1530833a2751faa2d255d /syncapi/storage/postgres/invites_table.go | |
parent | 419ff150d41a3d0de25f0e8e66baf36948bcfbc1 (diff) |
Add Range (#1037)
* Add Range
* Use Range
Diffstat (limited to 'syncapi/storage/postgres/invites_table.go')
-rw-r--r-- | syncapi/storage/postgres/invites_table.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/syncapi/storage/postgres/invites_table.go b/syncapi/storage/postgres/invites_table.go index 78ca4d6d..01f2e7f4 100644 --- a/syncapi/storage/postgres/invites_table.go +++ b/syncapi/storage/postgres/invites_table.go @@ -117,10 +117,10 @@ func (s *inviteEventsStatements) DeleteInviteEvent( // selectInviteEventsInRange returns a map of room ID to invite event for the // active invites for the target user ID in the supplied range. func (s *inviteEventsStatements) SelectInviteEventsInRange( - ctx context.Context, txn *sql.Tx, targetUserID string, startPos, endPos types.StreamPosition, + ctx context.Context, txn *sql.Tx, targetUserID string, r types.Range, ) (map[string]gomatrixserverlib.HeaderedEvent, error) { stmt := common.TxStmt(txn, s.selectInviteEventsInRangeStmt) - rows, err := stmt.QueryContext(ctx, targetUserID, startPos, endPos) + rows, err := stmt.QueryContext(ctx, targetUserID, r.Low(), r.High()) if err != nil { return nil, err } |