format
This commit is contained in:
@@ -142,8 +142,7 @@ void HttpGet::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBas
|
||||
throw CocoaTweet::Exception::CredentialNotVerifiedException(
|
||||
message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 348) {
|
||||
throw CocoaTweet::Exception::InvalidateTokenException(
|
||||
message.get<std::string>().c_str());
|
||||
throw CocoaTweet::Exception::InvalidateTokenException(message.get<std::string>().c_str());
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,8 +159,7 @@ void HttpPost::process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBa
|
||||
throw CocoaTweet::Exception::CredentialNotVerifiedException(
|
||||
message.get<std::string>().c_str());
|
||||
} else if (error.get<int>() == 348) {
|
||||
throw CocoaTweet::Exception::InvalidateTokenException(
|
||||
message.get<std::string>().c_str());
|
||||
throw CocoaTweet::Exception::InvalidateTokenException(message.get<std::string>().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
namespace CocoaTweet::API::Model {
|
||||
|
||||
BearerToken::BearerToken() : token_("") {}
|
||||
BearerToken::BearerToken(const std::string _token)
|
||||
: token_(_token) {}
|
||||
BearerToken::BearerToken(const std::string _token) : token_(_token) {}
|
||||
const std::string& BearerToken::token() const {
|
||||
return token_;
|
||||
}
|
||||
|
||||
@@ -19,14 +19,12 @@ void AccessToken::oauthToken(const CocoaTweet::API::Model::OAuthToken _token) {
|
||||
|
||||
const CocoaTweet::API::Model::OAuthToken AccessToken::process(
|
||||
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
|
||||
|
||||
auto key = oauth_.lock()->key();
|
||||
key.authType(CocoaTweet::Authentication::Key::AUTH_TYPE::OAUTH10A);
|
||||
key.accessToken(oauthToken_.oauthToken());
|
||||
key.accessTokenSecret(oauthToken_.oauthTokenSecret());
|
||||
auto oauth = std::make_shared<CocoaTweet::Authentication::OAuth1>(key);
|
||||
|
||||
|
||||
CocoaTweet::API::Model::OAuthToken oauthToken;
|
||||
HttpPost::process(oauth, [&oauthToken](const std::string& _rcv) {
|
||||
auto mp = CocoaTweet::Util::parse(_rcv, '&', '=');
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef COCOATWEET_API_OAUTH1_AUTHENTICATE_H_
|
||||
#define COCOATWEET_API_OAUTH1_AUTHENTICATE_H_
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifndef COCOATWEET_API_OAUTH1_INVALIDATETOKEN_H_
|
||||
#define COCOATWEET_API_OAUTH1_INVALIDATETOKEN_H_
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -16,7 +16,6 @@ public:
|
||||
private:
|
||||
std::string bearer_;
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace CocoaTweet::API::OAuth2
|
||||
|
||||
#endif
|
||||
@@ -14,7 +14,8 @@ const std::string OAuth2::token() const {
|
||||
return token.process(oauth_);
|
||||
}
|
||||
|
||||
const CocoaTweet::API::Model::BearerToken OAuth2::invalidateToken(const std::string& _bearer) const {
|
||||
const CocoaTweet::API::Model::BearerToken OAuth2::invalidateToken(
|
||||
const std::string& _bearer) const {
|
||||
// auto key = oauth_.lock()->key();
|
||||
// auto oauth = std::make_shared<CocoaTweet::Authentication::Basic>(key);
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ std::string urlDecode(const std::string& _str){
|
||||
int first = 0;
|
||||
int last = _str.find_first_of('%');
|
||||
|
||||
|
||||
|
||||
while (first < _str.size()) {
|
||||
if (last == std::string::npos) {
|
||||
out << _str.substr(first);
|
||||
|
||||
@@ -49,8 +49,6 @@ auto main() -> int {
|
||||
user = api.user().show("milkcocoa9692");
|
||||
std::cout << user.id() << std::endl;
|
||||
|
||||
|
||||
|
||||
// api.directMessage().messageCreate(
|
||||
// user.id(),
|
||||
// "これはクソみたいなスパムDMです。\nCocoaTwitterLibraryで、user/"
|
||||
|
||||
Reference in New Issue
Block a user