From 97e207d17f76808160865b254a5d61c3ab86cebf Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Tue, 16 Sep 2014 07:13:53 +0000 Subject: =?UTF-8?q?VKontakte:=20Rework=20menu=20items=20Add=20=E2=80=98Vis?= =?UTF-8?q?it=20profile=E2=80=99=20menu=20items=20Remove=20=20=E2=80=98Rel?= =?UTF-8?q?oad=20all=20messages=20from=20vk.com=E2=80=99=20for=20chats=20S?= =?UTF-8?q?ome=20cosmetic=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@10467 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 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 a67e88f833..7a68c79b52 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -230,7 +230,7 @@ void CVkProto::OnReceiveMyInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) ///////////////////////////////////////////////////////////////////////////////////////// -static char fieldsName[] = "id, first_name, last_name, photo_100, sex, timezone, contacts, online, status, about"; +static char fieldsName[] = "id, first_name, last_name, photo_100, sex, timezone, contacts, online, status, about, domain"; void CVkProto::RetrieveUserInfo(LONG userID) { @@ -345,6 +345,10 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (szValue && *szValue) setTString(hContact, "About", szValue); + szValue = json_as_string(json_get(pRecord, "domain")); + if (szValue && *szValue) + setTString(hContact, "domain", szValue); + } } @@ -438,6 +442,10 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq szValue = json_as_string(json_get(pInfo, "about")); if (szValue && *szValue) setTString(hContact, "About", szValue); + + szValue = json_as_string(json_get(pInfo, "domain")); + if (szValue && *szValue) + setTString(hContact, "domain", szValue); } if (bCleanContacts) @@ -761,7 +769,7 @@ void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg) << VER_API); } -INT_PTR __cdecl CVkProto::SetListeningTo(WPARAM wParam, LPARAM lParam) +INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM wParam, LPARAM lParam) { LISTENINGTOINFO *pliInfo = (LISTENINGTOINFO*)lParam; CMStringW wszListeningTo; @@ -782,6 +790,21 @@ INT_PTR __cdecl CVkProto::SetListeningTo(WPARAM wParam, LPARAM lParam) return 0; } +INT_PTR __cdecl CVkProto::SvcVisitProfile(WPARAM hContact, LPARAM) +{ + LONG userID = getDword(hContact, "ID", -1); + ptrT tszDomain(db_get_tsa(hContact, m_szModuleName, "domain")); + CMString tszUrl("https://vk.com/"); + + if (tszDomain) + tszUrl.Append(tszDomain); + else + tszUrl.AppendFormat(_T("id%i"), userID); + + CallService(MS_UTILS_OPENURL, (WPARAM)OUF_TCHAR, (LPARAM)tszUrl.GetBuffer()); + + return 0; +} INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM hContact, LPARAM) { -- cgit v1.2.3