Added support for /api/v1/suggestions,
and /api/v1/suggestions/:account_id.
This commit is contained in:
parent
8094603c0f
commit
14d0263606
|
@ -280,8 +280,8 @@ Run `make package` from the build directory to generate a tar.gz archive.
|
||||||
* [x] GET /api/v1/follow_requests
|
* [x] GET /api/v1/follow_requests
|
||||||
* [x] POST /api/v1/follow_requests/:id/authorize
|
* [x] POST /api/v1/follow_requests/:id/authorize
|
||||||
* [x] POST /api/v1/follow_requests/:id/reject
|
* [x] POST /api/v1/follow_requests/:id/reject
|
||||||
* [ ] GET /api/v1/suggestions
|
* [x] GET /api/v1/suggestions
|
||||||
* [ ] DELETE /api/v1/suggestions/:account_id
|
* [x] DELETE /api/v1/suggestions/:account_id
|
||||||
* [x] GET /api/v1/instance
|
* [x] GET /api/v1/instance
|
||||||
* [x] GET /api/v1/lists
|
* [x] GET /api/v1/lists
|
||||||
* [x] GET /api/v1/accounts/:id/lists
|
* [x] GET /api/v1/accounts/:id/lists
|
||||||
|
|
|
@ -27,10 +27,15 @@ return_call API::del(const Mastodon::API::v1 &call,
|
||||||
string strid = "";
|
string strid = "";
|
||||||
|
|
||||||
// The ID is part of the path
|
// The ID is part of the path
|
||||||
auto &it = params.find("id");
|
const parameters::const_iterator &it_id = params.find("id");
|
||||||
if (it != params.end())
|
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)
|
switch (call)
|
||||||
|
@ -65,6 +70,11 @@ return_call API::del(const Mastodon::API::v1 &call,
|
||||||
strcall = "/api/v1/filters/" + strid;
|
strcall = "/api/v1/filters/" + strid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case v1::suggestions_accountid:
|
||||||
|
{
|
||||||
|
strcall = "/api/v1/suggestions/" + strid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ttdebug << "ERROR: Invalid argument.\n";
|
ttdebug << "ERROR: Invalid argument.\n";
|
||||||
|
|
|
@ -231,6 +231,11 @@ const return_call API::get(const Mastodon::API::v1 &call,
|
||||||
strcall = "/api/v1/filters/" + strid;
|
strcall = "/api/v1/filters/" + strid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case v1::suggestions:
|
||||||
|
{
|
||||||
|
strcall = "/api/v1/suggestions";
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ttdebug << "ERROR: Invalid argument.\n";
|
ttdebug << "ERROR: Invalid argument.\n";
|
||||||
|
|
|
@ -216,8 +216,8 @@ namespace Mastodon
|
||||||
follow_requests_id_authorize,
|
follow_requests_id_authorize,
|
||||||
follow_requests_id_reject,
|
follow_requests_id_reject,
|
||||||
|
|
||||||
// suggestions,
|
suggestions,
|
||||||
// suggestions_id,
|
suggestions_accountid,
|
||||||
|
|
||||||
instance,
|
instance,
|
||||||
|
|
||||||
|
|
Reference in New Issue