Change telegram flood protection

parent d43562c6
......@@ -317,6 +317,14 @@ void TelegramConnection::connect()
);
}
// Avoid flooding by not sending the connection request straight away
if ( connection_status == DISCONNECTED && webhook )
{
connection_status = CONNECTING;
polling_timer.start();
return;
}
connection_status = CONNECTING;
std::function<void (const httpony::json::JsonNode&)> on_success;
......@@ -324,7 +332,6 @@ void TelegramConnection::connect()
if ( webhook )
{
polling_timer.start();
on_success = [this](const httpony::json::JsonNode&){
command(network::Command("getMe"));
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment