diff options
author | ElzorFox <elzorfox@ya.ru> | 2020-06-17 17:54:09 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2020-06-17 17:54:09 +0500 |
commit | 8a0b58acdb668cb469bcce87052d20b42f0ead7c (patch) | |
tree | 8f05ccbbd3e01266f2adfff22f61c0c74ca4f791 /protocols/VKontakte/src/vk_history.cpp | |
parent | 8f35d58ce9fa00dc940b616d5ac7ea1e5421612f (diff) |
VKontakte:
small VK API upgrade (5.76 => 5.78)
add support audio_message and graffiti attachments types (read only)
version bump
+ prepare for upgrade VK API version to 5.110 - part 4
Diffstat (limited to 'protocols/VKontakte/src/vk_history.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_history.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index 0fdf83b477..f5aebd9b01 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -233,13 +233,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque for (auto it = jnMsgs.rbegin(); it != jnMsgs.rend(); ++it) {
const JSONNode &jnMsg = (*it);
-
-#if (VK_NEW_API == 1)
- int mid = jnMsg["conversation_message_id"].as_int();
-#else
int mid = jnMsg["id"].as_int();
-#endif
-
if (iLastMsgId < mid)
iLastMsgId = mid;
@@ -250,9 +244,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque int uid = jnMsg["peer_id"].as_int();
int iReadMsg = getDword(param->hContact, "in_read", 0);
- int isRead = (uid <= iReadMsg);
-
-
+ int isRead = (mid <= iReadMsg);
#else
CMStringW wszBody(jnMsg["body"].as_mstring());
int uid = jnMsg["user_id"].as_int();
@@ -271,6 +263,14 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque wszBody += wszFwdMessages;
}
+ const JSONNode& jnReplyMessages = jnMsg["reply_message"];
+ if (jnReplyMessages && !jnReplyMessages.empty()) {
+ CMStringW wszReplyMessages = GetFwdMessages(jnReplyMessages, jnFUsers, m_vkOptions.BBCForAttachments());
+ if (!wszBody.IsEmpty())
+ wszReplyMessages = L"\n" + wszReplyMessages;
+ wszBody += wszReplyMessages;
+ }
+
const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments && !jnAttachments.empty()) {
CMStringW wszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
@@ -285,7 +285,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque wszBody += wszAttachmentDescr;
}
- if (m_vkOptions.bAddMessageLinkToMesWAtt && ((jnAttachments && !jnAttachments.empty()) || (jnFwdMessages && !jnFwdMessages.empty())))
+ if (m_vkOptions.bAddMessageLinkToMesWAtt && ((jnAttachments && !jnAttachments.empty()) || (jnFwdMessages && !jnFwdMessages.empty()) || (jnReplyMessages && !jnReplyMessages.empty())))
wszBody += SetBBCString(TranslateT("Message link"), m_vkOptions.BBCForAttachments(), vkbbcUrl,
CMStringW(FORMAT, L"https://vk.com/im?sel=%d&msgid=%d", uid, mid));
|