diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_messages.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 02c84f8e78..a9a7f222e4 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -256,11 +256,12 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe tszBody += tszFwdMessages;
}
+ CMString tszAttachmentDescr;
const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments) {
- CMString tszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
+ tszAttachmentDescr = GetAttachmentDescr(jnAttachments, m_vkOptions.BBCForAttachments());
if (!tszBody.IsEmpty())
- tszAttachmentDescr = _T("\n") + tszAttachmentDescr;
+ tszBody += _T("\n");
tszBody += tszAttachmentDescr;
}
@@ -319,6 +320,12 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (!isOut)
m_incIds.insert((HANDLE)mid);
}
+ else if (m_vkOptions.bLoadSentAttachments && !tszAttachmentDescr.IsEmpty() && !isOut) {
+ T2Utf pszAttach(tszAttachmentDescr);
+ recv.timestamp = time(NULL); // only local time
+ recv.szMessage = pszAttach;
+ ProtoChainRecvMsg(hContact, &recv);
+ }
}
if (!mids.IsEmpty())
|