From 9cc7d99f174805bc965f5bc6d0ba09e592515b80 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 27 Oct 2014 10:29:01 +0000 Subject: =?UTF-8?q?VKontakte:=20remove=20unneeded=20code=20add=20=E2=80=9C?= =?UTF-8?q?Open=20broadcast=E2=80=9D=20contacts=20menuitem=20when=20Listen?= =?UTF-8?q?ingTo=20\Enabled=20is=20change,=20MusicSendMetod=20is=20als?= =?UTF-8?q?o=20change=20some=20cleanup=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@10877 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 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 55c6d14e39..56b90c9dfa 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -60,7 +60,6 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : Clist_CreateGroup(NULL, m_defaultGroup); db_set_resident(m_szModuleName, "Status"); - m_bOne = true; m_bServerDelivery = getBool("ServerDelivery", true); m_bHideChats = getBool("HideChats", true); @@ -115,6 +114,7 @@ int CVkProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) // Other hooks HookProtoEvent(ME_MSG_WINDOWEVENT, &CVkProto::OnProcessSrmmEvent); HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead); + HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged); InitPopups(); InitMenus(); @@ -137,7 +137,8 @@ void CVkProto::InitMenus() CreateProtoService(PS_BANUSER, &CVkProto::SvcBanUser); CreateProtoService(PS_REPORTABUSE, &CVkProto::SvcReportAbuse); CreateProtoService(PS_DESTROYKICKCHAT, &CVkProto::SvcDestroyKickChat); - + CreateProtoService(PS_OPENBROADCAST, &CVkProto::SvcOpenBroadcast); + CLISTMENUITEM mi = { sizeof(mi) }; char szService[100]; @@ -208,19 +209,28 @@ void CVkProto::InitMenus() mi.ptszName = LPGENT("Destroy room"); mi.pszService = szService; g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi); + + mir_snprintf(szService, sizeof(szService), "%s%s", m_szModuleName, PS_OPENBROADCAST); + mi.position = -200001000 + CMI_OPENBROADCAST; + mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BROADCAST)); + mi.ptszName = LPGENT("Open broadcast"); + mi.pszService = szService; + g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi); } int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM) { bool bisFriend = getByte(hContact, "Auth", -1)==0; + bool bisBroadcast = !(CMString(db_get_tsa(hContact, m_szModuleName, "AudioUrl")).IsEmpty()); Menu_ShowItem(g_hContactMenuItems[CMI_GETALLSERVERHISTORY], !isChatRoom(hContact)); Menu_ShowItem(g_hContactMenuItems[CMI_VISITPROFILE], !isChatRoom(hContact)); - Menu_ShowItem(g_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend&&!isChatRoom(hContact)); + Menu_ShowItem(g_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend && !isChatRoom(hContact)); Menu_ShowItem(g_hContactMenuItems[CMI_DELETEFRIEND], bisFriend); Menu_ShowItem(g_hContactMenuItems[CMI_BANUSER], !isChatRoom(hContact)); Menu_ShowItem(g_hContactMenuItems[CMI_REPORTABUSE], !isChatRoom(hContact)); - Menu_ShowItem(g_hContactMenuItems[CMI_DESTROYKICKCHAT], isChatRoom(hContact)&&getBool(hContact, "off", false)); + Menu_ShowItem(g_hContactMenuItems[CMI_DESTROYKICKCHAT], isChatRoom(hContact) && getBool(hContact, "off", false)); + Menu_ShowItem(g_hContactMenuItems[CMI_OPENBROADCAST], !isChatRoom(hContact) && bisBroadcast); return 0; } -- cgit v1.2.3