From b665a90f50f09435aef5bc3b5b9da710e4558690 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Apr 2013 16:54:27 +0000 Subject: various menu items quirks, simplifications & optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@4319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/services.cpp | 17 ++++++----------- protocols/Yahoo/src/util.cpp | 4 ++-- protocols/Yahoo/src/yahoo.cpp | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'protocols/Yahoo/src') diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index e28d9f08fd..6aed26d1a0 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -391,8 +391,8 @@ void CYahooProto::MenuMainInit( void ) hRoot = mainMenuRoot = Menu_AddProtoMenuItem(&mi); } else { - if ( mainMenuRoot ) - CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0); + if (mainMenuRoot) + CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0); mainMenuRoot = NULL; } @@ -498,25 +498,20 @@ void CYahooProto::MenuContactInit( void ) void CYahooProto::MenuUninit( void ) { if ( mainMenuRoot ) - CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0); + CallService( MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0); - CallService( MS_CLIST_REMOVECONTACTMENUITEM, ( WPARAM )hShowProfileMenuItem, 0); + CallService( MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hShowProfileMenuItem, 0); } int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) { const HANDLE hContact = (HANDLE)wParam; - if (!IsMyContact(hContact)) { + if (!IsMyContact(hContact)) { DebugLog("[OnPrebuildContactMenu] Not a Yahoo Contact!!!"); return 0; } - CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags = CMIM_FLAGS; - if (GetWord( hContact, "yprotoid", 0) != 0) - mi.flags |= CMIF_HIDDEN; - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowProfileMenuItem, (LPARAM)&mi); + Menu_ShowItem(hShowProfileMenuItem, GetWord(hContact, "yprotoid", 0) == 0); return 0; } diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index bfbc5e61e8..864fedd128 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -61,7 +61,7 @@ int CYahooProto::DebugLog( const char *fmt, ... ) va_end( vararg ); - return CallService( MS_NETLIB_LOG, ( WPARAM )m_hNetlibUser, (LPARAM)str ); + return CallService(MS_NETLIB_LOG, (WPARAM)m_hNetlibUser, (LPARAM)str); } extern HANDLE g_hNetlibUser; @@ -78,7 +78,7 @@ int DebugLog( const char *fmt, ... ) va_end( vararg ); - return CallService( MS_NETLIB_LOG, ( WPARAM )g_hNetlibUser, (LPARAM)str ); + return CallService(MS_NETLIB_LOG, (WPARAM)g_hNetlibUser, (LPARAM)str); } int CYahooProto::GetByte( const char* valueName, int parDefltValue ) diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 29eadd3304..ada93c72db 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -329,8 +329,8 @@ HANDLE CYahooProto::add_buddy( const char *yahoo_id, const char *yahoo_name, int //not already there: add LOG(("[add_buddy] Adding buddy id: %s (Nick: %s), flags: %lu", yid, yahoo_name, flags)); - hContact = ( HANDLE )CallService( MS_DB_CONTACT_ADD, 0, 0); - CallService( MS_PROTO_ADDTOCONTACT, ( WPARAM )hContact,(LPARAM)m_szModuleName ); + hContact = (HANDLE)CallService( MS_DB_CONTACT_ADD, 0, 0); + CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)m_szModuleName); SetString( hContact, YAHOO_LOGINID, yid ); Set_Protocol( hContact, protocol ); -- cgit v1.2.3