From 4c8c710391914ad51ce2ae7ffd7fbc00f668557a Mon Sep 17 00:00:00 2001 From: Ali <> Date: Mon, 28 Dec 2020 13:10:16 +0400 Subject: [PATCH] Filter CHANNEL_INVALID errors in update resolution --- .../TelegramCore/Sources/AccountStateManagementUtils.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramCore/Sources/AccountStateManagementUtils.swift b/submodules/TelegramCore/Sources/AccountStateManagementUtils.swift index 1f2e6e89d2..030589a6b9 100644 --- a/submodules/TelegramCore/Sources/AccountStateManagementUtils.swift +++ b/submodules/TelegramCore/Sources/AccountStateManagementUtils.swift @@ -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)) |> map(Optional.init) |> `catch` { error -> Signal in - if error.errorDescription == "CHANNEL_PRIVATE" { + switch error.errorDescription { + case "CHANNEL_PRIVATE", "CHANNEL_INVALID": return .single(nil) - } else { + default: return .fail(error) } })