From bce5996643d8b2ae9c1043d24da6cbb644f29336 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 20 Apr 2018 06:53:25 +0200 Subject: [PATCH] Show (temporary) messages every time a FLOOD_WAIT is happening. --- .../kotlin/de/fabianonline/telegram_backup/Utils.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/de/fabianonline/telegram_backup/Utils.kt b/src/main/kotlin/de/fabianonline/telegram_backup/Utils.kt index 878d07d..547b8f1 100644 --- a/src/main/kotlin/de/fabianonline/telegram_backup/Utils.kt +++ b/src/main/kotlin/de/fabianonline/telegram_backup/Utils.kt @@ -133,10 +133,18 @@ object Utils { "messages and media. But be advised that just restarting me is not going to change\n" + "the fact that Telegram won't talk to me until then." + "\n") + } else { + print(" Waiting...") } - hasSeenFloodWaitMessage = true try { TimeUnit.SECONDS.sleep(delay + 1) } catch (e: InterruptedException) { } + + if (hasSeenFloodWaitMessage) { + // " W a i t i n g . . ." + print("\b\b\b\b\b\b\b\b\b\b\b") + } + + hasSeenFloodWaitMessage = true } catch (e: TimeoutException) { println( "\n" +