summaryrefslogtreecommitdiff
path: root/plugins/StopSpamPlus
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/StopSpamPlus
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/StopSpamPlus')
-rw-r--r--plugins/StopSpamPlus/src/events.cpp8
-rw-r--r--plugins/StopSpamPlus/src/services.cpp8
-rw-r--r--plugins/StopSpamPlus/src/utils.cpp11
3 files changed, 13 insertions, 14 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp
index 9499793ea4..48aa3269e4 100644
--- a/plugins/StopSpamPlus/src/events.cpp
+++ b/plugins/StopSpamPlus/src/events.cpp
@@ -6,12 +6,12 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0);
+ dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (-1 == dbei.cbBlob)
return 0;
dbei.pBlob = new BYTE[dbei.cbBlob];
- CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei);
+ db_event_get(hDbEvent, &dbei);
// if event is in protocol that is not despammed
if(plSets->ProtoDisabled(dbei.szModule)) {
@@ -53,7 +53,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
DBWriteContactSettingByte(hcntct, "CList", "NotOnList", 1);
DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1);
if (!plSets->HistLog.Get())
- CallService(MS_DB_EVENT_DELETE, 0, (LPARAM)hDbEvent);
+ db_event_delete(0, hDbEvent);
delete [] dbei.pBlob;
return 1;
}
@@ -182,7 +182,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// save message from contact
dbei->flags |= DBEF_READ;
- CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)dbei);
+ db_event_add(hContact, dbei);
// reject processing of the event
return 1;
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index 534fbc9a40..905a87ee89 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -3,18 +3,18 @@
INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
{
HANDLE hContact = ( HANDLE )wParam;
- std::string proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
+ std::string proto = GetContactProto(hContact);
if ( !plSets->ProtoDisabled( proto.c_str()))
return CS_PASSED;
- if ( DBGetContactSettingByte( hContact, pluginName, answeredSetting, 0 ))
+ if ( DBGetContactSettingByte(hContact, pluginName, answeredSetting, 0))
return CS_PASSED;
- if ( !DBGetContactSettingByte( hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1 )
+ if ( !DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1)
return CS_PASSED;
- if ( IsExistMyMessage( hContact ))
+ if ( IsExistMyMessage(hContact))
return CS_PASSED;
return CS_NOTPASSED;
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp
index b069e6dd21..b1329ccd0c 100644
--- a/plugins/StopSpamPlus/src/utils.cpp
+++ b/plugins/StopSpamPlus/src/utils.cpp
@@ -14,20 +14,19 @@ tstring &GetDlgItemString(HWND hwnd, int id)
bool IsExistMyMessage(HANDLE hContact)
{
- DBEVENTINFO dbei = { 0 };
- HANDLE hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRST, (WPARAM)hContact, 0);
+ HANDLE hDbEvent = db_event_first(hContact);
while(hDbEvent){
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if (db_event_get(hDbEvent, &dbei))
+ break;
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei)) break;
if(dbei.flags & DBEF_SENT){
// mark contact as Answered
DBWriteContactSettingByte(hContact, pluginName, answeredSetting, 1);
// ...let the event go its way
return true;
}
- hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0);
+ hDbEvent = db_event_next(hDbEvent);
}
return false;
}