Add artificial delay if spam is detected or the captcha is wrong.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2021-01-18 08:32:54 +01:00
parent 7e6e47b191
commit 9b06a48f64
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 4 additions and 0 deletions

View File

@ -28,11 +28,13 @@
#include <cstdlib> #include <cstdlib>
#include <exception> #include <exception>
#include <iostream> #include <iostream>
#include <thread>
using std::cerr; using std::cerr;
using std::cout; using std::cout;
using std::exception; using std::exception;
using std::getenv; using std::getenv;
using namespace std::chrono_literals;
using namespace FediBlock; using namespace FediBlock;
@ -82,11 +84,13 @@ int main()
catch (const SpamException &e) catch (const SpamException &e)
{ {
cerr << e.what() << '\n'; cerr << e.what() << '\n';
std::this_thread::sleep_for(10s);
cout << e.what() << "\r\n"; cout << e.what() << "\r\n";
} }
catch (const CaptchaException &e) catch (const CaptchaException &e)
{ {
cerr << e.what() << '\n'; cerr << e.what() << '\n';
std::this_thread::sleep_for(5s);
cout << e.what() << "\r\n" cout << e.what() << "\r\n"
<< "Use the back button of your browser to try again.\r\n"; << "Use the back button of your browser to try again.\r\n";
} }