summaryrefslogtreecommitdiff
path: root/protocols/Yahoo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 16:54:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 16:54:27 +0000
commitb665a90f50f09435aef5bc3b5b9da710e4558690 (patch)
tree3053606dcddc1b15f73e7af1fb2507afbf20f052 /protocols/Yahoo
parent6c01981a8452577f3751298c7cdbe59b3ae81d51 (diff)
various menu items quirks, simplifications & optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@4319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo')
-rw-r--r--protocols/Yahoo/src/services.cpp17
-rw-r--r--protocols/Yahoo/src/util.cpp4
-rw-r--r--protocols/Yahoo/src/yahoo.cpp4
3 files changed, 10 insertions, 15 deletions
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 );