summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2016-06-23 10:12:19 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2016-06-23 10:12:19 +0000
commita9a3ec00ede7662aa9a88fe35539547b0645c349 (patch)
treea3e3281dc9dffe7b13b98802b0201a7234bfa1b3 /protocols
parenta324903b08b04759a0dfb0c08d917d70ca246c9b (diff)
VKontakte:
change http to https in urls fix for link captions in attachment market items support in attachment update VK_API_VER to 5.52 version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@17020 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/misc.cpp41
-rw-r--r--protocols/VKontakte/src/version.h4
-rw-r--r--protocols/VKontakte/src/vk.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
4 files changed, 40 insertions, 9 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 3012278540..a075efef8f 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -971,7 +971,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszTitle(jnVideo["title"].as_mstring());
int vid = jnVideo["id"].as_int();
int ownerID = jnVideo["owner_id"].as_int();
- CMString tszUrl(FORMAT, _T("http://vk.com/video%d_%d"), ownerID, vid);
+ CMString tszUrl(FORMAT, _T("https://vk.com/video%d_%d"), ownerID, vid);
res.AppendFormat(_T("%s: %s"),
SetBBCString(TranslateT("Video"), iBBC, vkbbcB),
SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
@@ -995,7 +995,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszText(jnWall["text"].as_mstring());
int id = jnWall["id"].as_int();
int fromID = jnWall["from_id"].as_int();
- CMString tszUrl(FORMAT, _T("http://vk.com/wall%d_%d"), fromID, id);
+ CMString tszUrl(FORMAT, _T("https://vk.com/wall%d_%d"), fromID, id);
res.AppendFormat(_T("%s: %s"),
SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, tszUrl),
tszText.IsEmpty() ? _T(" ") : tszText);
@@ -1007,7 +1007,7 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
CMString tszCHText(jnCopyHystoryItem["text"].as_mstring());
int iCHid = jnCopyHystoryItem["id"].as_int();
int iCHfromID = jnCopyHystoryItem["from_id"].as_int();
- CMString tszCHUrl(FORMAT, _T("http://vk.com/wall%d_%d"), iCHfromID, iCHid);
+ CMString tszCHUrl(FORMAT, _T("https://vk.com/wall%d_%d"), iCHfromID, iCHid);
tszCHText.Replace(_T("\n"), _T("\n\t\t"));
res.AppendFormat(_T("\n\t\t%s: %s"),
SetBBCString(TranslateT("Wall post"), iBBC, vkbbcUrl, tszCHUrl),
@@ -1069,15 +1069,46 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport
SetBBCString(TranslateT("Link"), iBBC, vkbbcB),
SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
- if (!tszDescription.IsEmpty())
+ if (!tszCaption.IsEmpty())
res.AppendFormat(_T("\n\t%s"), SetBBCString(tszCaption, iBBC, vkbbcI));
- if (jnLink["photo"])
+ if (jnLink["photo"])
res.AppendFormat(_T("\n\t%s"), GetVkPhotoItem(jnLink["photo"], iBBC));
if (!tszDescription.IsEmpty())
res.AppendFormat(_T("\n\t%s"), tszDescription);
}
+ else if (tszType == _T("market")) {
+ const JSONNode &jnMarket = jnAttach["market"];
+
+ int id = jnMarket["id"].as_int();
+ int ownerID = jnMarket["owner_id"].as_int();
+ CMString tszTitle(jnMarket["title"].as_mstring());
+ CMString tszDescription(jnMarket["description"].as_mstring());
+ CMString tszPhoto(jnMarket["thumb_photo"].as_mstring());
+ CMString tszUrl(FORMAT, _T("https://vk.com/%s%d?w=product%d_%d"),
+ ownerID > 0 ? _T("id") : _T("club"),
+ ownerID > 0 ? ownerID : (-1)*ownerID,
+ ownerID,
+ id);
+
+ res.AppendFormat(_T("%s: %s"),
+ SetBBCString(TranslateT("Product"), iBBC, vkbbcB),
+ SetBBCString(tszTitle, iBBC, vkbbcUrl, tszUrl));
+
+ if (!tszPhoto.IsEmpty())
+ res.AppendFormat(_T("\n\t%s: %s"),
+ SetBBCString(TranslateT("Photo"), iBBC, vkbbcB),
+ SetBBCString(tszPhoto, iBBC, vkbbcImg));
+
+ if (jnMarket["price"] && jnMarket["price"]["text"])
+ res.AppendFormat(_T("\n\t%s: %s"),
+ SetBBCString(TranslateT("Price"), iBBC, vkbbcB),
+ jnMarket["price"]["text"].as_mstring());
+
+ if (!tszDescription.IsEmpty())
+ res.AppendFormat(_T("\n\t%s"), tszDescription);
+ }
else if (tszType == _T("gift")) {
const JSONNode &jnGift = jnAttach["gift"];
if (!jnGift)
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 283bf323fb..4709f99e49 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 1
-#define __BUILD_NUM 28
+#define __RELEASE_NUM 2
+#define __BUILD_NUM 0
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index b3d7e3072d..5d2f902cb2 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -80,7 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VKERR_INVALID_URL 10106 // Upload server returned empty URL
#define VKERR_INVALID_USER 10107 // Invalid or unknown recipient user ID
-#define VK_API_VER "5.50"
+#define VK_API_VER "5.52"
#define VER_API CHAR_PARAM("v", VK_API_VER)
#define VK_FEED_USER 2147483647L
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index b668ab2913..41eeceb7eb 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -782,7 +782,7 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch)
case IDM_VISIT_PROFILE:
hContact = FindUser(cu->m_uid);
if (hContact == NULL)
- Utils_OpenUrlT(CMString(FORMAT, _T("http://vk.com/id%d"), cu->m_uid));
+ Utils_OpenUrlT(CMString(FORMAT, _T("https://vk.com/id%d"), cu->m_uid));
else
SvcVisitProfile(hContact, 0);
break;