1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-12-26 06:45:33 +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 {
_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) {