Filter CHANNEL_INVALID errors in update resolution

This commit is contained in:
Ali 2020-12-28 13:10:16 +04:00
parent 3988fcec6d
commit 4c8c710391

View File

@ -1882,9 +1882,10 @@ private func pollChannel(network: Network, peer: Peer, state: AccountMutableStat
return (network.request(Api.functions.updates.getChannelDifference(flags: 0, channel: inputChannel, filter: .channelMessagesFilterEmpty, pts: pollPts, limit: limit)) return (network.request(Api.functions.updates.getChannelDifference(flags: 0, channel: inputChannel, filter: .channelMessagesFilterEmpty, pts: pollPts, limit: limit))
|> map(Optional.init) |> map(Optional.init)
|> `catch` { error -> Signal<Api.updates.ChannelDifference?, MTRpcError> in |> `catch` { error -> Signal<Api.updates.ChannelDifference?, MTRpcError> in
if error.errorDescription == "CHANNEL_PRIVATE" { switch error.errorDescription {
case "CHANNEL_PRIVATE", "CHANNEL_INVALID":
return .single(nil) return .single(nil)
} else { default:
return .fail(error) return .fail(error)
} }
}) })