Holes: fix aroundId fill when requested id is not found

This commit is contained in:
Peter 2019-04-15 19:58:26 +01:00
parent f765c27531
commit 1b3b5aad52

View File

@ -307,8 +307,8 @@ func fetchMessageHistoryHole(accountPeerId: PeerId, source: FetchMessageHistoryH
let ids = messages.map({ $0.id!.id })
let messageRange = ids.min()! ... ids.max()!
switch direction {
case .aroundId:
filledRange = messageRange
case let .aroundId(aroundId):
filledRange = min(aroundId.id, messageRange.lowerBound) ... max(aroundId.id, messageRange.lowerBound)
case let .range(start, end):
if start.id <= end.id {
let minBound = start.id