1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-23 01:06:17 +00:00

Replace FLOOD_WAIT check with the version used in download messages

This commit is contained in:
Leijurv 2018-02-14 10:32:54 -08:00 committed by GitHub
parent 004b650762
commit 3911af1f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,7 +316,7 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI
try { try {
_downloadMedia() _downloadMedia()
} catch (e: RpcErrorException) { } catch (e: RpcErrorException) {
if (e.getTag().startsWith("420: FLOOD_WAIT_")) { if (e.getCode() == 420) { // FLOOD_WAIT
completed = false completed = false
Utils.obeyFloodWaitException(e) Utils.obeyFloodWaitException(e)
} else { } else {
@ -428,7 +428,7 @@ class DownloadManager(internal var client: TelegramClient?, p: DownloadProgressI
try { try {
response = download_client!!.executeRpcQuery(req, dcID) as TLFile response = download_client!!.executeRpcQuery(req, dcID) as TLFile
} catch (e: RpcErrorException) { } catch (e: RpcErrorException) {
if (e.getTag().startsWith("420: FLOOD_WAIT_")) { if (e.getCode() == 420) { // FLOOD_WAIT
try_again = true try_again = true
Utils.obeyFloodWaitException(e) Utils.obeyFloodWaitException(e)
} else if (e.getCode() == 400) { } else if (e.getCode() == 400) {