diff options
author | ElzorFox <elzorfox@ya.ru> | 2024-03-07 14:25:19 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2024-03-07 14:25:19 +0500 |
commit | ec1655ecc7403b2639f4371846880ccb88058142 (patch) | |
tree | b79b99bd25617edf7be4e9a744143093669df428 /protocols/VKontakte/src | |
parent | e787977a76ef3579d0fdd690530aa5c5ee231aff (diff) |
VKontakte:
fix empty sticker url
version bump
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 8 | ||||
-rw-r--r-- | protocols/VKontakte/src/version.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 9af11685b2..8795f4d6d1 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -21,6 +21,7 @@ static const char *szGiftTypes[] = { "thumb_256", "thumb_96", "thumb_48" }; static const char *szVKUrls[] = { "http://vk.com/", "https://vk.com/", "http://new.vk.com/", "https://new.vk.com/", "http://m.vk.com/", "https://m.vk.com/" };
static const char *szAttachmentMasks[] = { "wall%d_%d", "video%d_%d", "photo%d_%d", "audio%d_%d", "doc%d_%d", "market%d_%d", "story%d_%d" };
static const char *szVKLinkParam[] = { "?z=", "?w=", "&z=", "&w=" };
+static const wchar_t* wszVKStickerUrlMask = L"https://vk.com/sticker/1-%d-%d%s";
JSONNode nullNode(JSON_NULL);
@@ -1441,6 +1442,12 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport int iStickerId = jnSticker["sticker_id"].as_int();
+ wszLink.AppendFormat(wszVKStickerUrlMask,
+ iStickerId,
+ (int)m_vkOptions.iStickerSize ? (int)m_vkOptions.iStickerSize : 128,
+ m_vkOptions.bStickerBackground ? L"b" : L""
+ );
+
for (auto& jnImage : jnImages) {
if (jnImage["width"].as_int() == (int)m_vkOptions.iStickerSize) {
wszLink = jnImage["url"].as_mstring();
@@ -1454,6 +1461,7 @@ CMStringW CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport }
wszUrl = wszLink.IsEmpty() ? (wszLink128.IsEmpty() ? wszLinkLast : wszLink128) : wszLink;
+
if (!m_vkOptions.bStikersAsSmileys)
res += SetBBCString(wszUrl, iBBC, vkbbcImg);
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 6c7978c45c..82f9b04cc0 100644 --- a/protocols/VKontakte/src/version.h +++ b/protocols/VKontakte/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 15
-#define __BUILD_NUM 6
+#define __BUILD_NUM 7
#include <stdver.h>
|