diff options
author | ElzorFox <elzorfox@ya.ru> | 2023-01-25 23:53:19 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2023-01-25 23:53:44 +0500 |
commit | a91575c88ccd4e639e108a4f6e1d8719107826d6 (patch) | |
tree | cdb964e7398fdc31ef3627e6d8fde34300d433e0 | |
parent | 92c023bcf79eb15cb299f97fae98a7d0c26cbd42 (diff) |
VKontakte: FindUser – find user, FindChat – find chat
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 6 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 3 |
2 files changed, 9 insertions, 0 deletions
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;
|