diff --git a/README.md b/README.md index 3886d7d..4a8e556 100644 --- a/README.md +++ b/README.md @@ -280,8 +280,8 @@ Run `make package` from the build directory to generate a tar.gz archive. * [x] GET /api/v1/follow_requests * [x] POST /api/v1/follow_requests/:id/authorize * [x] POST /api/v1/follow_requests/:id/reject - * [ ] GET /api/v1/suggestions - * [ ] DELETE /api/v1/suggestions/:account_id + * [x] GET /api/v1/suggestions + * [x] DELETE /api/v1/suggestions/:account_id * [x] GET /api/v1/instance * [x] GET /api/v1/lists * [x] GET /api/v1/accounts/:id/lists diff --git a/src/api/delete.cpp b/src/api/delete.cpp index aa90fce..14ed909 100644 --- a/src/api/delete.cpp +++ b/src/api/delete.cpp @@ -27,10 +27,15 @@ return_call API::del(const Mastodon::API::v1 &call, string strid = ""; // The ID is part of the path - auto &it = params.find("id"); - if (it != params.end()) + const parameters::const_iterator &it_id = params.find("id"); + const parameters::const_iterator &it_aid = params.find("accountid"); + if (it_id != params.end()) { - strid = it->values[0]; + strid = it_id->values[0]; + } + else if (it_aid != params.end()) + { + strid = it_aid->values[0]; } switch (call) @@ -65,6 +70,11 @@ return_call API::del(const Mastodon::API::v1 &call, strcall = "/api/v1/filters/" + strid; break; } + case v1::suggestions_accountid: + { + strcall = "/api/v1/suggestions/" + strid; + break; + } default: { ttdebug << "ERROR: Invalid argument.\n"; diff --git a/src/api/get.cpp b/src/api/get.cpp index 211fc07..61598dc 100644 --- a/src/api/get.cpp +++ b/src/api/get.cpp @@ -231,6 +231,11 @@ const return_call API::get(const Mastodon::API::v1 &call, strcall = "/api/v1/filters/" + strid; break; } + case v1::suggestions: + { + strcall = "/api/v1/suggestions"; + break; + } default: { ttdebug << "ERROR: Invalid argument.\n"; diff --git a/src/mastodon-cpp.hpp b/src/mastodon-cpp.hpp index bf1576b..f830610 100644 --- a/src/mastodon-cpp.hpp +++ b/src/mastodon-cpp.hpp @@ -216,8 +216,8 @@ namespace Mastodon follow_requests_id_authorize, follow_requests_id_reject, - // suggestions, - // suggestions_id, + suggestions, + suggestions_accountid, instance,