From d31c83f1d9aad3779559d11971ecdfa2540c1a49 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 3 Mar 2019 10:29:43 +0100 Subject: [PATCH] Did API inventory. Added missing calls to readme, reordered calls, marked deprecated calls. --- README.md | 52 ++++++++++++++-------- src/api/get.cpp | 2 +- src/api/post.cpp | 3 -- src/mastodon-cpp.hpp | 103 +++++++++++++++++++++++++++---------------- 4 files changed, 99 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 307f9ac..946ca4a 100644 --- a/README.md +++ b/README.md @@ -187,9 +187,10 @@ Run `make package` from the build directory to generate a tar.gz archive. # Status of implementation -Feature complete as of Mastodon 2.6.1 +~~Feature complete as of Mastodon 2.6.1~~ * [x] GET /api/v1/accounts/:id + * [ ] POST /api/v1/accounts * [x] GET /api/v1/accounts/verify_credentials * [x] PATCH /api/v1/accounts/update_credentials * [x] GET /api/v1/accounts/:id/followers @@ -197,14 +198,14 @@ Feature complete as of Mastodon 2.6.1 * [x] GET /api/v1/accounts/:id/statuses * [x] POST /api/v1/accounts/:id/follow * [x] POST /api/v1/accounts/:id/unfollow - * [x] POST /api/v1/accounts/:id/block - * [x] POST /api/v1/accounts/:id/unblock - * [x] POST /api/v1/accounts/:id/mute - * [x] POST /api/v1/accounts/:id/unmute * [x] GET /api/v1/accounts/relationships * [x] GET /api/v1/accounts/search * [x] POST /api/v1/apps + * [ ] GET /api/v1/apps/verify_credentials * [x] GET /api/v1/blocks + * [x] POST /api/v1/accounts/:id/block + * [x] POST /api/v1/accounts/:id/unblock + * [x] GET /api/v1/custom_emojis * [x] GET /api/v1/domain_blocks * [x] POST /api/v1/domain_blocks * [x] DELETE /api/v1/domain_blocks @@ -212,12 +213,18 @@ Feature complete as of Mastodon 2.6.1 * [x] POST /api/v1/accounts/:id/pin * [x] POST /api/v1/accounts/:id/unpin * [x] GET /api/v1/favourites + * [x] POST /api/v1/statuses/:id/favourite + * [x] POST /api/v1/statuses/:id/unfavourite + * [ ] GET /api/v1/filters + * [ ] POST /api/v1/filters + * [ ] GET /api/v1/filters/:id + * [ ] DELETE /api/v1/filters/:id * [x] GET /api/v1/follow_requests * [x] POST /api/v1/follow_requests/:id/authorize * [x] POST /api/v1/follow_requests/:id/reject - * [x] POST /api/v1/follows + * [ ] GET /api/v1/suggestions + * [ ] DELETE /api/v1/suggestions/:account_id * [x] GET /api/v1/instance - * [x] GET /api/v1/custom_emojis * [x] GET /api/v1/lists * [x] GET /api/v1/accounts/:id/lists * [x] GET /api/v1/lists/:id/accounts @@ -230,13 +237,26 @@ Feature complete as of Mastodon 2.6.1 * [x] POST /api/v1/media * [x] PUT /api/v1/media/:id * [x] GET /api/v1/mutes + * [x] POST /api/v1/accounts/:id/mute + * [x] POST /api/v1/accounts/:id/unmute + * [x] POST /api/v1/statuses/:id/mute + * [x] POST /api/v1/statuses/:id/unmute * [x] GET /api/v1/notifications * [x] GET /api/v1/notifications/:id * [x] POST /api/v1/notifications/clear * [x] POST /api/v1/notifications/dismiss - * [x] GET /api/v1/reports + * [x] POST /api/v1/push/subscription + * [x] GET /api/v1/push/subscription + * [x] PUT /api/v1/push/subscription + * [x] DELETE /api/v1/push/subscription + * [x] ~~GET /api/v1/reports~~ (Deprecated) * [x] POST /api/v1/reports - * [x] GET /api/v1/search + * [ ] GET /api/v1/scheduled_statuses + * [ ] GET /api/v1/scheduled_statuses/:id + * [ ] PUT /api/v1/scheduled_statuses/:id + * [ ] DELETE /api/v1/scheduled_statuses/:id + * [x] ~~GET /api/v1/search~~ (Deprecated) + * [x] GET /api/v2/search * [x] GET /api/v1/statuses/:id * [x] GET /api/v1/statuses/:id/context * [x] GET /api/v1/statuses/:id/card @@ -246,13 +266,10 @@ Feature complete as of Mastodon 2.6.1 * [x] DELETE /api/v1/statuses/:id * [x] POST /api/v1/statuses/:id/reblog * [x] POST /api/v1/statuses/:id/unreblog - * [x] POST /api/v1/statuses/:id/favourite - * [x] POST /api/v1/statuses/:id/unfavourite * [x] POST /api/v1/statuses/:id/pin * [x] POST /api/v1/statuses/:id/unpin - * [x] POST /api/v1/statuses/:id/mute - * [x] POST /api/v1/statuses/:id/unmute * [x] GET /api/v1/timelines/home + * [ ] GET /api/v1/conversations * [x] GET /api/v1/timelines/public * [x] GET /api/v1/timelines/tag/:hashtag * [x] GET /api/v1/timelines/list/:list_id @@ -260,12 +277,9 @@ Feature complete as of Mastodon 2.6.1 * [x] GET /api/v1/streaming/public * [x] GET /api/v1/streaming/public/local * [x] GET /api/v1/streaming/hashtag + * [ ] GET /api/v1/streaming/hashtag/local * [x] GET /api/v1/streaming/list - * [x] POST /api/v1/push/subscription - * [x] GET /api/v1/push/subscription - * [x] PUT /api/v1/push/subscription - * [x] DELETE /api/v1/push/subscription - * [x] GET /api/v2/search + * [ ] GET /api/v1/streaming/direct ## Glitch-Soc support @@ -277,7 +291,7 @@ Feature complete as of Mastodon 2.6.1 # Copyright ```PLAIN -Copyright © 2018 tastytea . +Copyright © 2018, 2019 tastytea . License GPLv3: GNU GPL version 3 . This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. diff --git a/src/api/get.cpp b/src/api/get.cpp index 4486f37..769e54c 100644 --- a/src/api/get.cpp +++ b/src/api/get.cpp @@ -1,6 +1,6 @@ /* This file is part of mastodon-cpp. * Copyright © 2018, 2019 tastytea - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. diff --git a/src/api/post.cpp b/src/api/post.cpp index a2e228e..e2c37cb 100644 --- a/src/api/post.cpp +++ b/src/api/post.cpp @@ -41,9 +41,6 @@ return_call API::post(const Mastodon::API::v1 &call, case v1::domain_blocks: strcall = "/api/v1/domain_blocks"; break; - case v1::follows: - strcall = "/api/v1/follows"; - break; case v1::lists: strcall = "/api/v1/lists"; break; diff --git a/src/mastodon-cpp.hpp b/src/mastodon-cpp.hpp index c7e0b5e..380aaac 100644 --- a/src/mastodon-cpp.hpp +++ b/src/mastodon-cpp.hpp @@ -204,75 +204,102 @@ public: */ enum class v1 { + // Mastodon accounts_id, + // accounts, accounts_verify_credentials, + accounts_update_credentials, accounts_id_followers, accounts_id_following, accounts_id_statuses, + accounts_id_follow, + accounts_id_unfollow, accounts_relationships, accounts_search, + + apps, + // apps_verify_credentials, + blocks, - domain_blocks, - endorsements, - favourites, - follow_requests, - instance, + accounts_id_block, + accounts_id_unblock, + custom_emojis, + + domain_blocks, + + endorsements, + accounts_id_pin, + accounts_id_unpin, + + favourites, + statuses_id_favourite, + statuses_id_unfavourite, + + // filters, + // filters_id, + + follow_requests, + follow_requests_id_authorize, + follow_requests_id_reject, + + // suggestions, + // suggestions_id, + + instance, + lists, accounts_id_lists, - lists_id_accounts, lists_id, + lists_id_accounts, + + media, + media_id, + mutes, + accounts_id_mute, + accounts_id_unmute, + statuses_id_mute, + statuses_id_unmute, + notifications, notifications_id, + notifications_clear, + notifications_dismiss, + push_subscription, + reports, + + // scheduled_statuses, + // scheduled_statuses_id, + search, + + statuses, statuses_id, statuses_id_context, statuses_id_card, statuses_id_reblogged_by, statuses_id_favourited_by, + statuses_id_reblog, + statuses_id_unreblog, + statuses_id_pin, + statuses_id_unpin, + timelines_home, + // timelines_conversations, timelines_public, timelines_tag_hashtag, timelines_list_list_id, - // PATCH - accounts_update_credentials, - // POST - accounts_id_follow, - accounts_id_unfollow, - accounts_id_block, - accounts_id_unblock, - accounts_id_mute, - accounts_id_unmute, - accounts_id_pin, - accounts_id_unpin, - apps, - follow_requests_id_authorize, - follow_requests_id_reject, - follows, - media, - notifications_clear, - notifications_dismiss, - statuses, - statuses_id_reblog, - statuses_id_unreblog, - statuses_id_favourite, - statuses_id_unfavourite, - statuses_id_pin, - statuses_id_unpin, - statuses_id_mute, - statuses_id_unmute, - // PUT - media_id, - // Streaming + streaming_user, streaming_public, streaming_public_local, streaming_hashtag, + // streaming_hashtag_local, streaming_list, - // Push - push_subscription, + // streaming_direct, + // Glitch-Soc bookmarks, statuses_id_bookmark,