summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_struct.h
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2019-02-09 13:28:12 +0500
committerElzorFox <elzorfox@ya.ru>2019-02-09 14:26:21 +0500
commitcf25657511e567a9ce2278661393aec73ae743b3 (patch)
tree5a5328946acb9f92f06d5f6423bdd7eaee0af65d /protocols/VKontakte/src/vk_struct.h
parentf1f2e30c147faf3ee68c47e9ade1cc38e36e2f23 (diff)
VKontakte: preparation for transition to new VK_API version – stage 0.1
Diffstat (limited to 'protocols/VKontakte/src/vk_struct.h')
-rw-r--r--protocols/VKontakte/src/vk_struct.h88
1 files changed, 85 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h
index c659b04313..f6fb01ddc8 100644
--- a/protocols/VKontakte/src/vk_struct.h
+++ b/protocols/VKontakte/src/vk_struct.h
@@ -119,13 +119,13 @@ struct CVkChatInfo : public MZeroedObject
CVkChatInfo(int _id) :
m_users(10, NumericKeySortT),
m_msgs(10, NumericKeySortT),
- m_chatid(_id),
- m_admin_id(0),
+ m_iChatId(_id),
+ m_iAdminId(0),
m_bHistoryRead(0),
m_hContact(INVALID_CONTACT_ID)
{}
- int m_chatid, m_admin_id;
+ int m_iChatId, m_iAdminId;
bool m_bHistoryRead;
ptrW m_wszTopic, m_wszId;
MCONTACT m_hContact;
@@ -332,3 +332,85 @@ struct CVKDeactivateEvent {
enum VKContactType : BYTE { vkContactNormal, vkContactSelf, vkContactMUCUser };
enum VKMesType : BYTE { vkALL, vkIN, vkOUT };
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+enum vkJSONNodeType { vkJSONTypeProfile = 0, vkJSONTypeGroup, vkJSONTypeConversation };
+
+class CVkUserItem : public MZeroedObject {
+ CVkUserItem(CVkProto* vkProto, const JSONNode& jnNode, vkJSONNodeType vkJSONType = vkJSONTypeProfile);
+
+ CVkUserItem(LONG _UserId) :
+ m_iUserId(_UserId),
+ m_bIsGroup(false)
+ {}
+
+ CVkUserItem(LONG _UserId, bool _bIsGroup, CMStringW& _wszUserNick, CMStringW& _wszLink, MCONTACT _hContact = 0) :
+ m_iUserId(_UserId),
+ m_bIsGroup(_bIsGroup),
+ m_wszUserNick(_wszUserNick),
+ m_wszLink(_wszLink),
+ m_hContact(_hContact)
+ {}
+
+ /*
+ "id, first_name, last_name, photo_100, bdate, sex, timezone, contacts, last_seen, online, status, country, city, relation, interests, activities, music, movies, tv, books, games, quotes, about, domain, is_friend";
+ */
+ LONG m_iKey;
+
+ LONG m_iUserId;
+ LONG m_iChatId;
+
+ LONG m_iAdminId;
+
+
+ LONG m_iStatus;
+ LONG m_iLastSeen;
+ LONG m_iLastMsgId;
+
+ MCONTACT m_hContact;
+
+ CMStringW m_wszFirstName;
+ CMStringW m_wszLastName;
+ CMStringW m_wszUserNick;
+ CMStringW m_wszLink;
+ CMStringW m_wszDeactivated;
+ CMStringW m_wszCellular;
+ CMStringW m_wszPhone;
+ CMStringW m_wszCountry;
+ CMStringW m_wszCity;
+ CMStringW m_wszAbout;
+ CMStringW m_wszDomain;
+ CMStringW m_wszBDate;
+ CMStringW m_wszAvatarUrl;
+
+ BYTE m_btGender;
+ BYTE m_btTimezone;
+ BYTE m_btMaritalStatus;
+
+ bool m_bIsGroup;
+ bool m_bIsFriend;
+ bool m_bIsUser;
+ bool m_bIsEmail;
+ bool m_bIsMUChat;
+ bool m_bIsDeactivated;
+
+ bool m_bIsHidden;
+ bool m_bIsUpdated;
+
+ CVkProto* m_VK;
+
+ void LoadFromUserProfile(const JSONNode &jnNode);
+ void LoadFromConversation(const JSONNode &jnNode);
+ void LoadFromGroup(const JSONNode &jnNode);
+
+ MCONTACT WriteToDB(bool bForce = false, VKContactType vkContactType = VKContactType::vkContactNormal);
+
+ template <class T>
+ T Set(T& PropertyName, T Value) {
+ m_bIsUpdated = (PropertyName == Value);
+ PropertyName = Value;
+ }
+
+
+};
+