summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-02-09 05:37:49 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-02-09 05:37:49 +0000
commit30a70d349269ef4322387240718b2c9059cae691 (patch)
tree9204c4b94c10c8e2a2df158bbc32b85423cc2f0f /protocols/VKontakte/src/vk_chats.cpp
parentcc9402b1daabb0a27065e5eb704948cc2f74f7df (diff)
VKontakte:
forwarded messages support version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@12058 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_chats.cpp')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 8a2ddb51ed..327f07df55 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -251,13 +251,26 @@ void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
if (!msgTime || msgTime > now)
msgTime = now;
- ptrT tszBody(json_as_string(json_get(pMsg, "body")));
+ ptrT ptszBody(json_as_string(json_get(pMsg, "body")));
+
+ JSONNODE *pFwdMessages = json_get(pMsg, "fwd_messages");
+ if (pFwdMessages != NULL){
+ CMString tszFwdMessages = GetFwdMessages(pFwdMessages, m_iBBCForAttachments);
+ if (!IsEmpty(ptszBody))
+ tszFwdMessages = _T("\n") + tszFwdMessages;
+ ptszBody = mir_tstrdup(CMString(ptszBody) + tszFwdMessages);
+ }
+
JSONNODE *pAttachments = json_get(pMsg, "attachments");
- if (pAttachments != NULL)
- tszBody = mir_tstrdup(CMString(tszBody) + GetAttachmentDescr(pAttachments));
+ if (pAttachments != NULL){
+ CMString tszAttachmentDescr = GetAttachmentDescr(pAttachments, m_iBBCForAttachments);
+ if (!IsEmpty(ptszBody))
+ tszAttachmentDescr = _T("\n") + tszAttachmentDescr;
+ ptszBody = mir_tstrdup(CMString(ptszBody) + tszAttachmentDescr);
+ }
if (cc->m_bHistoryRead)
- AppendChatMessage(cc, uid, msgTime, tszBody, bIsHistory);
+ AppendChatMessage(cc, uid, msgTime, ptszBody, bIsHistory);
else {
CVkChatMessage *cm = cc->m_msgs.find((CVkChatMessage *)&mid);
if (cm == NULL)
@@ -265,7 +278,7 @@ void CVkProto::AppendChatMessage(int id, JSONNODE *pMsg, bool bIsHistory)
cm->m_uid = uid;
cm->m_date = msgTime;
- cm->m_tszBody = tszBody.detouch();
+ cm->m_tszBody = ptszBody.detouch();
cm->m_bHistory = bIsHistory;
}
}