diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 41 | ||||
-rw-r--r-- | protocols/VKontakte/src/version.h | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 2 |
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;
|