diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 23 | ||||
-rw-r--r-- | protocols/VKontakte/src/version.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk.h | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index db0be8587d..956cde2be4 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static char* szImageTypes[] = { "photo_2560", "photo_1280", "photo_807", "photo_604", "photo_256", "photo_130", "photo_128", "photo_75", "photo_64" };
+static char* szGiftTypes[] = { "thumb_256", "thumb_96", "thumb_48" };
+
bool IsEmpty(TCHAR *str)
{
if (str == NULL)
@@ -1084,6 +1086,27 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments, BBCSupport iBBC) if (ptszDescription)
res.AppendFormat(_T("\n\t%s"), ptszDescription);
}
+ else if (!mir_tstrcmp(ptszType, _T("gift"))) {
+ JSONNODE *pGift = json_get(pAttach, "gift");
+ if (pGift == NULL)
+ continue;
+
+ ptrT ptszLink;
+ for (int i = 0; i < SIZEOF(szImageTypes); i++) {
+ JSONNODE *n = json_get(pGift, szGiftTypes[i]);
+ if (n != NULL) {
+ ptszLink = json_as_string(n);
+ break;
+ }
+ }
+ if (IsEmpty(ptszLink))
+ continue;
+ res += SetBBCString(TranslateT("Gift"), iBBC, vkbbcUrl, ptszLink);
+
+ if (m_iIMGBBCSupport)
+ res.AppendFormat(_T("\n\t[img]%s[/img]"), ptszLink);
+
+ }
else
res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), SetBBCString(ptszType, iBBC, vkbbcB).GetBuffer());
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 52445c2ef4..beb50fbf72 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 1
+#define __BUILD_NUM 2
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h index e618973eef..4f38eb6716 100644 --- a/protocols/VKontakte/src/vk.h +++ b/protocols/VKontakte/src/vk.h @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define VKERR_INVALID_FILENAME 301 // Invalid filename
#define VKERR_INVALID_FILESIZE 302 // Invalid filesize
-#define VK_API_VER "5.30"
+#define VK_API_VER "5.31"
#define VER_API CHAR_PARAM("v", VK_API_VER)
#define VK_FEED_USER 2147483647L
|