Use StreamPosition in EventsInRange

This commit is contained in:
Kegan Dougal 2017-04-11 09:44:49 +01:00
parent c4352fa70f
commit 6b036d5cb7
2 changed files with 3 additions and 3 deletions

View file

@ -97,8 +97,8 @@ func (d *SyncServerDatabase) SyncStreamPosition() (syncapi.StreamPosition, error
}
// EventsInRange returns all events in the given range, exclusive of oldPos, inclusive of newPos.
func (d *SyncServerDatabase) EventsInRange(oldPos, newPos int64) ([]gomatrixserverlib.Event, error) {
return d.events.InRange(oldPos, newPos)
func (d *SyncServerDatabase) EventsInRange(oldPos, newPos syncapi.StreamPosition) ([]gomatrixserverlib.Event, error) {
return d.events.InRange(int64(oldPos), int64(newPos))
}
func runTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {

View file

@ -153,7 +153,7 @@ func (rp *RequestPool) currentSyncForUser(req syncRequest) (*syncapi.Response, e
// c) Check if the user is CURRENTLY left/banned. If so, add room to 'archived' block. // Synapse has a TODO: How do we handle ban -> leave in same batch?
// 4) Add joined rooms (joined room list)
events, err := rp.db.EventsInRange(int64(req.since), int64(currentPos))
events, err := rp.db.EventsInRange(req.since, currentPos)
if err != nil {
return nil, err
}