diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-16 09:15:31 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-10-16 09:15:31 +0000 |
commit | 1f53603a20c3cccc23f001f5e9fcabee97afd100 (patch) | |
tree | 6b94e2d5e3498149057d124f41f5f25ffe57bb84 /protocols/VKontakte/src/misc.cpp | |
parent | f71c05fadaa38b0719f75d8ba5fc26ea230b478e (diff) |
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
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
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<strlen(Msg))
retMsg = mir_strdup(&Msg[retLen]);
return retMsg;
|