mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Filter CHANNEL_INVALID errors in update resolution
This commit is contained in:
parent
3988fcec6d
commit
4c8c710391
@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user