diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 06098e56eb..78b078bd08 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -112,10 +112,12 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq if (m_szAccessToken == NULL)
m_szAccessToken = mir_strdup(p);
setString("AccessToken", m_szAccessToken);
+ RetrieveMyInfo();
+ }
+ else {
+ delSetting("AccessToken");
+ ConnectionFailed(LOGINERR_NOSERVER);
}
- else delSetting("AccessToken");
-
- OnLoggedIn();
}
else {
AsyncHttpRequest *pReq = new AsyncHttpRequest();
@@ -176,6 +178,12 @@ LBL_NoForm: /////////////////////////////////////////////////////////////////////////////////////////
+void CVkProto::RetrieveMyInfo()
+{
+ HttpParam param = { "access_token", m_szAccessToken };
+ PushAsyncHttpRequest(REQUEST_GET, "/method/getUserInfoEx.json", true, &CVkProto::OnReceiveMyInfo, 1, ¶m);
+}
+
void CVkProto::OnReceiveMyInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
{
debugLogA("CVkProto::OnReceiveMyInfo %d", reply->resultCode);
|