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/misc.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'protocols/VKontakte/src/misc.cpp') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 8c15e75c20..9e69a3a29d 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -57,6 +57,23 @@ MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) return hNewContact; } +MCONTACT CVkProto::FindChat(LONG dwUserid) +{ + if (!dwUserid) + return NULL; + + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + LONG dbUserid = getDword(hContact, "vk_chat_id", -1); + if (dbUserid == -1) + continue; + + if (dbUserid == dwUserid) + return hContact; + } + + return NULL; +} + bool CVkProto::CheckMid(int guid) { for (int i=m_sendIds.getCount()-1; i >= 0; i--) @@ -555,7 +572,7 @@ char* CVkProto::GetStickerId (const char* Msg, int &stickerid) iRes = sscanf(Msg, "[sticker:%d]", &stickerid); if (iRes == 1){ mir_snprintf(HeadMsg, 32, "[sticker:%d]", stickerid); - int retLen = strlen(HeadMsg); + size_t retLen = strlen(HeadMsg); if (retLen