From f90be5cdeec5875d1022e1ef35f5b101bd76ac84 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Oct 2012 07:46:53 +0000 Subject: service call replaced with the direct function call git-svn-id: http://svn.miranda-ng.org/main/trunk@1857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/jabber_chat.cpp | 8 ++++---- protocols/JabberG/jabber_icolib.cpp | 4 ++-- protocols/JabberG/jabber_iqid.cpp | 4 ++-- protocols/JabberG/jabber_misc.cpp | 8 ++++---- protocols/JabberG/jabber_opt.cpp | 4 ++-- protocols/JabberG/jabber_privacy.cpp | 16 ++++++++-------- protocols/JabberG/jabber_proto.cpp | 8 ++++---- protocols/JabberG/jabber_rc.cpp | 8 ++++---- protocols/JabberG/jabber_thread.cpp | 4 ++-- protocols/JabberG/jabber_util.cpp | 8 ++++---- 10 files changed, 36 insertions(+), 36 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/jabber_chat.cpp b/protocols/JabberG/jabber_chat.cpp index 7a36012092..8dacc24619 100644 --- a/protocols/JabberG/jabber_chat.cpp +++ b/protocols/JabberG/jabber_chat.cpp @@ -707,9 +707,9 @@ class CGroupchatInviteDlg : public CJabberDlgBase void FilterList(CCtrlClc *) { - for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + for (HANDLE hContact = db_find_first(); hContact; - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) + hContact = db_find_next(hContact)) { char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if (lstrcmpA(proto, m_proto->m_szModuleName) || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0)) @@ -825,9 +825,9 @@ public: HWND hwndList = GetDlgItem(m_hwnd, IDC_CLIST); // invite users from roster - for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + for (HANDLE hContact = db_find_first(); hContact; - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) + hContact = db_find_next(hContact)) { char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if (!lstrcmpA(proto, m_proto->m_szModuleName) && !DBGetContactSettingByte(hContact, proto, "ChatRoom", 0)) diff --git a/protocols/JabberG/jabber_icolib.cpp b/protocols/JabberG/jabber_icolib.cpp index 8313246718..f29a827313 100644 --- a/protocols/JabberG/jabber_icolib.cpp +++ b/protocols/JabberG/jabber_icolib.cpp @@ -585,7 +585,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR* jid, HANDLE hContact void CJabberProto::CheckAllContactsAreTransported() { - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( !lstrcmpA( m_szModuleName, szProto )) { @@ -595,7 +595,7 @@ void CJabberProto::CheckAllContactsAreTransported() JFreeVariant( &dbv ); } } - hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 ); + hContact = db_find_next(hContact); } } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/jabber_iqid.cpp b/protocols/JabberG/jabber_iqid.cpp index acac62cfdb..7679450d59 100644 --- a/protocols/JabberG/jabber_iqid.cpp +++ b/protocols/JabberG/jabber_iqid.cpp @@ -526,7 +526,7 @@ void CJabberProto::OnIqResultGetRoster( HXML iqNode, CJabberIqInfo* pInfo ) if ( m_options.RosterSync == TRUE ) { int listSize = 0, listAllocSize = 0; HANDLE* list = NULL; - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* str = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( str != NULL && !strcmp( str, m_szModuleName )) { @@ -546,7 +546,7 @@ void CJabberProto::OnIqResultGetRoster( HXML iqNode, CJabberIqInfo* pInfo ) JFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } for ( i=0; i < listSize; i++ ) { diff --git a/protocols/JabberG/jabber_misc.cpp b/protocols/JabberG/jabber_misc.cpp index 2fb483f905..e13c0d450d 100644 --- a/protocols/JabberG/jabber_misc.cpp +++ b/protocols/JabberG/jabber_misc.cpp @@ -175,7 +175,7 @@ HANDLE CJabberProto::DBCreateContact( const TCHAR* jid, const TCHAR* nick, BOOL len = _tcslen( s ); // We can't use JabberHContactFromJID() here because of the stripResource option - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto!=NULL && !strcmp( m_szModuleName, szProto )) { @@ -188,7 +188,7 @@ HANDLE CJabberProto::DBCreateContact( const TCHAR* jid, const TCHAR* nick, BOOL } JFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } if ( hContact == NULL ) { @@ -327,9 +327,9 @@ void CJabberProto::ResolveTransportNicks( const TCHAR* jid ) // Set all contacts to offline HANDLE hContact = m_ThreadInfo->resolveContact; if ( hContact == NULL ) - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + hContact = ( HANDLE ) db_find_first(); - for ( ; hContact != NULL; hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 )) { + for ( ; hContact != NULL; hContact = db_find_next(hContact)) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( lstrcmpA( szProto, m_szModuleName )) continue; diff --git a/protocols/JabberG/jabber_opt.cpp b/protocols/JabberG/jabber_opt.cpp index b3e02d96fc..1f1270a8a1 100644 --- a/protocols/JabberG/jabber_opt.cpp +++ b/protocols/JabberG/jabber_opt.cpp @@ -1062,7 +1062,7 @@ void CJabberProto::_RosterHandleGetRequest( HXML node ) } // now it is require to process whole contact list to add not in roster contacts { - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* str = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); @@ -1100,7 +1100,7 @@ void CJabberProto::_RosterHandleGetRequest( HXML node ) DBFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } } rrud.bReadyToDownload = FALSE; diff --git a/protocols/JabberG/jabber_privacy.cpp b/protocols/JabberG/jabber_privacy.cpp index bb9c9fb97b..636cf50bf6 100644 --- a/protocols/JabberG/jabber_privacy.cpp +++ b/protocols/JabberG/jabber_privacy.cpp @@ -432,7 +432,7 @@ public: SendDlgItemMessage( m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0 ); - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); @@ -445,7 +445,7 @@ public: JFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } // append known chatroom jids from bookmarks @@ -1368,9 +1368,9 @@ void CJabberDlgPrivacyLists::CListResetOptions(HWND) void CJabberDlgPrivacyLists::CListFilter(HWND) { - for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + for (HANDLE hContact = db_find_first(); hContact; - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) + hContact = db_find_next(hContact)) { char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); if (!proto || lstrcmpA(proto, m_proto->m_szModuleName)) @@ -1471,8 +1471,8 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) CListResetIcons(hwndList, hItem, bHideIcons); } - for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact; - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0)) + for (HANDLE hContact=db_find_first(); hContact; + hContact=db_find_next(hContact)) { HANDLE hItem = m_clcClist.FindContact(hContact); if (!hItem) continue; @@ -1583,8 +1583,8 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) pList->AddRule(Jid, szJid, FALSE, dwOrder++, dwPackets); } - for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact; - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0)) + for (HANDLE hContact=db_find_first(); hContact; + hContact=db_find_next(hContact)) { hItem = m_clcClist.FindContact(hContact); diff --git a/protocols/JabberG/jabber_proto.cpp b/protocols/JabberG/jabber_proto.cpp index 3057267688..6444482ee6 100644 --- a/protocols/JabberG/jabber_proto.cpp +++ b/protocols/JabberG/jabber_proto.cpp @@ -320,12 +320,12 @@ int CJabberProto::OnModulesLoadedEx( WPARAM, LPARAM ) JHookEvent( ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick ); JHookEvent( ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent ); - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( szProto, m_szModuleName )) MenuHideSrmmIcon(hContact); - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } } DBEVENTTYPEDESCR dbEventType = {0}; @@ -345,7 +345,7 @@ int CJabberProto::OnModulesLoadedEx( WPARAM, LPARAM ) CheckAllContactsAreTransported(); // Set all contacts to offline - HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( szProto, m_szModuleName )) { @@ -362,7 +362,7 @@ int CJabberProto::OnModulesLoadedEx( WPARAM, LPARAM ) JFreeVariant( &dbv ); } } } - hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } CleanLastResourceMap(); diff --git a/protocols/JabberG/jabber_rc.cpp b/protocols/JabberG/jabber_rc.cpp index f0a6f658d2..0021733356 100644 --- a/protocols/JabberG/jabber_rc.cpp +++ b/protocols/JabberG/jabber_rc.cpp @@ -476,7 +476,7 @@ int CJabberProto::AdhocOptionsHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS int CJabberProto::RcGetUnreadEventsCount() { int nEventsSent = 0; - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( szProto, m_szModuleName )) { @@ -504,7 +504,7 @@ int CJabberProto::RcGetUnreadEventsCount() JFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } return nEventsSent; } @@ -573,7 +573,7 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0; int nEventsSent = 0; - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( szProto, m_szModuleName )) { @@ -632,7 +632,7 @@ int CJabberProto::AdhocForwardHandler( HXML, CJabberIqInfo* pInfo, CJabberAdhocS JFreeVariant( &dbv ); } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } mir_sntprintf( szMsg, SIZEOF(szMsg), TranslateT("%d message(s) forwarded"), nEventsSent ); diff --git a/protocols/JabberG/jabber_thread.cpp b/protocols/JabberG/jabber_thread.cpp index 07c609fc84..d71fd2ab60 100644 --- a/protocols/JabberG/jabber_thread.cpp +++ b/protocols/JabberG/jabber_thread.cpp @@ -583,7 +583,7 @@ recvRest: JSendBroadcast( NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, ( HANDLE ) oldStatus, m_iStatus ); // Set all contacts to offline - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { if ( !lstrcmpA(( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ), m_szModuleName )) { @@ -591,7 +591,7 @@ recvRest: MenuHideSrmmIcon( hContact ); } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } mir_free( m_szJabberJID ); diff --git a/protocols/JabberG/jabber_util.cpp b/protocols/JabberG/jabber_util.cpp index a290b56ba2..a7650c5cd0 100644 --- a/protocols/JabberG/jabber_util.cpp +++ b/protocols/JabberG/jabber_util.cpp @@ -74,7 +74,7 @@ HANDLE CJabberProto::ChatRoomHContactFromJID( const TCHAR* jid ) return ( HANDLE )NULL; HANDLE hContactMatched = NULL; - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( m_szModuleName, szProto )) { @@ -92,7 +92,7 @@ HANDLE CJabberProto::ChatRoomHContactFromJID( const TCHAR* jid ) break; } } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } return hContactMatched; @@ -109,7 +109,7 @@ HANDLE CJabberProto::HContactFromJID( const TCHAR* jid , BOOL bStripResource ) JABBER_LIST_ITEM* item = ListGetItemPtr( LIST_CHATROOM, jid ); HANDLE hContactMatched = NULL; - HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + HANDLE hContact = ( HANDLE ) db_find_first(); while ( hContact != NULL ) { char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 ); if ( szProto != NULL && !strcmp( m_szModuleName, szProto )) { @@ -145,7 +145,7 @@ HANDLE CJabberProto::HContactFromJID( const TCHAR* jid , BOOL bStripResource ) break; } } } - hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 ); + hContact = db_find_next(hContact); } return hContactMatched; -- cgit v1.2.3