diff options
| author | ElzorFox <elzorfox@ya.ru> | 2025-06-11 15:07:47 +0500 |
|---|---|---|
| committer | ElzorFox <elzorfox@ya.ru> | 2025-06-11 15:07:47 +0500 |
| commit | 5901c284963c315039264fb77a90280633f3e532 (patch) | |
| tree | ee950c157365f9865cbfe94b5eff4378564dc1f3 /protocols | |
| parent | 5d151da574c4567b1ba1ee6f4e21043866c4ee00 (diff) | |
VKontakte: fix ‘Unknow contact’ on message from new contact
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 03f842609f..57cdb27a9a 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -366,7 +366,12 @@ void CVkProto::OnReceiveMessages(MHttpResponse *reply, AsyncHttpRequest *pReq) CMStringW wszPeerType(jnPeer["type"].as_mstring());
VKUserID_t iUserId = jnPeer["id"].as_int();
- MCONTACT hContact = (wszPeerType == L"chat") ? FindChat(iUserId % VK_CHAT_MIN) : FindUser(iUserId, true);
+ MCONTACT hContact = (wszPeerType == L"chat") ? FindChat(iUserId % VK_CHAT_MIN) : FindUser(iUserId);
+ if (!hContact) {
+ hContact = FindUser(iUserId, true);
+ RetrieveUserInfo(iUserId);
+ }
+
WriteQSWord(hContact, "in_read", jnItem["in_read"].as_int());
WriteQSWord(hContact, "out_read", jnItem["out_read"].as_int());
if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnReceive)
|
