summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-15 12:00:38 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-15 12:00:38 +0000
commit542c38c37fa98a91260ee39cabc8d78f419a5972 (patch)
tree5494bb024d6862bb39ef71a55d9d12344a8abb4f /protocols
parent8bcefd591d0a8e3232b790e4ce17f6f32e543867 (diff)
VKontakte:
change on logic ListeningTo Add writing response to debug log on OnReceiveSmth git-svn-id: http://svn.miranda-ng.org/main/trunk@10453 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/misc.cpp3
-rw-r--r--protocols/VKontakte/src/vk_proto.h1
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp18
3 files changed, 9 insertions, 13 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index f8ef8c415c..48375b0280 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -106,7 +106,8 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply,
void CVkProto::OnReceiveSmth(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
{
JSONROOT pRoot;
- CheckJsonResponse(pReq, reply, pRoot);
+ JSONNODE *Resp = CheckJsonResponse(pReq, reply, pRoot);
+ debugLogA("CVkProto::OnReceiveSmth %s", json_as_string(Resp));
}
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index adf1140b74..497b4da7c9 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -201,7 +201,6 @@ struct CVkProto : public PROTO<CVkProto>
void RetrieveMyInfo(void);
void OnReceiveMyInfo(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
- void RetrieveStatusMusic();
void RetrieveStatusMsg(const CMString &StatusMsg);
void RetrieveUserInfo(LONG userId);
void RetrieveUsersInfo(bool flag = false);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 842ad34ce9..d5126a2738 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -106,7 +106,6 @@ void CVkProto::SetServerStatus(int iNewStatus)
m_iStatus = ID_STATUS_ONLINE;
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth)
<< VER_API);
- RetrieveStatusMusic();
}
else m_iStatus = ID_STATUS_INVISIBLE;
@@ -751,12 +750,6 @@ void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
m_hPollingThread = ForkThreadEx(&CVkProto::PollingThread, NULL, NULL);
}
-void CVkProto::RetrieveStatusMusic()
-{
- CMString wszListeningTo = db_get_tsa(NULL, m_szModuleName, "ListeningTo");
- RetrieveStatusMsg(wszListeningTo);
-}
-
void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg)
{
debugLogA("CVkProto::RetrieveStatusMsg");
@@ -769,18 +762,21 @@ void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg)
INT_PTR __cdecl CVkProto::SetListeningTo(WPARAM wParam, LPARAM lParam)
{
LISTENINGTOINFO *pliInfo = (LISTENINGTOINFO*)lParam;
-
+ CMStringW wszListeningTo;
if (pliInfo == NULL || pliInfo->cbSize != sizeof(LISTENINGTOINFO))
db_unset(NULL, m_szModuleName, "ListeningTo");
else if (pliInfo->dwFlags & LTI_UNICODE) {
- CMStringW wszListeningTo;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT))
wszListeningTo = ptrT((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%track%. %title% - %artist% - %player%", (LPARAM)pliInfo));
else
- wszListeningTo.Format(L"%s. %s - %s - %s", pliInfo->ptszTrack ? pliInfo->ptszTrack : _T(""), pliInfo->ptszTitle ? pliInfo->ptszTitle : _T(""), pliInfo->ptszArtist ? pliInfo->ptszArtist : _T(""), pliInfo->ptszPlayer ? pliInfo->ptszPlayer : _T(""));
-
+ wszListeningTo.Format(L"%s. %s - %s - %s",
+ pliInfo->ptszTrack ? pliInfo->ptszTrack : _T(""),
+ pliInfo->ptszTitle ? pliInfo->ptszTitle : _T(""),
+ pliInfo->ptszArtist ? pliInfo->ptszArtist : _T(""),
+ pliInfo->ptszPlayer ? pliInfo->ptszPlayer : _T(""));
setTString("ListeningTo", wszListeningTo);
}
+ RetrieveStatusMsg(wszListeningTo);
return 0;
}