From 5f9ab0cf3c13bd2a0cae62bd9c5427ad302ac540 Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Tue, 31 Jan 2017 14:09:02 +0500 Subject: VKontakte: fix link for attachments if title is empty --- protocols/VKontakte/src/misc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 7f81cdf53e..584929f28d 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -1087,7 +1087,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport CMStringW wszUrl(FORMAT, L"https://vk.com/video%d_%d", ownerID, vid); res.AppendFormat(L"%s: %s", SetBBCString(TranslateT("Video"), iBBC, vkbbcB), - SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl)); + SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl)); } else if (wszType == L"doc") { const JSONNode &jnDoc = jnAttach["doc"]; @@ -1098,7 +1098,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport CMStringW wszUrl(jnDoc["url"].as_mstring()); res.AppendFormat(L"%s: %s", SetBBCString(TranslateT("Document"), iBBC, vkbbcB), - SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl)); + SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl)); } else if (wszType == L"wall") { const JSONNode &jnWall = jnAttach["wall"]; @@ -1180,7 +1180,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport res.AppendFormat(L"%s: %s", SetBBCString(TranslateT("Link"), iBBC, vkbbcB), - SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl)); + SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl)); if (!wszCaption.IsEmpty()) res.AppendFormat(L"\n\t%s", SetBBCString(wszCaption, iBBC, vkbbcI)); @@ -1207,7 +1207,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport res.AppendFormat(L"%s: %s", SetBBCString(TranslateT("Product"), iBBC, vkbbcB), - SetBBCString(wszTitle, iBBC, vkbbcUrl, wszUrl)); + SetBBCString(wszTitle.IsEmpty() ? TranslateT("Link") : wszTitle, iBBC, vkbbcUrl, wszUrl)); if (!wszPhoto.IsEmpty()) res.AppendFormat(L"\n\t%s: %s", -- cgit v1.2.3