From 3911af1f88026e80c47a41e64c651bcdad2c038b Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 14 Feb 2018 10:32:54 -0800 Subject: [PATCH] Replace FLOOD_WAIT check with the version used in download messages --- .../kotlin/de/fabianonline/telegram_backup/DownloadManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/de/fabianonline/telegram_backup/DownloadManager.kt b/src/main/kotlin/de/fabianonline/telegram_backup/DownloadManager.kt index ca60e7e..c338145 100644 --- a/src/main/kotlin/de/fabianonline/telegram_backup/DownloadManager.kt +++ b/src/main/kotlin/de/fabianonline/telegram_backup/DownloadManager.kt @@ -316,7 +316,7 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI try { _downloadMedia() } catch (e: RpcErrorException) { - if (e.getTag().startsWith("420: FLOOD_WAIT_")) { + if (e.getCode() == 420) { // FLOOD_WAIT completed = false Utils.obeyFloodWaitException(e) } else { @@ -428,7 +428,7 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI try { response = download_client!!.executeRpcQuery(req, dcID) as TLFile } catch (e: RpcErrorException) { - if (e.getTag().startsWith("420: FLOOD_WAIT_")) { + if (e.getCode() == 420) { // FLOOD_WAIT try_again = true Utils.obeyFloodWaitException(e) } else if (e.getCode() == 400) {