From 76cbb4b4419e389f8d5588e014247801758e98fc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 Jan 2014 20:51:47 +0000 Subject: idea with the base domain in VK considered useless git-svn-id: http://svn.miranda-ng.org/main/trunk@7537 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'protocols/VKontakte/src/vk_thread.cpp') diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 33a449ce95..fdcfa44742 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -17,6 +17,8 @@ along with this program. If not, see . #include "stdafx.h" +char szBlankUrl[] = "http://api.vk.com/blank.html"; + void CVkProto::ShutdownSession() { if (m_hWorkerThread) { @@ -98,8 +100,7 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq if (reply->resultCode == 302) { // manual redirect LPCSTR pszLocation = findHeader(reply, "Location"); if (pszLocation) { - CMStringA redirectUrl; redirectUrl.Format("http://api.%s/blank.html", m_baseDomain); - if (!_strnicmp(pszLocation, redirectUrl, redirectUrl.GetLength())) { + if (!_strnicmp(pszLocation, szBlankUrl, sizeof(szBlankUrl)-1)) { m_szAccessToken = NULL; LPCSTR p = strstr(pszLocation, VK_TOKEN_BEG); if (p) { @@ -460,8 +461,8 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe int ownerID = json_as_int(json_get(pAudio, "owner_id")); ptrT ptszArtist(json_as_string(json_get(pAudio, "artist"))); ptrT ptszTitle(json_as_string(json_get(pAudio, "title"))); - tszBody.AppendFormat(_T("%s: (%s - %s) - http://%S/audio%d_%d"), - TranslateT("Audio"), ptszArtist, ptszTitle, m_baseDomain, ownerID, aid); + tszBody.AppendFormat(_T("%s: (%s - %s) - http://vk.com/audio%d_%d"), + TranslateT("Audio"), ptszArtist, ptszTitle, ownerID, aid); } else if (!lstrcmp(ptszType, _T("video"))) { JSONNODE *pVideo = json_get(pAttach, "video"); @@ -470,8 +471,8 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe ptrT ptszTitle(json_as_string(json_get(pVideo, "title"))); int vid = json_as_int(json_get(pVideo, "vid")); int ownerID = json_as_int(json_get(pVideo, "owner_id")); - tszBody.AppendFormat(_T("%s: %s - http://%S/video%d_%d"), - TranslateT("Video"), ptszTitle, m_baseDomain, ownerID, vid); + tszBody.AppendFormat(_T("%s: %s - http://vk.com/video%d_%d"), + TranslateT("Video"), ptszTitle, ownerID, vid); } else if (!lstrcmp(ptszType, _T("doc"))) { JSONNODE *pDoc = json_get(pAttach, "doc"); -- cgit v1.2.3