From 1f53603a20c3cccc23f001f5e9fcabee97afd100 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Thu, 16 Oct 2014 09:15:31 +0000 Subject: VKontakte: add destroy options for offline chats more processing for kick and invite git-svn-id: http://svn.miranda-ng.org/main/trunk@10795 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 4089e27ed0..fe75ca477c 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -574,10 +574,18 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (chat_id != 0) { CMString action_chat = json_as_string(json_get(pMsg, "action")); - CMString action_mid = json_as_string(json_get(pMsg, "action_mid")); - if ((action_chat == "chat_kick_user") && (_ttoi(action_mid.GetBuffer()) == m_myUserId)) + int action_mid = _ttoi(json_as_string(json_get(pMsg, "action_mid"))); + if ((action_chat == "chat_kick_user") && (action_mid == m_myUserId)) KickFromChat(chat_id, uid, pMsg); - else + else if ((action_chat == "chat_invite_user") && (action_mid == m_myUserId)){ + MCONTACT chatContact = FindChat(chat_id); + if (chatContact){ + db_unset(chatContact, m_szModuleName, "kicked"); + db_unset(chatContact, m_szModuleName, "off"); + } + AppendChatMessage(chat_id, pMsg, false); + } + else AppendChatMessage(chat_id, pMsg, false); continue; } -- cgit v1.2.3