From 109877a3c75cb290c55755dcfc88794d2453669d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Mar 2013 17:32:39 +0000 Subject: MS_DB_EVENT_* services remained, but their calls removed git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_archive.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'protocols/JabberG/src/jabber_archive.cpp') diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 74aaa227b8..5cfb124a34 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -107,15 +107,13 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) { HANDLE hExistingDbEvent; DWORD dwEventTimeStamp; - DBEVENTINFO dbeiExisting; // get last event - if (!(hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0))) + if (!(hExistingDbEvent = db_event_last(hContact))) return FALSE; - ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); - dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting); + DBEVENTINFO dbeiExisting = { sizeof(dbeiExisting) }; + db_event_get(hExistingDbEvent, &dbeiExisting); dwEventTimeStamp = dbeiExisting.timestamp; // compare with last timestamp @@ -133,12 +131,12 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) dwPreviousTimeStamp = dwEventTimeStamp; // get first event - if (!(hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRST, (WPARAM)hContact, 0))) + if (!(hExistingDbEvent = db_event_first(hContact))) return FALSE; ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting); + db_event_get(hExistingDbEvent, &dbeiExisting); dwEventTimeStamp = dbeiExisting.timestamp; // compare with first timestamp @@ -156,7 +154,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) if (dbei.timestamp == dwPreviousTimeStamp) { ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hPreviousDbEvent, (LPARAM)&dbeiExisting); + db_event_get(hPreviousDbEvent, &dbeiExisting); if ((dbei.timestamp == dbeiExisting.timestamp) && (dbei.eventType == dbeiExisting.eventType) && @@ -165,11 +163,11 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) return TRUE; // find event with another timestamp - hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hPreviousDbEvent, 0); + hExistingDbEvent = db_event_next(hPreviousDbEvent); while (hExistingDbEvent != NULL) { ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting); + db_event_get(hExistingDbEvent, &dbeiExisting); if (dbeiExisting.timestamp != dwPreviousTimeStamp) { // use found event @@ -179,7 +177,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) } hPreviousDbEvent = hExistingDbEvent; - hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hExistingDbEvent, 0); + hExistingDbEvent = db_event_next(hExistingDbEvent); } } @@ -190,7 +188,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) while (hExistingDbEvent != NULL) { ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting); + db_event_get(hExistingDbEvent, &dbeiExisting); if (dbei.timestamp > dbeiExisting.timestamp) { // remember event @@ -212,7 +210,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) } // Get previous event in chain - hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hExistingDbEvent, 0); + hExistingDbEvent = db_event_prev(hExistingDbEvent); } } else { @@ -220,7 +218,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) while (hExistingDbEvent != NULL) { ZeroMemory(&dbeiExisting, sizeof(dbeiExisting)); dbeiExisting.cbSize = sizeof(dbeiExisting); - CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting); + db_event_get(hExistingDbEvent, &dbeiExisting); if (dbei.timestamp < dbeiExisting.timestamp) { // remember event @@ -242,7 +240,7 @@ BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO& dbei) } // Get next event in chain - hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hExistingDbEvent, 0); + hExistingDbEvent = db_event_next(hExistingDbEvent); } } // reset last event @@ -304,6 +302,6 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode) dbei.pBlob = (PBYTE)(char*)szEventText; dbei.timestamp = tmStart + _ttol(tszSecs) - timezone; if ( !IsDuplicateEvent(hContact, dbei)) - CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei); + db_event_add(hContact, &dbei); } } -- cgit v1.2.3