mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-23 23:03:10 -06:00
Only apply receipts on initial sync or if edu positions differ,
otherwise we'll be sending the same receipts over and over again.
This commit is contained in:
parent
3a5c8256df
commit
02a11d5a8f
|
|
@ -633,9 +633,12 @@ func (d *Database) addEDUDeltaToResponse(
|
|||
}
|
||||
}
|
||||
|
||||
// always check for receipt deltas; otherwise an initial sync won't receive receipts
|
||||
if err := d.addReceiptDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil {
|
||||
return errors.Wrap(err, "unable to apply receipts to response")
|
||||
// Check on initial sync and if EDUPositions differ
|
||||
if (fromPos.EDUPosition() == 0 && toPos.EDUPosition() == 0) ||
|
||||
fromPos.EDUPosition() != toPos.EDUPosition() {
|
||||
if err := d.addReceiptDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil {
|
||||
return errors.Wrap(err, "unable to apply receipts to response")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue