summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
commit109877a3c75cb290c55755dcfc88794d2453669d (patch)
tree3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /plugins/AutoShutdown
parentfee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (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/AutoShutdown')
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 0162ca5867..10323614d6 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -91,19 +91,20 @@ static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob)
static int MsgEventAdded(WPARAM wParam,LPARAM lParam)
{
- if(currentWatcherType&SDWTF_MESSAGE) {
- DBEVENTINFO dbe;
- dbe.cbSize=sizeof(dbe);
- dbe.cbBlob=(DWORD)CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)lParam,0);
- dbe.pBlob=(BYTE*)mir_alloc(dbe.cbBlob+2); /* ensure term zero */
- if(dbe.pBlob==NULL) return 0;
- if(!CallService(MS_DB_EVENT_GET,(WPARAM)lParam,(LPARAM)&dbe))
- if(dbe.eventType==EVENTTYPE_MESSAGE && !(dbe.flags&DBEF_SENT)) {
+ HANDLE hDbEvent = (HANDLE)lParam;
+
+ if (currentWatcherType & SDWTF_MESSAGE) {
+ DBEVENTINFO dbe = { sizeof(dbe) };
+ dbe.cbBlob = db_event_getBlobSize(hDbEvent);
+ dbe.pBlob = (BYTE*)mir_alloc(dbe.cbBlob+2); /* ensure term zero */
+ if (dbe.pBlob == NULL)
+ return 0;
+ if (!db_event_get(hDbEvent, &dbe))
+ if(dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
- TCHAR *pszMsg;
if(!DBGetContactSettingTString(NULL,"AutoShutdown","Message",&dbv)) {
TrimString(dbv.ptszVal);
- pszMsg=GetMessageText(&dbe.pBlob,&dbe.cbBlob);
+ TCHAR *pszMsg = GetMessageText(&dbe.pBlob,&dbe.cbBlob);
if(pszMsg!=NULL && _tcsstr(pszMsg,dbv.ptszVal)!=NULL)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
mir_free(dbv.ptszVal); /* does NULL check */