diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
commit | 109877a3c75cb290c55755dcfc88794d2453669d (patch) | |
tree | 3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /plugins/ContactsPlus/src | |
parent | fee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (diff) |
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
Diffstat (limited to 'plugins/ContactsPlus/src')
-rw-r--r-- | plugins/ContactsPlus/src/main.cpp | 32 | ||||
-rw-r--r-- | plugins/ContactsPlus/src/receive.cpp | 6 | ||||
-rw-r--r-- | plugins/ContactsPlus/src/send.cpp | 2 |
3 files changed, 15 insertions, 25 deletions
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 1bac904867..32534bea8f 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -61,18 +61,15 @@ static int HookDBEventAdded(WPARAM wParam, LPARAM lParam) HANDLE hContact = (HANDLE)wParam;
HANDLE hDbEvent = (HANDLE)lParam;
//process the event
- DBEVENTINFO dbe = {0};
-
- dbe.cbSize = sizeof(DBEVENTINFO);
- //get event details
- CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbe);
+ DBEVENTINFO dbe = { sizeof(dbe) };
+ db_event_get(hDbEvent, &dbe);
//check if we should process the event
if (dbe.flags & (DBEF_SENT|DBEF_READ) || dbe.eventType != EVENTTYPE_CONTACTS) return 0;
//get event contents
- dbe.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
+ dbe.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbe.cbBlob != -1)
dbe.pBlob = (PBYTE)_alloca(dbe.cbBlob);
- CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbe);
+ db_event_get(hDbEvent, &dbe);
//play received sound
SkinPlaySound("RecvContacts");
{ //add event to the contact list
@@ -97,24 +94,17 @@ static int HookDBEventAdded(WPARAM wParam, LPARAM lParam) static void ProcessUnreadEvents(void)
{
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
-
HANDLE hContact = db_find_first();
- while (hContact)
- {
- HANDLE hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
-
- while (hDbEvent)
- {
- dbei.cbBlob=0;
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CONTACTS)
- {
+ while (hContact) {
+ HANDLE hDbEvent = db_event_firstUnread(hContact);
+ while (hDbEvent) {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ db_event_get(hDbEvent, &dbei);
+ if (!(dbei.flags & (DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_CONTACTS) {
//process the event
HookDBEventAdded((WPARAM)hContact, (LPARAM)hDbEvent);
}
- hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
+ hDbEvent = db_event_next(hDbEvent);
}
hContact = db_find_next(hContact);
}
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 5e9e80c39f..7b1c876a3e 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -211,10 +211,10 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara DBEVENTINFO dbe = {0};
dbe.cbSize = sizeof(DBEVENTINFO);
- dbe.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)wndData->mhDbEvent, 0);
+ dbe.cbBlob = db_event_getBlobSize(wndData->mhDbEvent);
if (dbe.cbBlob != -1) // this marks an invalid hDbEvent - all smashed anyway...
dbe.pBlob = (PBYTE)_alloca(dbe.cbBlob);
- CallService(MS_DB_EVENT_GET, (WPARAM)wndData->mhDbEvent, (LPARAM)&dbe);
+ db_event_get(wndData->mhDbEvent, &dbe);
char* pcBlob = (char*)dbe.pBlob;
char* pcEnd = (char*)dbe.pBlob + dbe.cbBlob;
@@ -471,7 +471,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
case WM_DESTROY: // last message received by this dialog, cleanup
{
- CallService(MS_DB_EVENT_MARKREAD, (WPARAM)wndData->mhContact, (LPARAM)wndData->mhDbEvent);
+ db_event_markRead(wndData->mhContact, wndData->mhDbEvent);
Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "");
ImageList_Destroy(wndData->mhListIcon);
UnhookEvent(wndData->hHook);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 40bd74c993..03d9356062 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -476,7 +476,7 @@ INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar strcpy(pBlob, maSend[i].mcaUIN);
pBlob += strlennull(pBlob) + 1;
}
- CallService(MS_DB_EVENT_ADD, (WPARAM)ackData->hContact,(LPARAM)&dbei);
+ db_event_add(ackData->hContact, &dbei);
gaAckData.Remove(ack->hProcess); // do not release here, still needed
wndData->uacklist.Remove(ack->hProcess); // packet confirmed
for (i=0; i<ackData->nContacts; i++)
|