summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-11 11:52:12 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-11 11:52:12 +0000
commit16836ea77582da49b82c9b95332762f7135c76ea (patch)
tree84b799b2d266d21606e28f59a174b3cdc2b06d03 /protocols/VKontakte/src/vk_chats.cpp
parent5a7f3b64a5f911cbdea5fdd3af571c03b423ec2f (diff)
VKontakte:
add processing for net error on PollServer fix for close chat tab when it destroy fix for rare crash on load chat history version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@10763 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_chats.cpp')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 6c4f9e7fc8..8ddfaa201a 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -218,6 +218,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
{
+ debugLogA("CVkProto::AppendChatMessage");
CVkChatInfo *cc = AppendChat(id, NULL);
if (cc == NULL)
return;
@@ -252,6 +253,7 @@ void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
void CVkProto::AppendChatMessage(CVkChatInfo *cc, int mid, int uid, int msgTime, LPCTSTR ptszBody, bool bIsHistory)
{
+ debugLogA("CVkProto::AppendChatMessage param");
CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&uid);
if (cu == NULL) {
cc->m_users.insert(cu = new CVkChatUser(uid));
@@ -264,12 +266,12 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int mid, int uid, int msgTime,
GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
- gce.bIsMe = uid == m_myUserId;
+ gce.bIsMe = (uid == m_myUserId);
gce.ptszUID = tszId;
gce.time = msgTime;
gce.dwFlags = (bIsHistory) ? GCEF_NOTNOTIFY : GCEF_ADDTOLOG;
- gce.ptszNick = cu->m_tszNick;
- gce.ptszText = ptszBody;
+ gce.ptszNick = mir_tstrdup(cu->m_tszNick);
+ gce.ptszText = mir_tstrdup(ptszBody);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
@@ -472,7 +474,8 @@ void CVkProto::OnChatDestroy(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_QUIT };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
-
+ gcd.iType = GC_EVENT_CONTROL;
+ CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
CallService(MS_DB_CONTACT_DELETE, (WPARAM)cc->m_hContact, 0);
}
}