diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
commit | 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch) | |
tree | efee912ee654baafeb98efcd117921db6b7489bc /protocols/JabberG/src/jabber_iqid.cpp | |
parent | bcb27264ba737778e5d3edad36088bacf74f0236 (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/JabberG/src/jabber_iqid.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index eced1ebbd9..3dbfd2d69d 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -535,24 +535,21 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo) if (m_options.RosterSync == TRUE) {
int listSize = 0, listAllocSize = 0;
HANDLE* list = NULL;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- char* str = GetContactProto(hContact);
- if (str != NULL && !strcmp(str, m_szModuleName)) {
- DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
- if ( !ListExist(LIST_ROSTER, dbv.ptszVal)) {
- Log("Syncing roster: preparing to delete %S (hContact=0x%x)", dbv.ptszVal, hContact);
- if (listSize >= listAllocSize) {
- listAllocSize = listSize + 100;
- if ((list=(HANDLE *) mir_realloc(list, listAllocSize * sizeof(HANDLE))) == NULL) {
- listSize = 0;
- break;
- } }
-
- list[listSize++] = hContact;
- }
- db_free(&dbv);
+ for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ DBVARIANT dbv;
+ if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !ListExist(LIST_ROSTER, dbv.ptszVal)) {
+ Log("Syncing roster: preparing to delete %S (hContact=0x%x)", dbv.ptszVal, hContact);
+ if (listSize >= listAllocSize) {
+ listAllocSize = listSize + 100;
+ if ((list=(HANDLE *) mir_realloc(list, listAllocSize * sizeof(HANDLE))) == NULL) {
+ listSize = 0;
+ break;
+ } }
+
+ list[listSize++] = hContact;
}
+ db_free(&dbv);
}
}
|