diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-25 05:28:10 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-25 05:28:10 +0000 |
commit | d9342e0a5916cf57df80b4400d7ce3482a94db5e (patch) | |
tree | 136017fbaaef03fd7cd14b4418523b4f95905015 /protocols/VKontakte/src/vk_thread.cpp | |
parent | 5abf533213e126786cb859be514656a9fb3a514f (diff) |
VKontakte:
small memory leak fix
add status message support
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12262 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 173dd76f66..9e27ba6d36 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -1023,6 +1023,50 @@ void CVkProto::PollingThread(void*) /////////////////////////////////////////////////////////////////////////////////////////
+INT_PTR __cdecl CVkProto::SvcSetStatusMsg(WPARAM, LPARAM)
+{
+ debugLogA("CVkProto::SvcSetStatusMsg");
+ if (!IsOnline())
+ return 1;
+
+ MsgPopup(NULL, TranslateT("Loading status message from vk.com.\nThis may take some time."), TranslateT("Waiting..."));
+
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/status.get.json", true, &CVkProto::OnReceiveStatusMsg)
+ << VER_API);
+
+ return 0;
+}
+
+void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
+{
+ debugLogA("CVkProto::OnReceiveStatusMsg %d", reply->resultCode);
+ if (reply->resultCode != 200)
+ return;
+
+ OnReceiveStatus(reply, pReq);
+
+ ptrT ptszOldStatusMsg(db_get_tsa(NULL, m_szModuleName, "OldStatusMsg"));
+ CMString tszOldStatusMsg(ptszOldStatusMsg);
+
+ ENTER_STRING pForm = { sizeof(pForm) };
+ pForm.type = ESF_MULTILINE;
+ pForm.caption = TranslateT("Enter new status message");
+ pForm.ptszInitVal = ptszOldStatusMsg;
+ pForm.szModuleName = m_szModuleName;
+ pForm.szDataPrefix = "statusmsgform_";
+
+ if (!EnterString(&pForm))
+ return;
+
+ CMString tszNewStatusMsg(ptrT(pForm.ptszResult));
+ if (tszOldStatusMsg == tszNewStatusMsg)
+ return;
+
+ RetrieveStatusMsg(tszNewStatusMsg);
+ setTString("OldStatusMsg", ptszOldStatusMsg);
+}
+
+
void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
{
debugLogA("CVkProto::OnReceiveStatus %d", reply->resultCode);
@@ -1309,6 +1353,4 @@ INT_PTR __cdecl CVkProto::SvcVisitProfile(WPARAM hContact, LPARAM) CallService(MS_UTILS_OPENURL, (WPARAM)OUF_TCHAR, (LPARAM)tszUrl.GetBuffer());
return 0;
-}
-
-
+}
\ No newline at end of file |