summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2024-04-27 22:13:29 +0500
committerElzorFox <elzorfox@ya.ru>2024-04-27 22:13:29 +0500
commitfee70e6ec67ac82806777db31cd1ebd1448d1451 (patch)
tree87531aeb27d0cb7854e91a2d610b5bc91523ccfa /protocols/VKontakte/src/misc.cpp
parent32283350effbb57e168452ed2da6092cc83e6094 (diff)
VKontakte: fix max video preview height to 240px
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index adfc14411d..d24b9f500e 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -1188,16 +1188,20 @@ CMStringW CVkProto::GetVkPhotoForVideoItem(const JSONNode& Images, MCONTACT hCon
int iMaxSize = 0;
for (auto& it : Images) {
- int iSize = it["width"].as_int();
+ int iSize = it["height"].as_int();
if (iMaxSize < iSize)
wszRes = it["url"].as_mstring();
- if (iMaxSize > 300)
+ if (iMaxSize > 240)
break;
}
+
+
wszRes = GetVkFileItem(wszRes, hContact, iMessageId);
- return wszRes.IsEmpty() ? wszRes : SetBBCString(wszRes, bbcAdvanced, vkbbcImg, wszRes);
+ CMStringW wszPreview(FORMAT, L"%s height=%d", wszRes.c_str(), 240);
+
+ return wszRes.IsEmpty() ? wszRes : SetBBCString(TranslateT("Video"), bbcAdvanced, vkbbcImgE, wszPreview);
}