summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-12-16 09:41:48 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-12-16 09:41:48 +0000
commit640137e05fa985829eabfecfe156d5b7fa376bef (patch)
treef2a1904d9cf9de7c2ca5102625067aff77eda29f /protocols
parent69bb0a1de92fdab868f1c1ed4ff9acb66351863a (diff)
VKontakte: add link attachments type support
git-svn-id: http://svn.miranda-ng.org/main/trunk@11446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index f4e5866713..139d16e6fc 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -1347,6 +1347,27 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments)
res.AppendFormat(_T("[img]%s[/img]"), ptszLink);
}
}
+ else if (!mir_tstrcmp(ptszType, _T("link"))){
+ JSONNODE *pLink = json_get(pAttach, "link");
+ if (pLink == NULL)
+ continue;
+
+ ptrT ptszUrl(json_as_string(json_get(pLink, "url")));
+ ptrT ptszTitle(json_as_string(json_get(pLink, "title")));
+ ptrT ptszDescription(json_as_string(json_get(pLink, "description")));
+ CMString tszImage(json_as_string(json_get(pLink, "image_src")));
+
+ res.AppendFormat(_T("%s: %s (%s)"), TranslateT("Link"), ptszTitle ? ptszTitle : _T(""), ptszUrl ? ptszUrl : _T(""));
+ if (!tszImage.IsEmpty())
+ if (m_bAddImgBbc)
+ res.AppendFormat(_T("\n\tImage: [img]%s[/img]"), tszImage.GetBuffer());
+ else
+ res.AppendFormat(_T("\n\tImage: %s"), tszImage.GetBuffer());
+
+ if (ptszDescription)
+ res.AppendFormat(_T("\n\t%s"), ptszDescription);
+
+ }
else res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), ptszType);
res.AppendChar('\n');