From 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Apr 2013 21:40:22 +0000 Subject: - 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 --- protocols/MRA/src/Mra_functions.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'protocols/MRA/src/Mra_functions.cpp') diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 04fcac2504..1d2c70fde8 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -571,11 +571,9 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL if (dwEMailSize == -1) dwEMailSize = lstrlenA(lpszEMail); //check not already on list - for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - if (IsContactMra(hContact)) + for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (mraGetStaticStringA(hContact, "e-mail", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize)) - if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL) - { + if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL) { if (bTemporary == FALSE) db_unset(hContact, "CList", "NotOnList"); bFound = TRUE; break; @@ -599,8 +597,7 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL if (CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw) == 0) { BOOL bChatAdded = FALSE; - for (hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact)) { - if (IsContactMra(hContact)) + for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (mraGetStaticStringA(hContact, "ChatRoomID", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize)) if (CompareStringA( MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, szEMailLocal, dwEMailLocalSize, lpszEMail, dwEMailSize) == CSTR_EQUAL) { bChatAdded = TRUE; -- cgit v1.2.3