mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
parent
419ff150d4
commit
2b5052eccf
11 changed files with 108 additions and 74 deletions
|
@ -184,11 +184,20 @@ func (rp *RequestPool) appendAccountData(
|
|||
return data, nil
|
||||
}
|
||||
|
||||
r := types.Range{
|
||||
From: req.since.PDUPosition(),
|
||||
To: currentPos,
|
||||
}
|
||||
// If both positions are the same, it means that the data was saved after the
|
||||
// latest room event. In that case, we need to decrement the old position as
|
||||
// results are exclusive of Low.
|
||||
if r.Low() == r.High() {
|
||||
r.From--
|
||||
}
|
||||
|
||||
// Sync is not initial, get all account data since the latest sync
|
||||
dataTypes, err := rp.db.GetAccountDataInRange(
|
||||
req.ctx, userID,
|
||||
types.StreamPosition(req.since.PDUPosition()), types.StreamPosition(currentPos),
|
||||
accountDataFilter,
|
||||
req.ctx, userID, r, accountDataFilter,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue