diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-28 04:30:07 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-28 04:30:07 +0000 |
commit | 0c89be2bea895bfe6c6077f4ac09d72fdffd160f (patch) | |
tree | 3a54c889af2231ea54593e49081dc1fcb5312285 | |
parent | a4644874587bfc5e56aa806dad663f8710ebbb19 (diff) |
VKontakte:
code cleanup
add debuglog lines
git-svn-id: http://svn.miranda-ng.org/main/trunk@11126 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 5 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 10 |
3 files changed, 10 insertions, 9 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index af0bd613bb..cf12dc18b8 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -145,7 +145,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
if ((json_as_int(json_get(info, "left")) == 1) || (json_as_int(json_get(info, "kicked")) == 1)){
- setByte(cc->m_hContact, "kicked", true);
+ setByte(cc->m_hContact, "kicked", (int)true);
LeaveChat(cc->m_chatid);
return;
}
@@ -549,7 +549,7 @@ void CVkProto::LeaveChat(int chat_id, bool close_window, bool delete_chat) if (delete_chat)
CallService(MS_DB_CONTACT_DELETE, (WPARAM)cc->m_hContact, 0);
else
- setByte(cc->m_hContact, "off", true);
+ setByte(cc->m_hContact, "off", (int)true);
m_chats.remove(cc);
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index c64046bed8..91716d916e 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -86,7 +86,9 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : CVkProto::~CVkProto()
{
- Netlib_CloseHandle(m_hNetlibUser); m_hNetlibUser = NULL;
+ debugLogA("CVkProto::~CVkProto");
+ Netlib_CloseHandle(m_hNetlibUser);
+ m_hNetlibUser = NULL;
UninitQueue();
UnInitMenus();
if (m_hPopupClassError)
@@ -287,6 +289,7 @@ int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM) void CVkProto::UnInitMenus()
{
+ debugLogA("CVkProto::UnInitMenus");
for (int i = 0; i < PMI_COUNT; i++)
CallService(MO_REMOVEMENUITEM, (WPARAM)g_hProtoMenuItems[i], 0);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 7e1ef02f0d..a925887b68 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -633,7 +633,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe else if (m_bUserForceOnlineOnActivity)
setWord(hContact, "Status", ID_STATUS_ONLINE);
- recv.timestamp = m_bUseLocalTime?time(NULL):datetime;
+ recv.timestamp = m_bUseLocalTime ? time(NULL) : datetime;
recv.tszMessage = ptszBody;
recv.lParam = isOut;
recv.pCustomData = szMid;
@@ -737,7 +737,7 @@ void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * m_pollingServer = mir_t2a(ptrT(json_as_string(json_get(pResponse, "server"))));
if (!m_hPollingThread) {
debugLogA("CVkProto::OnReceivePollingInfo m_hPollingThread is NULL");
- debugLogA("CVkProto::OnReceivePollingInfo m_pollingTs = \'%s' m_pollingKey = \'%s\' m_pollingServer = \'%s\'",
+ debugLogA("CVkProto::OnReceivePollingInfo m_pollingTs = \'%s' m_pollingKey = \'%s\' m_pollingServer = \'%s\'",
m_pollingTs ? m_pollingTs : "<NULL>",
m_pollingKey ? m_pollingKey : "<NULL>",
m_pollingServer ? m_pollingServer : "<NULL>");
@@ -1267,8 +1267,7 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) ptrT ptszTitle(json_as_string(json_get(pVideo, "title")));
int vid = json_as_int(json_get(pVideo, "id"));
int ownerID = json_as_int(json_get(pVideo, "owner_id"));
- res.AppendFormat(L"%s: %s - http://vk.com/video%d_%d",
- TranslateT("Video"), ptszTitle, ownerID, vid);
+ res.AppendFormat(L"%s: %s - http://vk.com/video%d_%d", TranslateT("Video"), ptszTitle, ownerID, vid);
}
else if (!lstrcmp(ptszType, L"doc")) {
JSONNODE *pDoc = json_get(pAttach, "doc");
@@ -1277,8 +1276,7 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) ptrT ptszTitle(json_as_string(json_get(pDoc, "title")));
ptrT ptszUrl(json_as_string(json_get(pDoc, "url")));
- res.AppendFormat(L"%s: (%s) - %s",
- TranslateT("Document"), ptszTitle, ptszUrl);
+ res.AppendFormat(L"%s: (%s) - %s", TranslateT("Document"), ptszTitle, ptszUrl);
}
else if (!lstrcmp(ptszType, L"wall")) {
JSONNODE *pWall = json_get(pAttach, "wall");
|