diff --git a/Telegram/SourceFiles/api/api_chat_invite.cpp b/Telegram/SourceFiles/api/api_chat_invite.cpp index d108a13927..b67e148677 100644 --- a/Telegram/SourceFiles/api/api_chat_invite.cpp +++ b/Telegram/SourceFiles/api/api_chat_invite.cpp @@ -437,6 +437,12 @@ void CheckChatInvite( } }); }, [=](const MTP::Error &error) { + if (MTP::IsFloodError(error)) { + if (const auto strong = weak.get()) { + strong->show(Ui::MakeInformBox(tr::lng_flood_error())); + } + return; + } if (error.code() != 400) { return; } diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 415a17acba..6a89510329 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -324,7 +324,7 @@ void ApiWrap::checkChatInvite( request(base::take(_checkInviteRequestId)).cancel(); _checkInviteRequestId = request(MTPmessages_CheckChatInvite( MTP_string(hash) - )).done(std::move(done)).fail(std::move(fail)).send(); + )).done(std::move(done)).fail(std::move(fail)).handleFloodErrors().send(); } void ApiWrap::checkFilterInvite(