mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-02-25 05:53:09 -06:00
Use StreamPosition in EventsInRange
This commit is contained in:
parent
c4352fa70f
commit
6b036d5cb7
|
|
@ -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.
|
// EventsInRange returns all events in the given range, exclusive of oldPos, inclusive of newPos.
|
||||||
func (d *SyncServerDatabase) EventsInRange(oldPos, newPos int64) ([]gomatrixserverlib.Event, error) {
|
func (d *SyncServerDatabase) EventsInRange(oldPos, newPos syncapi.StreamPosition) ([]gomatrixserverlib.Event, error) {
|
||||||
return d.events.InRange(oldPos, newPos)
|
return d.events.InRange(int64(oldPos), int64(newPos))
|
||||||
}
|
}
|
||||||
|
|
||||||
func runTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {
|
func runTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {
|
||||||
|
|
|
||||||
|
|
@ -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?
|
// 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)
|
// 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue