summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify/src/popup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewEventNotify/src/popup.cpp')
-rw-r--r--plugins/NewEventNotify/src/popup.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 2da7db7fdd..3dd32db00d 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -109,7 +109,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata)
pdata->iLock = 1;
while (eventData) {
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)pdata->hContact, (LPARAM)eventData->hEvent);
- CallService(MS_DB_EVENT_MARKREAD, (WPARAM)pdata->hContact, (LPARAM)eventData->hEvent);
+ db_event_markRead(pdata->hContact, eventData->hEvent);
eventData = eventData->next;
}
FreePopupEventData(pdata);
@@ -438,17 +438,15 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, HANDLE hContact, HANDLE hEvent, UIN
}
//get DBEVENTINFO with pBlob if preview is needed (when is test then is off)
- DBEVENTINFO dbe = {0};
- dbe.cbSize = sizeof(dbe);
-
- if ((pluginOptions->bPreview || eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST) && hEvent) {
- dbe.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hEvent, 0);
- dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob);
+ DBEVENTINFO dbe = { sizeof(dbe) };
+ if (hEvent) {
+ if ((pluginOptions->bPreview || eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST)) {
+ dbe.cbBlob = db_event_getBlobSize(hEvent);
+ dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob);
+ }
+ db_event_get(hEvent, &dbe);
}
- if (hEvent)
- CallService(MS_DB_EVENT_GET, (WPARAM)hEvent, (LPARAM)&dbe);
-
eventData = (EVENT_DATA_EX*)mir_alloc(sizeof(EVENT_DATA_EX));
eventData->hEvent = hEvent;
eventData->number = 1;
@@ -560,12 +558,12 @@ int PopupUpdate(HANDLE hContact, HANDLE hEvent)
dbe.pBlob = NULL;
dbe.cbBlob = 0;
if (pdata->pluginOptions->bPreview && eventData->hEvent) {
- dbe.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)eventData->hEvent, 0);
+ dbe.cbBlob = db_event_getBlobSize(eventData->hEvent);
dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob);
}
if (eventData->hEvent)
- CallService(MS_DB_EVENT_GET, (WPARAM)eventData->hEvent, (LPARAM)&dbe);
+ db_event_get(eventData->hEvent, &dbe);
if (pdata->pluginOptions->bShowDate || pdata->pluginOptions->bShowTime) {
TCHAR timestamp[MAX_DATASIZE];