Removed deprecated code.
This commit is contained in:
parent
e41fd98ec1
commit
24687cba07
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.6)
|
||||
project (mastodon-cpp
|
||||
VERSION 0.30.1
|
||||
VERSION 0.100.0
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -67,25 +67,3 @@ uint_fast16_t API::del(const std::string &call,
|
|||
return _http.request(http::method::DELETE, call,
|
||||
maptoformdata(parameters), answer);
|
||||
}
|
||||
|
||||
|
||||
// ↓↓ DEPRECATED ↓↓
|
||||
|
||||
uint_fast16_t API::del(const Mastodon::API::v1 &call,
|
||||
const string &argument)
|
||||
{
|
||||
const parametermap p = {};
|
||||
return del(call, argument, p);
|
||||
}
|
||||
|
||||
uint_fast16_t API::del(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters)
|
||||
{
|
||||
parametermap newparameters = parameters;
|
||||
|
||||
// Emulate old behaviour
|
||||
newparameters["id"] = { argument };
|
||||
|
||||
return del(call, parameters);
|
||||
}
|
||||
|
|
|
@ -214,38 +214,3 @@ uint_fast16_t API::get(const std::string &call, string &answer)
|
|||
{
|
||||
return _http.request(http::method::GET, call, answer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ↓↓ DEPRECATED ↓↓
|
||||
|
||||
uint_fast16_t API::get(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
parametermap newparameters = parameters;
|
||||
|
||||
// Emulate old behaviour
|
||||
switch (call)
|
||||
{
|
||||
case v1::search:
|
||||
case v1::accounts_search:
|
||||
newparameters["q"] = { argument };
|
||||
break;
|
||||
case v1::timelines_tag_hashtag:
|
||||
newparameters["hashtag"] = { argument };
|
||||
break;
|
||||
default:
|
||||
newparameters["id"] = { argument };
|
||||
break;
|
||||
}
|
||||
|
||||
return get(call, newparameters, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get(const Mastodon::API::v1 &call,
|
||||
const string &argument, string &answer)
|
||||
{
|
||||
const parametermap p;
|
||||
return get(call, argument, p, answer);
|
||||
}
|
||||
|
|
|
@ -73,31 +73,3 @@ uint_fast16_t API::get_stream(const std::string &call, string &answer,
|
|||
ptr = std::make_unique<http>(*this, _instance, _access_token);
|
||||
return ptr->request(http::method::GET_STREAM, call, answer);
|
||||
}
|
||||
|
||||
|
||||
// ↓↓ DEPRECATED ↓↓
|
||||
|
||||
uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr)
|
||||
{
|
||||
parametermap parameters;
|
||||
|
||||
// Emulate old behaviour
|
||||
switch (call)
|
||||
{
|
||||
case v1::streaming_hashtag:
|
||||
parameters["tag"] = { argument };
|
||||
break;
|
||||
case v1::streaming_list:
|
||||
parameters["list"] = { argument };
|
||||
break;
|
||||
default:
|
||||
ttdebug << "ERROR: Invalid call.\n";
|
||||
return 11;
|
||||
break;
|
||||
}
|
||||
|
||||
return get_stream(call, parameters, answer, ptr);
|
||||
}
|
||||
|
|
|
@ -150,25 +150,3 @@ uint_fast16_t API::post(const string &call,
|
|||
return _http.request(http::method::POST, call,
|
||||
maptoformdata(parameters), answer);
|
||||
}
|
||||
|
||||
|
||||
// ↓↓ DEPRECATED ↓↓
|
||||
|
||||
uint_fast16_t API::post(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
parametermap newparameters = parameters;
|
||||
|
||||
// Emulate old behaviour
|
||||
newparameters["id"] = { argument };
|
||||
|
||||
return post(call, newparameters, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::post(const Mastodon::API::v1 &call,
|
||||
const string &argument, string &answer)
|
||||
{
|
||||
const parametermap p;
|
||||
return post(call, argument, p, answer);
|
||||
}
|
||||
|
|
|
@ -60,17 +60,3 @@ uint_fast16_t API::put(const string &call,
|
|||
return _http.request(http::method::PUT, call,
|
||||
maptoformdata(parameters), answer);
|
||||
}
|
||||
|
||||
|
||||
// ↓↓ DEPRECATED ↓↓
|
||||
uint_fast16_t API::put(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
parametermap newparameters = parameters;
|
||||
|
||||
// Emulate old behaviour
|
||||
newparameters["id"] = { argument };
|
||||
|
||||
return put(call, newparameters, answer);
|
||||
}
|
||||
|
|
|
@ -202,11 +202,6 @@ Account Account::note(const string ¬e)
|
|||
return *this;
|
||||
}
|
||||
|
||||
const string Account::note_plain() const
|
||||
{
|
||||
return get_string("source.note");
|
||||
}
|
||||
|
||||
Easy::visibility_type Account::privacy() const
|
||||
{
|
||||
const string strprivacy = get_string("source.privacy");
|
||||
|
|
|
@ -233,14 +233,6 @@ namespace Mastodon
|
|||
*/
|
||||
Account note(const string ¬e);
|
||||
|
||||
/*!
|
||||
* @brief Returns plaintext version of note
|
||||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
[[deprecated("Will vanish in 1.0.0. Use source() instead.")]]
|
||||
const string note_plain() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns default privacy of new toots
|
||||
*
|
||||
|
|
|
@ -92,8 +92,3 @@ const std::vector<Easy::Tag> Results::hashtags_v2() const
|
|||
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::vector<string> Results::hashtags() const
|
||||
{
|
||||
return hashtags_v1();
|
||||
}
|
||||
|
|
|
@ -92,14 +92,6 @@ namespace Mastodon
|
|||
* @since 0.16.0
|
||||
*/
|
||||
const std::vector<Tag> hashtags_v2() const;
|
||||
|
||||
/*!
|
||||
* @brief Alias for hashtags_v1
|
||||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
[[deprecated("Will vanish in 1.0.0, use hashtags_v1() instead")]]
|
||||
const std::vector<string> hashtags() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
11
src/http.cpp
11
src/http.cpp
|
@ -210,12 +210,6 @@ size_t API::http::callback_write(char* data, size_t size, size_t nmemb,
|
|||
return size * nmemb;
|
||||
}
|
||||
|
||||
size_t API::http::callback(char* data, size_t size, size_t nmemb,
|
||||
string *str)
|
||||
{
|
||||
return callback_write(data, size, nmemb, str);
|
||||
}
|
||||
|
||||
double API::http::callback_progress(double /* dltotal */, double /* dlnow */,
|
||||
double /* ultotal */, double /* ulnow */)
|
||||
{
|
||||
|
@ -232,11 +226,6 @@ void API::http::cancel_stream()
|
|||
_cancel_stream = true;
|
||||
}
|
||||
|
||||
void API::http::abort_stream()
|
||||
{
|
||||
cancel_stream();
|
||||
}
|
||||
|
||||
std::mutex &API::http::get_mutex()
|
||||
{
|
||||
return _mutex;
|
||||
|
|
|
@ -148,18 +148,6 @@ const std::string API::urldecode(const std::string &str)
|
|||
return curlpp::unescape(str);
|
||||
}
|
||||
|
||||
uint_fast16_t API::register_app1(const string &instance,
|
||||
const string &client_name,
|
||||
const string &redirect_uri,
|
||||
const string &scopes,
|
||||
const string &website,
|
||||
string &client_id,
|
||||
string &client_secret,
|
||||
string &url)
|
||||
{
|
||||
return register_app1(client_name, redirect_uri, scopes, website,
|
||||
client_id, client_secret, url);
|
||||
}
|
||||
uint_fast16_t API::register_app1(const string &client_name,
|
||||
const string &redirect_uri,
|
||||
const string &scopes,
|
||||
|
@ -214,16 +202,6 @@ uint_fast16_t API::register_app1(const string &client_name,
|
|||
|
||||
}
|
||||
|
||||
uint_fast16_t API::register_app2(const string &instance,
|
||||
const string &client_id,
|
||||
const string &client_secret,
|
||||
const string &redirect_uri,
|
||||
const string &code,
|
||||
string &access_token)
|
||||
{
|
||||
return register_app2(client_id, client_secret, redirect_uri, code, access_token);
|
||||
}
|
||||
|
||||
uint_fast16_t API::register_app2(const string &client_id,
|
||||
const string &client_secret,
|
||||
const string &redirect_uri,
|
||||
|
|
|
@ -140,9 +140,6 @@ public:
|
|||
*/
|
||||
void cancel_stream();
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0. Use cancel_stream() instead.")]]
|
||||
void abort_stream();
|
||||
|
||||
/*!
|
||||
* @brief Gets the mutex guarding the string that is written to.
|
||||
*
|
||||
|
@ -165,9 +162,6 @@ public:
|
|||
|
||||
size_t callback_write(char* data, size_t size, size_t nmemb,
|
||||
string *oss);
|
||||
[[deprecated("Will vanish in 1.0.0. Use callback_write() instead.")]]
|
||||
size_t callback(char* data, size_t size, size_t nmemb,
|
||||
string *oss);
|
||||
double callback_progress(double /* dltotal */, double /* dlnow */,
|
||||
double /* ultotal */, double /* ulnow */);
|
||||
};
|
||||
|
@ -383,15 +377,6 @@ public:
|
|||
string &client_secret,
|
||||
string &url);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0")]]
|
||||
uint_fast16_t register_app1(const string &instance,
|
||||
const string &client_name,
|
||||
const string &redirect_uri,
|
||||
const string &scopes,
|
||||
const string &website,
|
||||
string &client_id,
|
||||
string &client_secret,
|
||||
string &url);
|
||||
|
||||
/*!
|
||||
* @brief Register application, step 2/2
|
||||
|
@ -414,14 +399,6 @@ public:
|
|||
const string &code,
|
||||
string &access_token);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0")]]
|
||||
uint_fast16_t register_app2(const string &instance,
|
||||
const string &client_id,
|
||||
const string &client_secret,
|
||||
const string &redirect_uri,
|
||||
const string &code,
|
||||
string &access_token);
|
||||
|
||||
/*!
|
||||
* @brief Gets the header from the last answer.
|
||||
*
|
||||
|
@ -535,19 +512,6 @@ public:
|
|||
*/
|
||||
uint_fast16_t get(const string &call, string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use get() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t get(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use get() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t get(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a streaming GET request.
|
||||
*
|
||||
|
@ -602,13 +566,6 @@ public:
|
|||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use get_stream() without string "
|
||||
"argument instead.")]]
|
||||
uint_fast16_t get_stream(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr);
|
||||
|
||||
/*!
|
||||
* @brief Make a PATCH request.
|
||||
*
|
||||
|
@ -680,19 +637,6 @@ public:
|
|||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use post() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t post(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use post() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t post(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a PUT request which requires a parameters.
|
||||
*
|
||||
|
@ -729,13 +673,6 @@ public:
|
|||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use put() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t put(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a DELETE request which requires parameters.
|
||||
*
|
||||
|
@ -766,17 +703,6 @@ public:
|
|||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use del() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t del(const Mastodon::API::v1 &call,
|
||||
const string &argument);
|
||||
|
||||
[[deprecated("Will vanish in 1.0.0, use del() without string argument "
|
||||
"instead.")]]
|
||||
uint_fast16_t del(const Mastodon::API::v1 &call,
|
||||
const string &argument,
|
||||
const parametermap ¶meters);
|
||||
|
||||
private:
|
||||
const string _instance;
|
||||
string _access_token;
|
||||
|
|
Reference in New Issue