diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-08-05 08:37:43 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2016-08-05 08:37:43 +0000 |
commit | 5f310e19fd9b3ab199682fda1e4874e1fc2cc158 (patch) | |
tree | ebe58be6e4c3035a8a6b9452be1694fa672dd36b /protocols/VKontakte/src/vk_proto.cpp | |
parent | e5868034a9b3cefc7b3d785e97b40b5382108fc8 (diff) |
VKontakte:
fix(???) ‘validation required’ error
add support vk-groups contacts
fix (???) rare error with WorkerThread on connection lost
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@17159 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 0ebfaf6079..77388d3a51 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -355,16 +355,17 @@ void CVkProto::InitMenus() int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
{
- LONG userID = getDword(hContact, "ID", -1);
+ LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
bool bisFriend = (getBool(hContact, "Auth", true) == 0);
bool bisBroadcast = !(IsEmpty(ptrW(db_get_wsa(hContact, m_szModuleName, "AudioUrl"))));
+ bool bIsGroup = IsGroupUser(hContact);
Menu_ShowItem(m_hContactMenuItems[CMI_VISITPROFILE], userID != VK_FEED_USER);
Menu_ShowItem(m_hContactMenuItems[CMI_MARKMESSAGESASREAD], !isChatRoom(hContact) && userID != VK_FEED_USER);
Menu_ShowItem(m_hContactMenuItems[CMI_WALLPOST], !isChatRoom(hContact));
- Menu_ShowItem(m_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend && !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(m_hContactMenuItems[CMI_DELETEFRIEND], bisFriend && userID != VK_FEED_USER);
- Menu_ShowItem(m_hContactMenuItems[CMI_BANUSER], !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(m_hContactMenuItems[CMI_REPORTABUSE], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend && !isChatRoom(hContact) && userID != VK_FEED_USER && !bIsGroup);
+ Menu_ShowItem(m_hContactMenuItems[CMI_DELETEFRIEND], bisFriend && userID != VK_FEED_USER && !bIsGroup);
+ Menu_ShowItem(m_hContactMenuItems[CMI_BANUSER], !isChatRoom(hContact) && userID != VK_FEED_USER && !bIsGroup);
+ Menu_ShowItem(m_hContactMenuItems[CMI_REPORTABUSE], !isChatRoom(hContact) && userID != VK_FEED_USER && !bIsGroup);
Menu_ShowItem(m_hContactMenuItems[CMI_DESTROYKICKCHAT], isChatRoom(hContact) && getBool(hContact, "off"));
Menu_ShowItem(m_hContactMenuItems[CMI_OPENBROADCAST], !isChatRoom(hContact) && bisBroadcast);
Menu_ShowItem(m_hContactMenuItems[CMI_GETSERVERHISTORY], !isChatRoom(hContact) && userID != VK_FEED_USER);
@@ -549,8 +550,8 @@ int CVkProto::AuthRequest(MCONTACT hContact, const wchar_t *message) if (!IsOnline())
return 1;
- LONG userID = getDword(hContact, "ID", -1);
- if (userID == -1 || !hContact || userID == VK_FEED_USER)
+ LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
+ if (userID == VK_INVALID_USER || !hContact || userID == VK_FEED_USER)
return 1;
wchar_t msg[501] = {0};
@@ -632,8 +633,8 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) {
debugLogA("CVkProto::UserIsTyping");
if (PROTOTYPE_SELFTYPING_ON == type) {
- LONG userID = getDword(hContact, "ID", -1);
- if (userID == -1 || !IsOnline() || userID == VK_FEED_USER)
+ LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
+ if (userID == VK_INVALID_USER || !IsOnline() || userID == VK_FEED_USER)
return 1;
if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnTyping)
@@ -650,8 +651,8 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) int CVkProto::GetInfo(MCONTACT hContact, int)
{
debugLogA("CVkProto::GetInfo");
- LONG userID = getDword(hContact, "ID", -1);
- if (userID == -1 || userID == VK_FEED_USER)
+ LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
+ if (userID == VK_INVALID_USER || userID == VK_FEED_USER)
return 1;
RetrieveUserInfo(userID);
return 0;
|