Files
mautrix-telegram/pkg/gotd/telegram/updates/gap_check.go
T
2025-06-27 20:03:37 -07:00

28 lines
414 B
Go

package updates
type gapCheckResult byte
const (
_ gapCheckResult = iota
gapApply
gapIgnore
gapRefetch
)
func checkGap(localState, remoteState, count int) gapCheckResult {
// Temporary fix for handling qts updates gaps.
if remoteState == 0 {
return gapApply
}
if localState+count == remoteState {
return gapApply
}
if localState+count > remoteState {
return gapIgnore
}
return gapRefetch
}