diff --git a/README.adoc b/README.adoc index f14c32f..b444f12 100644 --- a/README.adoc +++ b/README.adoc @@ -28,11 +28,11 @@ git submodule update ==== Installiere abhängigkeiten * C++ compiler -* https://cmake.org/[cmake] (mindestens 3.2) +* https://cmake.org/[cmake] (mindestens: 3.2) * http://repo.or.cz/w/libxdg-basedir.git[libxdg-basedir] (getested: 1.2) * http://www.curlpp.org/[curlpp] (getested: 0.8) * https://github.com/open-source-parsers/jsoncpp[jsoncpp] (getested: 1.8) -* https://schlomp.space/tastytea/mastodon-cpp[mastodon-cpp] (mindestens 0.30.1) +* https://schlomp.space/tastytea/mastodon-cpp[mastodon-cpp] (mindestens: 0.105.0) ==== Kompilieren diff --git a/feiertagebot.cpp b/feiertagebot.cpp index 8d73f12..57eaf02 100644 --- a/feiertagebot.cpp +++ b/feiertagebot.cpp @@ -15,7 +15,8 @@ #include #include #include -#include +#include +#include #include "xdgjson/src/xdgjson.hpp" namespace curlopts = curlpp::options; @@ -82,7 +83,7 @@ const string get_date(const system_clock::time_point &timepoint, const string get_token(const string &instance) { Mastodon::API masto(instance, ""); - uint_fast16_t ret = 0; + Mastodon::return_call ret; string client_id, client_secret, url; string code, access_token; ret = masto.register_app1("feiertagebot", @@ -92,9 +93,9 @@ const string get_token(const string &instance) client_id, client_secret, url); - if (ret > 0) + if (!ret) { - cerr << "Error " << std::to_string(ret) << endl; + cerr << "Error " << std::to_string(ret.error_code) << endl; return ""; } @@ -106,9 +107,9 @@ const string get_token(const string &instance) "urn:ietf:wg:oauth:2.0:oob", code, access_token); - if (ret > 0) + if (!ret) { - cerr << "Error " << std::to_string(ret) << endl; + cerr << "Error " << std::to_string(ret.error_code) << endl; return ""; } @@ -212,16 +213,16 @@ int main() if (!output.empty()) { - uint_fast16_t ret; - Mastodon::Easy masto(instance, access_token); + Mastodon::Easy::return_entity ret; + Mastodon::Easy::API masto(instance, access_token); masto.exceptions(true); Mastodon::Easy::Status status; status.content(output + "\n#bot"); - masto.send_post(status, ret); - if (ret > 0) + ret = masto.send_post(status); + if (!ret) { - cerr << "Error " << std::to_string(ret) << endl; - return ret; + cerr << "Error " << std::to_string(ret.error_code) << endl; + return ret.error_code; } } }