From a91575c88ccd4e639e108a4f6e1d8719107826d6 Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Wed, 25 Jan 2023 23:53:19 +0500 Subject: =?UTF-8?q?VKontakte:=20FindUser=20=E2=80=93=20find=20user,=20Find?= =?UTF-8?q?Chat=20=E2=80=93=20find=20chat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/VKontakte/src/misc.cpp | 6 ++++++ protocols/VKontakte/src/vk_chats.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 18c4b0e5be..d163c059d2 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -171,6 +171,9 @@ MCONTACT CVkProto::FindUser(LONG dwUserid, bool bCreate) return 0; for (auto &hContact : AccContacts()) { + if (isChatRoom(hContact)) + continue; + LONG dbUserid = getDword(hContact, "ID", VK_INVALID_USER); if (dbUserid == VK_INVALID_USER) continue; @@ -197,6 +200,9 @@ MCONTACT CVkProto::FindChat(LONG dwUserid) return 0; for (auto &hContact : AccContacts()) { + if (!isChatRoom(hContact)) + continue; + LONG dbUserid = getDword(hContact, "ID", VK_INVALID_USER); if (dbUserid == VK_INVALID_USER) continue; diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 3a7e2cdfe6..f79a0f06f5 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -447,6 +447,9 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, LONG uid, int msgTime, LPCWSTR CVkChatInfo* CVkProto::GetChatByContact(MCONTACT hContact) { + if (!isChatRoom(hContact)) + return nullptr; + LONG dbUserid = getDword(hContact, "ID", VK_INVALID_USER); if (dbUserid == VK_INVALID_USER) return nullptr; -- cgit v1.2.3