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/FacebookRM/src/contacts.cpp | 8 ++++---- protocols/FacebookRM/src/process.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/FacebookRM/src') diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 392b95df82..0d3ba50bfe 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -38,7 +38,7 @@ bool FacebookProto::IsMyContact(HANDLE hContact, bool include_chat) HANDLE FacebookProto::ChatIDToHContact(std::string chat_id) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if(!IsMyContact(hContact, true)) continue; @@ -60,8 +60,8 @@ HANDLE FacebookProto::ChatIDToHContact(std::string chat_id) HANDLE FacebookProto::ContactIDToHContact(std::string user_id) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - if(!IsMyContact(hContact)) + for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + if (!IsMyContact(hContact)) continue; DBVARIANT dbv; @@ -135,7 +135,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_ void FacebookProto::SetAllContactStatuses(int status, bool reset_client) { for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - if (!IsMyContact(hContact)) + if ( db_get_b(hContact,m_szModuleName,"ChatRoom",0)) continue; if (reset_client) { diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index e3f1a014ba..ae0911e3f0 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -160,8 +160,8 @@ void FacebookProto::ProcessFriendList( void* data ) // Check and update old contacts - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - if (!IsMyContact(hContact)) + for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + if ( db_get_b(hContact,m_szModuleName,"ChatRoom",0)) continue; DBVARIANT dbv; -- cgit v1.2.3