diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ff2479..b45420e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastobotmon - VERSION 0.3.2 + VERSION 0.3.3 LANGUAGES CXX) include(GNUInstallDirs) diff --git a/src/mastobotmon.cpp b/src/mastobotmon.cpp index fb3c5e3..49c7e9d 100644 --- a/src/mastobotmon.cpp +++ b/src/mastobotmon.cpp @@ -132,14 +132,14 @@ int main(int argc, char *argv[]) { std::string answer; uint16_t ret = acc.get(Mastodon::API::v1::accounts_verify_credentials, answer); - if (std::stoi(acc.get_header("X-RateLimit-Remaining")) < 2) - { - cerr << "ERROR: Reached limit of API calls.\n"; - cerr << "Counter will reset at " << acc.get_header("X-RateLimit-Reset") << '\n'; - return 2; - } if (ret == 0) { + if (std::stoi(acc.get_header("X-RateLimit-Remaining")) < 2) + { + cerr << "ERROR: Reached limit of API calls.\n"; + cerr << "Counter will reset at " << acc.get_header("X-RateLimit-Reset") << '\n'; + return 2; + } Json::Value json; Json::Reader reader; reader.parse(answer, json);