From 5f310e19fd9b3ab199682fda1e4874e1fc2cc158 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Fri, 5 Aug 2016 08:37:43 +0000 Subject: =?UTF-8?q?VKontakte:=20fix(=3F=3F=3F)=20=E2=80=98validation=20req?= =?UTF-8?q?uired=E2=80=99=20error=20add=20support=20vk-groups=20contacts?= =?UTF-8?q?=20fix=20(=3F=3F=3F)=20rare=20error=20with=20WorkerThread=20on?= =?UTF-8?q?=20connection=20lost=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@17159 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'protocols/VKontakte/src/vk_proto.cpp') 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; -- cgit v1.2.3