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
1 changed files with 2 additions and 2 deletions

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) {