diff options
Diffstat (limited to 'plugins/StopSpamPlus/src/events.cpp')
-rw-r--r-- | plugins/StopSpamPlus/src/events.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 48aa3269e4..75694b5090 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -27,8 +27,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) // if request is from unknown or not marked Answered contact
//and if I don't sent message to this contact
- if(DBGetContactSettingByte(hcntct, "CList", "NotOnList", 0) &&
- !DBGetContactSettingByte(hcntct, pluginName, answeredSetting, 0) &&
+ if(db_get_b(hcntct, "CList", "NotOnList", 0) &&
+ !db_get_b(hcntct, pluginName, answeredSetting, 0) &&
!IsExistMyMessage(hcntct))
{
if (!plSets->HandleAuthReq.Get())
@@ -50,8 +50,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) mir_free(AuthRepl);
- DBWriteContactSettingByte(hcntct, "CList", "NotOnList", 1);
- DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1);
+ db_set_b(hcntct, "CList", "NotOnList", 1);
+ db_set_b(hcntct, "CList", "Hidden", 1);
if (!plSets->HistLog.Get())
db_event_delete(0, hDbEvent);
delete [] dbei.pBlob;
@@ -81,13 +81,13 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) return 0;
// if message is from known or marked Answered contact
- if(DBGetContactSettingByte(hContact, pluginName, answeredSetting, 0))
+ if(db_get_b(hContact, pluginName, answeredSetting, 0))
// ...let the event go its way
return 0;
// checking if message from self-added contact
//Contact in Not in list icq group
- if (!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
+ if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
return 0;
//if I sent message to this contact
@@ -135,14 +135,14 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) )
{
// unhide contact
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
// mark contact as Answered
- DBWriteContactSettingByte(hContact, pluginName, answeredSetting, 1);
+ db_set_b(hContact, pluginName, answeredSetting, 1);
//add contact permanently
if(plSets->AddPermanent.Get())
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
// send congratulation
@@ -160,7 +160,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
if ( (!plSets->InfTalkProtection.Get() || tstring::npos==message.find(infTalkProtPrefix))
- && (!plSets->MaxQuestCount.Get() || DBGetContactSettingDword(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get()))
+ && (!plSets->MaxQuestCount.Get() || db_get_dw(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get()))
{
// send question
tstring q = infTalkProtPrefix + variables_parse((tstring)(plSets->Question), hContact);
@@ -172,13 +172,13 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // increment question count
- DWORD questCount = DBGetContactSettingDword(hContact, pluginName, questCountSetting, 0);
- DBWriteContactSettingDword(hContact, pluginName, questCountSetting, questCount + 1);
+ DWORD questCount = db_get_dw(hContact, pluginName, questCountSetting, 0);
+ db_set_dw(hContact, pluginName, questCountSetting, questCount + 1);
// hide contact from contact list
}
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
// save message from contact
dbei->flags |= DBEF_READ;
@@ -227,8 +227,8 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l) return 0;
if (!cws->value.type)
{
- DBDeleteContactSetting(hContact, pluginName, answeredSetting);
- DBDeleteContactSetting(hContact, pluginName, questCountSetting);
+ db_unset(hContact, pluginName, answeredSetting);
+ db_unset(hContact, pluginName, questCountSetting);
}
return 0;
|