diff options
-rw-r--r-- | protocols/VKontakte/src/version.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 14 |
2 files changed, 5 insertions, 11 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index d647c9547c..9d2cfa1eaf 100644 --- a/protocols/VKontakte/src/version.h +++ b/protocols/VKontakte/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 14
-#define __BUILD_NUM 4
+#define __BUILD_NUM 5
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index c0940af108..132e4dc7e3 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -214,17 +214,11 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe CMStringW wszPeerType(jnPeer["type"].as_mstring());
int iUserId = jnPeer["id"].as_int();
- if (wszPeerType == L"user" || wszPeerType == L"group") {
- MCONTACT hContact = FindUser(iUserId, true);
- setDword(hContact, "in_read", jnItem["in_read"].as_int());
- setDword(hContact, "out_read", jnItem["out_read"].as_int());
- if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnReceive)
- MarkMessagesRead(hContact);
- }
- else {
- MCONTACT hContact = FindChat(iUserId % VK_CHAT_FLAG);
+ MCONTACT hContact = (wszPeerType == L"chat") ? FindChat(iUserId % VK_CHAT_FLAG) : FindUser(iUserId, true);
+ setDword(hContact, "in_read", jnItem["in_read"].as_int());
+ setDword(hContact, "out_read", jnItem["out_read"].as_int());
+ if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnReceive)
MarkMessagesRead(hContact);
- }
}
}
|