From 3446bbf5d662da08ae655a616f0e1c381efb0b20 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 20 Sep 2019 02:29:45 +0200 Subject: [PATCH] Deleted Easy::Report and GET /api/v1/reports. They are no longer documented by Mastodon. --- README.adoc | 3 -- src/api/get.cpp | 5 --- src/easy/entities/report.cpp | 39 ----------------------- src/easy/entities/report.hpp | 62 ------------------------------------ 4 files changed, 109 deletions(-) delete mode 100644 src/easy/entities/report.cpp delete mode 100644 src/easy/entities/report.hpp diff --git a/README.adoc b/README.adoc index 6a87af7..fc59350 100644 --- a/README.adoc +++ b/README.adoc @@ -346,7 +346,6 @@ strings and you can use unsupported fields in an `Entity` by converting it to ** [x] GET /api/v1/polls/:id ** [x] POST /api/v1/polls/:id/votes * Reports - ** [x] GET /api/v1/reports ^(Deprecated)^ ** [x] POST /api/v1/reports * Scheduled Statuses ** [ ] GET /api/v1/scheduled_statuses @@ -354,7 +353,6 @@ strings and you can use unsupported fields in an `Entity` by converting it to ** [ ] PUT /api/v1/scheduled_statuses/:id ** [ ] DELETE /api/v1/scheduled_statuses/:id * Search - ** [x] GET /api/v1/search ^(Deprecated)^ ** [x] GET /api/v2/search * Statuses ** [x] GET /api/v1/statuses/:id @@ -400,7 +398,6 @@ strings and you can use unsupported fields in an `Entity` by converting it to * [x] Poll * [x] PushSubscription * [x] Relationship -* [ ] Report ^(Deprecated)^ * [x] Results * [x] Status * [ ] ScheduledStatus diff --git a/src/api/get.cpp b/src/api/get.cpp index d80a60c..f3ba41e 100644 --- a/src/api/get.cpp +++ b/src/api/get.cpp @@ -86,11 +86,6 @@ const return_call API::get(const Mastodon::API::v1 &call, strcall = "/api/v1/notifications"; break; } - case v1::reports: - { - strcall = "/api/v1/reports"; - break; - } case v1::timelines_home: { strcall = "/api/v1/timelines/home"; diff --git a/src/easy/entities/report.cpp b/src/easy/entities/report.cpp deleted file mode 100644 index 6b134c2..0000000 --- a/src/easy/entities/report.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* 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 Affero General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include "report.hpp" - -using namespace Mastodon; -using Report = Easy::Report; - -bool Report::valid() const -{ - return Entity::check_valid( - { - "id", - "action_taken" - }); -} - -bool Report::action_taken() const -{ - return get_bool("action_taken"); -} - -const string Report::id() const -{ - return get_string("id"); -} diff --git a/src/easy/entities/report.hpp b/src/easy/entities/report.hpp deleted file mode 100644 index d91a466..0000000 --- a/src/easy/entities/report.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* 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 Affero General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef MASTODON_CPP_EASY_REPORT_HPP -#define MASTODON_CPP_EASY_REPORT_HPP - -#include -#include - -#include "../../mastodon-cpp.hpp" -#include "../entity.hpp" - -using std::string; - -namespace Mastodon -{ -namespace Easy -{ - /*! - * @brief Class to hold reports - * - * before 0.11.0 - */ - class Report : public Entity - { - public: - using Entity::Entity; - - virtual bool valid() const override; - - /*! - * @brief Returns true if an action was taken in response to the - * report - * - * @since before 0.11.0 - */ - bool action_taken() const; - - /*! - * @brief Returns the ID of the report - * - * @since before 0.11.0 - */ - const string id() const; - }; -} -} - -#endif // MASTODON_CPP_EASY_REPORT_HPP