From 3d614f6ac27042a25fcf235136d060dfc12c1d2c Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 12 Nov 2019 23:05:38 +0300 Subject: [PATCH] Add support for SLOWMODE_WAIT_* errors. GitOrigin-RevId: eb54e53668ad24640c1d13b608584eeb675c11d6 --- td/telegram/net/NetQueryDelayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/td/telegram/net/NetQueryDelayer.cpp b/td/telegram/net/NetQueryDelayer.cpp index 452cb483..1f72d1b6 100644 --- a/td/telegram/net/NetQueryDelayer.cpp +++ b/td/telegram/net/NetQueryDelayer.cpp @@ -33,7 +33,8 @@ void NetQueryDelayer::delay(NetQueryPtr query) { } } else if (code == 420) { auto msg = query->error().message(); - for (auto prefix : {Slice("FLOOD_WAIT_"), Slice("2FA_CONFIRM_WAIT_"), Slice("TAKEOUT_INIT_DELAY_")}) { + for (auto prefix : + {Slice("FLOOD_WAIT_"), Slice("SLOWMODE_WAIT_"), Slice("2FA_CONFIRM_WAIT_"), Slice("TAKEOUT_INIT_DELAY_")}) { if (begins_with(msg, prefix)) { timeout = clamp(to_integer(msg.substr(prefix.size())), 0, 14 * 24 * 60 * 60); break;