From 5161fd3fe53b85f579cfece81e25b562f1fa56ae Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 16 Sep 2012 11:50:15 +0000 Subject: - event code standardization for protocols - fix for EVENTTYPE_AUTHREQUEST processing - protocols' custom CallService core removed git-svn-id: http://svn.miranda-ng.org/main/trunk@1576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/avatar.cpp | 2 +- protocols/Yahoo/chat.cpp | 8 ++-- protocols/Yahoo/icolib.cpp | 2 +- protocols/Yahoo/im.cpp | 3 +- protocols/Yahoo/main.cpp | 2 +- protocols/Yahoo/options.cpp | 6 +-- protocols/Yahoo/proto.cpp | 91 +++++++++++--------------------------------- protocols/Yahoo/services.cpp | 12 +++--- protocols/Yahoo/util.cpp | 15 +++----- protocols/Yahoo/yahoo.cpp | 24 ++++++------ protocols/Yahoo/yahoo.h | 2 - 11 files changed, 56 insertions(+), 111 deletions(-) (limited to 'protocols/Yahoo') diff --git a/protocols/Yahoo/avatar.cpp b/protocols/Yahoo/avatar.cpp index a838e24ea1..c35707203d 100644 --- a/protocols/Yahoo/avatar.cpp +++ b/protocols/Yahoo/avatar.cpp @@ -648,7 +648,7 @@ void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, } if ( _taccess(pszDest, 0)) - YAHOO_CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest); + CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest); if (hContact != NULL) { int ck_sum = DBGetContactSettingDword(hContact, m_szModuleName,"PictCK", 0); diff --git a/protocols/Yahoo/chat.cpp b/protocols/Yahoo/chat.cpp index 9275d90e86..4477e5a0d9 100644 --- a/protocols/Yahoo/chat.cpp +++ b/protocols/Yahoo/chat.cpp @@ -259,7 +259,7 @@ void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TC TCHAR* snt = mir_a2t(who); HANDLE hContact = getbuddyH(who); - TCHAR* nick = hContact ? (TCHAR*)YAHOO_CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; + TCHAR* nick = hContact ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR) : snt; GCDEST gcd = { m_szModuleName, { NULL }, evt }; gcd.ptszID = idt; @@ -320,7 +320,7 @@ int __cdecl CYahooProto::OnGCEventHook(WPARAM, LPARAM lParam) break; case GC_USER_PRIVMESS: - YAHOO_CallService(MS_MSG_SENDMESSAGE, (WPARAM)getbuddyH(who), 0); + CallService(MS_MSG_SENDMESSAGE, (WPARAM)getbuddyH(who), 0); break; case GC_USER_LOGMENU: @@ -341,11 +341,11 @@ int __cdecl CYahooProto::OnGCEventHook(WPARAM, LPARAM lParam) switch (gch->dwData) { case 10: - YAHOO_CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)getbuddyH(who), 0); + CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)getbuddyH(who), 0); break; case 20: - YAHOO_CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)getbuddyH(who), 0); + CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)getbuddyH(who), 0); break; case 110: diff --git a/protocols/Yahoo/icolib.cpp b/protocols/Yahoo/icolib.cpp index edb364eece..09ad4853b0 100644 --- a/protocols/Yahoo/icolib.cpp +++ b/protocols/Yahoo/icolib.cpp @@ -82,5 +82,5 @@ void CYahooProto::ReleaseIconEx(const char* name, bool big) { char szSettingName[100]; mir_snprintf(szSettingName, sizeof(szSettingName), "YAHOO_%s", name); - YAHOO_CallService(big ? MS_SKIN2_RELEASEICONBIG : MS_SKIN2_RELEASEICON, 0, (LPARAM)szSettingName); + CallService(big ? MS_SKIN2_RELEASEICONBIG : MS_SKIN2_RELEASEICON, 0, (LPARAM)szSettingName); } diff --git a/protocols/Yahoo/im.cpp b/protocols/Yahoo/im.cpp index 7478b1090b..5e28ec9d5f 100644 --- a/protocols/Yahoo/im.cpp +++ b/protocols/Yahoo/im.cpp @@ -242,8 +242,7 @@ int __cdecl CYahooProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre ) return 0; } - CCSDATA ccs = { hContact, PSR_MESSAGE, 0, ( LPARAM )pre }; - return CallService( MS_PROTO_RECVMSG, 0, ( LPARAM )&ccs ); + return Proto_RecvMessage(hContact, pre); } //======================================================= diff --git a/protocols/Yahoo/main.cpp b/protocols/Yahoo/main.cpp index 6b5a440e3c..df432b5223 100644 --- a/protocols/Yahoo/main.cpp +++ b/protocols/Yahoo/main.cpp @@ -110,7 +110,7 @@ extern "C" int __declspec(dllexport)Load(void) nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_HTTPCONNS; nlu.szSettingsModule = "YAHOO/libyahoo2"; nlu.ptszDescriptiveName = TranslateT("YAHOO plugin HTTP connections"); - g_hNetlibUser = ( HANDLE )YAHOO_CallService( MS_NETLIB_REGISTERUSER, 0, ( LPARAM )&nlu ); + g_hNetlibUser = ( HANDLE )CallService( MS_NETLIB_REGISTERUSER, 0, ( LPARAM )&nlu ); YmsgrLinksInit(); /** diff --git a/protocols/Yahoo/options.cpp b/protocols/Yahoo/options.cpp index 30e821f892..17ff35bb66 100644 --- a/protocols/Yahoo/options.cpp +++ b/protocols/Yahoo/options.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if ( !ppro->GetString( YAHOO_PASSWORD, &dbv )) { //bit of a security hole here, since it's easy to extract a password from an edit box - YAHOO_CallService( MS_DB_CRYPT_DECODESTRING, strlen( dbv.pszVal )+1, ( LPARAM )dbv.pszVal ); + CallService( MS_DB_CRYPT_DECODESTRING, strlen( dbv.pszVal )+1, ( LPARAM )dbv.pszVal ); SetDlgItemTextA( hwndDlg, IDC_PASSWORD, dbv.pszVal ); DBFreeVariant( &dbv ); } @@ -68,7 +68,7 @@ static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam, switch ( LOWORD( wParam )) { case IDC_NEWYAHOOACCOUNTLINK: - YAHOO_CallService( MS_UTILS_OPENURL, 1, + CallService( MS_UTILS_OPENURL, 1, ppro->GetByte( "YahooJapan", 0 ) ? (LPARAM)"http://edit.yahoo.co.jp/config/eval_register" : (LPARAM)"http://edit.yahoo.com/config/eval_register" ); @@ -112,7 +112,7 @@ static INT_PTR CALLBACK DlgProcYahooOpts(HWND hwndDlg, UINT msg, WPARAM wParam, ppro->SetString( YAHOO_LOGINID, str ); GetDlgItemTextA( hwndDlg, IDC_PASSWORD, str, sizeof( str )); - YAHOO_CallService( MS_DB_CRYPT_ENCODESTRING, sizeof( str ),( LPARAM )str ); + CallService( MS_DB_CRYPT_ENCODESTRING, sizeof( str ),( LPARAM )str ); dbv.pszVal = NULL; if ( ppro->GetString( YAHOO_PASSWORD, &dbv ) || lstrcmpA( str, dbv.pszVal )) reconnectRequired = TRUE; diff --git a/protocols/Yahoo/proto.cpp b/protocols/Yahoo/proto.cpp index a79d3cfbf7..e73af363c8 100644 --- a/protocols/Yahoo/proto.cpp +++ b/protocols/Yahoo/proto.cpp @@ -103,7 +103,7 @@ int CYahooProto::OnModulesLoadedEx( WPARAM, LPARAM ) nlu.pfnHttpGatewayUnwrapRecv = YAHOO_httpGatewayUnwrapRecv; #endif - m_hNetlibUser = ( HANDLE )YAHOO_CallService( MS_NETLIB_REGISTERUSER, 0, ( LPARAM )&nlu ); + m_hNetlibUser = ( HANDLE )CallService( MS_NETLIB_REGISTERUSER, 0, ( LPARAM )&nlu ); MenuContactInit(); return 0; @@ -150,23 +150,19 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent ) { - DBEVENTINFO dbei = {0}; - HANDLE hContact; - DebugLog("[YahooAddToListByEvent]"); if ( !m_bLoggedIn ) return 0; - dbei.cbSize = sizeof( dbei ); - - if (( dbei.cbBlob = YAHOO_CallService( MS_DB_EVENT_GETBLOBSIZE, ( LPARAM )hDbEvent, 0 )) == -1 ) { + DBEVENTINFO dbei = { sizeof( dbei ) }; + if (( dbei.cbBlob = CallService( MS_DB_EVENT_GETBLOBSIZE, ( LPARAM )hDbEvent, 0 )) == -1 ) { DebugLog("[YahooAddToListByEvent] ERROR: Can't get blob size."); return 0; } DebugLog("[YahooAddToListByEvent] Got blob size: %lu", dbei.cbBlob); dbei.pBlob = ( PBYTE )_alloca( dbei.cbBlob ); - if ( YAHOO_CallService( MS_DB_EVENT_GET, ( WPARAM )hDbEvent, ( LPARAM )&dbei )) { + if ( CallService( MS_DB_EVENT_GET, ( WPARAM )hDbEvent, ( LPARAM )&dbei )) { DebugLog("[YahooAddToListByEvent] ERROR: Can't get event."); return 0; } @@ -181,29 +177,10 @@ HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDL return 0; } - //Adds a contact to the contact list given an auth, added or contacts event -//wParam=MAKEWPARAM(flags,iContact) -//lParam=(LPARAM)(HANDLE)hDbEvent -//Returns a HANDLE to the new contact, or NULL on failure -//hDbEvent must be either EVENTTYPE_AUTHREQ or EVENTTYPE_ADDED -//flags are the same as for PS_ADDTOLIST. -//iContact is only used for contacts events. It is the 0-based index of the -//contact in the event to add. There is no way to add two or more contacts at -//once, you should just do lots of calls. - - /* TYPE ADDED - blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), - last(ASCIIZ), email(ASCIIZ) - - TYPE AUTH REQ - blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), - last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) - */ - memcpy(&hContact,( char* )( dbei.pBlob + sizeof( DWORD )), sizeof(HANDLE)); - - if (hContact != NULL) { + HANDLE hContact = DbGetAuthEventContact(&dbei); + if (hContact != NULL) DebugLog("Temp Buddy found at: %p ", hContact); - } else + else DebugLog("hContact NULL???"); return hContact; @@ -220,27 +197,22 @@ int CYahooProto::Authorize( HANDLE hdbe ) return 1; } - DBEVENTINFO dbei; - memset( &dbei, 0, sizeof( dbei )); - dbei.cbSize = sizeof( dbei ); - if (( dbei.cbBlob = YAHOO_CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ) + DBEVENTINFO dbei = { sizeof(dbei) }; + if (( dbei.cbBlob = CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ) return 1; dbei.pBlob = ( PBYTE )_alloca( dbei.cbBlob ); - if ( YAHOO_CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )) + if ( CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )) return 1; - if ( dbei.eventType != EVENTTYPE_AUTHREQUEST ) + if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1; - if ( strcmp( dbei.szModule, m_szModuleName )) + if ( strcmp(dbei.szModule, m_szModuleName)) return 1; - HANDLE hContact; - memcpy(&hContact,( char* )( dbei.pBlob + sizeof( DWORD )), sizeof(HANDLE)); - /* Need to remove the buddy from our Miranda Lists */ - + HANDLE hContact = DbGetAuthEventContact(&dbei); if (hContact != NULL) { char *who = DBGetString(hContact, m_szModuleName, YAHOO_LOGINID); if (!who) return 0; @@ -270,13 +242,13 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) memset( &dbei, 0, sizeof( dbei )); dbei.cbSize = sizeof( dbei ); - if (( dbei.cbBlob = YAHOO_CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ) { + if (( dbei.cbBlob = CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hdbe, 0 )) == -1 ) { DebugLog("[YahooAuthDeny] ERROR: Can't get blob size"); return 1; } dbei.pBlob = ( PBYTE )alloca( dbei.cbBlob ); - if ( YAHOO_CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )) { + if ( CallService( MS_DB_EVENT_GET, ( WPARAM )hdbe, ( LPARAM )&dbei )) { DebugLog("YahooAuthDeny - Can't get db event!"); return 1; } @@ -291,12 +263,9 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) return 1; } - HANDLE hContact; - memcpy(&hContact, dbei.pBlob + sizeof(DWORD), sizeof(HANDLE)); - /* Need to remove the buddy from our Miranda Lists */ - if (hContact != NULL) - { + HANDLE hContact = DbGetAuthEventContact(&dbei); + if (hContact != NULL) { char *who = DBGetString(hContact, m_szModuleName, YAHOO_LOGINID); if (!who) return 0; @@ -305,7 +274,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) DebugLog("Rejecting buddy:%s msg: %s", who, u_reason); reject(myid, who, GetWord(hContact, "yprotoid", 0), u_reason); - YAHOO_CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); mir_free(u_reason); mir_free(myid); @@ -317,26 +286,11 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) //////////////////////////////////////////////////////////////////////////////////////// // PSR_AUTH -int __cdecl CYahooProto::AuthRecv( HANDLE hContact, PROTORECVEVENT* pre ) +int __cdecl CYahooProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre) { DebugLog("[YahooRecvAuth] "); DBDeleteContactSetting(hContact,"CList","Hidden"); - - DBEVENTINFO dbei = { 0 }; - dbei.cbSize = sizeof(dbei); - dbei.szModule = m_szModuleName; - dbei.timestamp = pre->timestamp; - dbei.flags = pre->flags & (PREF_CREATEREAD?DBEF_READ:0); - dbei.flags |= (pre->flags & PREF_UTF) ? DBEF_UTF : 0; - dbei.eventType = EVENTTYPE_AUTHREQUEST; - - /* Just copy the Blob from PSR_AUTH event. */ - dbei.cbBlob = pre->lParam; - dbei.pBlob = (PBYTE)pre->szMessage; - - CallService(MS_DB_EVENT_ADD,(WPARAM)NULL,(LPARAM)&dbei); - - return 0; + return Proto_AuthRecv(m_szModuleName, pre); } //////////////////////////////////////////////////////////////////////////////////////// @@ -470,8 +424,7 @@ int __cdecl CYahooProto::RecvFile( HANDLE hContact, PROTORECVFILET* evt ) { DBDeleteContactSetting(hContact, "CList", "Hidden"); - CCSDATA ccs = { hContact, PSR_FILE, 0, ( LPARAM )evt }; - return CallService( MS_PROTO_RECVFILE, 0, ( LPARAM )&ccs ); + return Proto_RecvFile(hContact, evt); } //////////////////////////////////////////////////////////////////////////////////////// @@ -811,7 +764,7 @@ int __cdecl CYahooProto::OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARA clmi.cbSize = sizeof(CLISTMENUITEM); clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; clmi.ptszName = m_tszUserName; - YAHOO_CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )mainMenuRoot, ( LPARAM )&clmi ); + CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )mainMenuRoot, ( LPARAM )&clmi ); } break; diff --git a/protocols/Yahoo/services.cpp b/protocols/Yahoo/services.cpp index e36a27163c..2ea817d279 100644 --- a/protocols/Yahoo/services.cpp +++ b/protocols/Yahoo/services.cpp @@ -31,7 +31,7 @@ void CYahooProto::logoff_buddies() { //set all contacts to 'offline' - HANDLE hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); while ( hContact != NULL ) { if (IsMyContact(hContact)) { @@ -45,7 +45,7 @@ void CYahooProto::logoff_buddies() //DBDeleteContactSetting(hContact, m_szModuleName, "MirVer" ); } - hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 ); + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 ); } } @@ -393,7 +393,7 @@ void CYahooProto::MenuMainInit( void ) } else { if ( mainMenuRoot ) - YAHOO_CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0 ); + CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0 ); mainMenuRoot = NULL; } @@ -500,9 +500,9 @@ void CYahooProto::MenuContactInit( void ) void CYahooProto::MenuUninit( void ) { if ( mainMenuRoot ) - YAHOO_CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0 ); + CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )mainMenuRoot, 0 ); - YAHOO_CallService( MS_CLIST_REMOVECONTACTMENUITEM, ( WPARAM )hShowProfileMenuItem, 0 ); + CallService( MS_CLIST_REMOVECONTACTMENUITEM, ( WPARAM )hShowProfileMenuItem, 0 ); } int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) @@ -522,7 +522,7 @@ int __cdecl CYahooProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) if (GetWord( hContact, "yprotoid", 0) != 0) mi.flags |= CMIF_HIDDEN; - YAHOO_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowProfileMenuItem, (LPARAM)&mi); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowProfileMenuItem, (LPARAM)&mi); return 0; } diff --git a/protocols/Yahoo/util.cpp b/protocols/Yahoo/util.cpp index e607ec0a8c..977d0b43cc 100644 --- a/protocols/Yahoo/util.cpp +++ b/protocols/Yahoo/util.cpp @@ -49,11 +49,6 @@ void CYahooProto::YHookEvent( const char* szEvent, YEventFunc handler ) ::HookEventObj( szEvent, ( MIRANDAHOOKOBJ )*( void** )&handler, this ); } -INT_PTR __stdcall YAHOO_CallService( const char* szSvcName, WPARAM wParam, LPARAM lParam ) -{ - return CallService( szSvcName, wParam, lParam ); -} - int CYahooProto::DebugLog( const char *fmt, ... ) { char str[ 4096 ]; @@ -114,7 +109,7 @@ DWORD CYahooProto::GetDword( HANDLE hContact, const char* valueName, DWORD parDe DWORD CYahooProto::SetDword( const char* valueName, DWORD parValue ) { - return DBWriteContactSettingDword( NULL, m_szModuleName, valueName, parValue); + return DBWriteContactSettingDword( NULL, m_szModuleName, valueName, parValue); } DWORD CYahooProto::GetDword( const char* valueName, DWORD parDefltValue ) @@ -124,7 +119,7 @@ DWORD CYahooProto::GetDword( const char* valueName, DWORD parDefltValue ) DWORD CYahooProto::SetDword( HANDLE hContact, const char* valueName, DWORD parValue ) { - return DBWriteContactSettingDword( hContact, m_szModuleName, valueName, parValue); + return DBWriteContactSettingDword( hContact, m_szModuleName, valueName, parValue); } @@ -171,7 +166,7 @@ int CYahooProto::SendBroadcast( HANDLE hContact, int type, int result, HANDLE hP ack.result = result; ack.hProcess = hProcess; ack.lParam = lParam; - return YAHOO_CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack ); + return CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack ); } int CYahooProto::GetString( const char* name, DBVARIANT* result ) @@ -267,7 +262,7 @@ int CYahooProto::ShowPopup( const char* nickname, const char* msg, const char *s DebugLog("[MS_POPUP_ADDPOPUPEX] Generating a popup for [%s] %s", nickname, msg); - YAHOO_CallService( MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0 ); + CallService( MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0 ); return 1; } @@ -332,7 +327,7 @@ bool CYahooProto::IsMyContact(HANDLE hContact) char* YAHOO_GetContactName( HANDLE hContact ) { - return ( char* )YAHOO_CallService( MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0 ); + return ( char* )CallService( MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0 ); } extern PLUGININFOEX pluginInfo; diff --git a/protocols/Yahoo/yahoo.cpp b/protocols/Yahoo/yahoo.cpp index dbec251ef1..591a651d10 100644 --- a/protocols/Yahoo/yahoo.cpp +++ b/protocols/Yahoo/yahoo.cpp @@ -286,9 +286,9 @@ HANDLE CYahooProto::getbuddyH(const char *yahoo_id) { HANDLE hContact; - for ( hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + for ( hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); hContact != NULL; - hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 )) + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 )) { if (IsMyContact(hContact)) { @@ -334,8 +334,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 )YAHOO_CallService( MS_DB_CONTACT_ADD, 0, 0 ); - YAHOO_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 ); @@ -621,9 +621,9 @@ void CYahooProto::ext_got_stealth(char *stealthlist) if (stealthlist) stealth = y_strsplit(stealthlist, ",", -1); - for ( hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + for ( hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); hContact != NULL; - hContact = ( HANDLE )YAHOO_CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 )) + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 )) { if (IsMyContact(hContact)) { DBVARIANT dbv; @@ -751,7 +751,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) * Make sure the contact is temporary so we could delete it w/o extra traffic */ DBWriteContactSettingByte( hContact, "CList", "NotOnList", 1 ); - YAHOO_CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); } else LOG(("[ext_rejected] Buddy not on our buddy list")); @@ -780,7 +780,7 @@ void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status ShowPopup( "Invalid Contact", "The id you tried to add is invalid.", NULL); /* Make it TEMP first, we don't want to send any extra packets for FALSE ids */ DBWriteContactSettingByte( hContact, "CList", "NotOnList", 1 ); - YAHOO_CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); } break; @@ -790,7 +790,7 @@ void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status ShowPopup( "Invalid Contact", "Unknown Error??.", NULL); /* Make it TEMP first, we don't want to send any extra packets for FALSE ids */ DBWriteContactSettingByte( hContact, "CList", "NotOnList", 1 ); - YAHOO_CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService( MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); } break; @@ -1076,7 +1076,7 @@ void ext_yahoo_got_cookies(int id) //wsprintfA(z, "Cookie: %s; Y=%s", Bcookie, yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t")); wsprintfA(z, "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t")); LOG(("Our Cookie: '%s'", z)); - YAHOO_CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hnuMain, (LPARAM)z);*/ + CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hnuMain, (LPARAM)z);*/ #ifdef HTTP_GATEWAY if (iHTTPGateway) { @@ -1086,7 +1086,7 @@ void ext_yahoo_got_cookies(int id) mir_snprintf(z, sizeof(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"), yahoo_get_cookie(id, "c")); LOG(("Our Cookie: '%s'", z)); - YAHOO_CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z); + CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z); } #endif @@ -1398,7 +1398,7 @@ static void connect_complete(void *data, int source, yahoo_input_condition condi //tSelect.dwTimeout = T->mGatewayTimeout * 1000; tSelect.dwTimeout = 1; tSelect.hReadConns[ 0 ] = ( HANDLE )source; - error = YAHOO_CallService( MS_NETLIB_SELECT, 0, ( LPARAM )&tSelect ); + error = CallService( MS_NETLIB_SELECT, 0, ( LPARAM )&tSelect ); if(error) { //close(source); diff --git a/protocols/Yahoo/yahoo.h b/protocols/Yahoo/yahoo.h index ed90bf8756..29772a0817 100644 --- a/protocols/Yahoo/yahoo.h +++ b/protocols/Yahoo/yahoo.h @@ -116,8 +116,6 @@ extern HINSTANCE hInstance; extern int iHTTPGateway; #endif -INT_PTR __stdcall YAHOO_CallService( const char* szSvcName, WPARAM wParam, LPARAM lParam ); - #define YAHOO_hasnotification() ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) int YAHOO_util_dbsettingchanged(WPARAM wParam, LPARAM lParam); -- cgit v1.2.3