summaryrefslogtreecommitdiff
path: root/protocols/IRCG/src/commandmonitor.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
commit3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch)
treeefee912ee654baafeb98efcd117921db6b7489bc /protocols/IRCG/src/commandmonitor.cpp
parentbcb27264ba737778e5d3edad36088bacf74f0236 (diff)
- the kernel filters out contacts by proto names much faster than a plugin;
- database cycles simplified git-svn-id: http://svn.miranda-ng.org/main/trunk@4404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG/src/commandmonitor.cpp')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp74
1 files changed, 39 insertions, 35 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index e91473722a..085431f8de 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -139,42 +139,46 @@ VOID CALLBACK OnlineNotifTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD )
if ( name.IsEmpty() && name2.IsEmpty()) {
DBVARIANT dbv;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- char *szProto = GetContactProto(hContact);
- if (szProto != NULL && !lstrcmpiA( szProto, ppro->m_szModuleName)) {
- BYTE bRoom = ppro->getByte(hContact, "ChatRoom", 0);
- if ( bRoom == 0 ) {
- BYTE bDCC = ppro->getByte(hContact, "DCC", 0);
- BYTE bHidden = db_get_b(hContact,"CList", "Hidden", 0);
- if ( bDCC == 0 && bHidden == 0 ) {
- if ( !ppro->getTString( hContact, "Default", &dbv )) {
- BYTE bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0) ;
- if ( !bAdvanced ) {
- db_free( &dbv );
- if ( !ppro->getTString( hContact, "Nick", &dbv )) {
- ppro->m_namesToUserhost += CMString(dbv.ptszVal) + _T(" ");
- db_free( &dbv );
- }
- }
- else {
- db_free( &dbv );
- DBVARIANT dbv2;
+ for (HANDLE hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
+ if ( ppro->getByte(hContact, "ChatRoom", 0))
+ continue;
+
+ BYTE bDCC = ppro->getByte(hContact, "DCC", 0);
+ BYTE bHidden = db_get_b(hContact,"CList", "Hidden", 0);
+ if ( bDCC || bHidden)
+ continue;
+ if ( ppro->getTString( hContact, "Default", &dbv ))
+ continue;
+
+ BYTE bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0) ;
+ if ( !bAdvanced ) {
+ db_free( &dbv );
+ if ( !ppro->getTString( hContact, "Nick", &dbv )) {
+ ppro->m_namesToUserhost += CMString(dbv.ptszVal) + _T(" ");
+ db_free( &dbv );
+ }
+ }
+ else {
+ db_free( &dbv );
+ DBVARIANT dbv2;
- TCHAR* DBNick = NULL;
- TCHAR* DBWildcard = NULL;
- if ( !ppro->getTString( hContact, "Nick", &dbv ))
- DBNick = dbv.ptszVal;
- if ( !ppro->getTString( hContact, "UWildcard", &dbv2 ))
- DBWildcard = dbv2.ptszVal;
-
- if ( DBNick && ( !DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
- ppro->m_namesToWho += CMString(DBNick) + _T(" ");
- else if ( DBWildcard )
- ppro->m_namesToWho += CMString(DBWildcard) + _T(" ");
-
- if ( DBNick ) db_free(&dbv);
- if ( DBWildcard ) db_free(&dbv2);
- } } } } } } }
+ TCHAR* DBNick = NULL;
+ TCHAR* DBWildcard = NULL;
+ if ( !ppro->getTString( hContact, "Nick", &dbv ))
+ DBNick = dbv.ptszVal;
+ if ( !ppro->getTString( hContact, "UWildcard", &dbv2 ))
+ DBWildcard = dbv2.ptszVal;
+
+ if ( DBNick && ( !DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
+ ppro->m_namesToWho += CMString(DBNick) + _T(" ");
+ else if ( DBWildcard )
+ ppro->m_namesToWho += CMString(DBWildcard) + _T(" ");
+
+ if ( DBNick ) db_free(&dbv);
+ if ( DBWildcard ) db_free(&dbv2);
+ }
+ }
+ }
if ( ppro->m_namesToWho.IsEmpty() && ppro->m_namesToUserhost.IsEmpty()) {
ppro->SetChatTimer( ppro->OnlineNotifTimer, 60*1000, OnlineNotifTimerProc );