From 0220c65f60daedd91dc8db724e73094d3d88db99 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Thu, 18 Dec 2014 04:17:30 +0000 Subject: =?UTF-8?q?VKontakte:=20vk=20feeds=20support=20(notifications)=20?= =?UTF-8?q?=E2=80=93=20part=203=20version=20bump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@11498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.h | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'protocols/VKontakte/src/vk_proto.h') diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 8167a0b47d..6ee5a25b7b 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -163,14 +163,16 @@ struct CVkUserInfo : public MZeroedObject{ m_bIsGroup(false) {} - CVkUserInfo(LONG _UserId, bool _bIsGroup, CMString& _tszUserNick, CMString& _tszLink) : + CVkUserInfo(LONG _UserId, bool _bIsGroup, CMString& _tszUserNick, CMString& _tszLink, MCONTACT _hContact = NULL) : m_UserId(_UserId), m_bIsGroup(_bIsGroup), m_tszUserNick(_tszUserNick), - m_tszLink(_tszLink) + m_tszLink(_tszLink), + m_hContact(_hContact) {} - LONG m_UserId; + LONG m_UserId; + MCONTACT m_hContact; CMString m_tszUserNick; CMString m_tszLink; bool m_bIsGroup; @@ -186,6 +188,13 @@ struct TFakeAckParams int msgid; }; +enum VKObjType { vkNull, vkPost, vkPhoto, vkVideo, vkComment, vkTopic, vkUsers, vkCopy }; + +struct CVkNotification { + TCHAR *tszType; + VKObjType vkParent, vkFeedback; +}; + struct CVkProto : public PROTO { CVkProto(const char*, const TCHAR*); @@ -309,11 +318,24 @@ struct CVkProto : public PROTO void AddFeedSpecialUser(); void AddFeedEvent(CMString& tszBody, time_t tTime); - void CreateVkUserInfoList(OBJLIST &vkUsers, JSONNODE *pResponse); + + CVkUserInfo * GetVkUserInfo(LONG iUserId, OBJLIST &vkUsers); + void CreateVkUserInfoList(OBJLIST &vkUsers, JSONNODE *pResponse); CMString GetVkPhotoItem(JSONNODE *pPhotoItem); + CMString GetVkNewsItem(JSONNODE *pItem, OBJLIST &vkUsers, time_t &tDate); + + CMString GetVkNotificationsItem(JSONNODE *pItem, OBJLIST &vkUsers, time_t &tDate); + CMString GetVkFeedback(JSONNODE *pFeedback, VKObjType vkFeedbackType, OBJLIST &vkUsers, CVkUserInfo *vkUser); + CMString GetVkParent(JSONNODE *pParent, VKObjType vkParentType); + void RetrieveUnreadNews(); void OnReceiveUnreadNews(NETLIBHTTPREQUEST*, AsyncHttpRequest*); + + void RetrieveUnreadNotifications(); + void OnReceiveUnreadNotifications(NETLIBHTTPREQUEST*, AsyncHttpRequest*); + + void SpanVKNotificationType(CMString& tszType, VKObjType& vkFeedback, VKObjType& vkParent); //==== Misc ========================================================================== -- cgit v1.2.3