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 --- src/core/stdfile/file.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/core/stdfile/file.cpp') diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp index a29b71bc33..048125abac 100644 --- a/src/core/stdfile/file.cpp +++ b/src/core/stdfile/file.cpp @@ -140,12 +140,11 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) { DWORD dwSignature; - DBEVENTINFO dbei = {0}; - dbei.cbSize = sizeof(dbei); + DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = sizeof(DWORD); dbei.pBlob = (PBYTE)&dwSignature; - CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei); - if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0) + db_event_get((HANDLE)lParam, &dbei); + if (dbei.flags & (DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0) return 0; PushFileEvent((HANDLE)wParam, (HANDLE)lParam, 0); @@ -288,19 +287,15 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void) { - DBEVENTINFO dbei = {0}; - HANDLE hDbEvent, hContact; - - dbei.cbSize = sizeof(dbei); - hContact = db_find_first(); + HANDLE hContact = db_find_first(); while (hContact) { - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0); + HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { - dbei.cbBlob = 0; - CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei); + DBEVENTINFO dbei = { sizeof(dbei) }; + db_event_get(hDbEvent, &dbei); if ( !(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_FILE) - CallService(MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDbEvent); - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0); + db_event_markRead(hContact, hDbEvent); + hDbEvent = db_event_next(hDbEvent); } hContact = db_find_next(hContact); } @@ -413,7 +408,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) } mir_free(szDescr); - HANDLE hdbe = (HANDLE)CallService(MS_DB_EVENT_ADD, (WPARAM)ccs->hContact, (LPARAM)&dbei); + HANDLE hdbe = db_event_add(ccs->hContact, &dbei); PushFileEvent(ccs->hContact, hdbe, pre->lParam); mir_free(dbei.pBlob); -- cgit v1.2.3