summaryrefslogtreecommitdiff
path: root/protocols/Slack/src/slack_connection.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-03-16 00:52:31 +0300
committeraunsane <aunsane@gmail.com>2017-03-16 00:52:31 +0300
commit69c00c5b8999f66f27475342c78cc4488959e8bb (patch)
tree89046c469bd8337e2c191d348d47bceb69a49ee0 /protocols/Slack/src/slack_connection.cpp
parentc84b27ebb4eaa5327c601f0b504249bf061ef3b5 (diff)
Slack: some improvements
Diffstat (limited to 'protocols/Slack/src/slack_connection.cpp')
-rw-r--r--protocols/Slack/src/slack_connection.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/protocols/Slack/src/slack_connection.cpp b/protocols/Slack/src/slack_connection.cpp
index 0cbb73992a..17f8eb5adf 100644
--- a/protocols/Slack/src/slack_connection.cpp
+++ b/protocols/Slack/src/slack_connection.cpp
@@ -22,16 +22,7 @@ void CSlackProto::Login()
return;
}
- HttpRequest *request = new HttpRequest(HttpMethod::HttpPost, SLACK_API_URL "/oauth.access");
- request->Headers
- << CHAR_VALUE("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
- request->Content
- << CHAR_VALUE("client_id", SLACK_CLIENT_ID)
- << CHAR_VALUE("client_secret", SLACK_CLIENT_SECRET)
- << ENCODED_VALUE("code", oauth.GetAuthCode())
- << ENCODED_VALUE("redirect_uri", SLACK_REDIRECT_URL);
-
- PushRequest(request, &CSlackProto::OnAuthorize);
+ PushRequest(new OAuhtAccessRequest(oauth.GetAuthCode()), &CSlackProto::OnAuthorize);
}
void CSlackProto::OnAuthorize(JSONNode &root, void*)