summaryrefslogtreecommitdiff
path: root/stopspam_mod/trunk/stopspam.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stopspam_mod/trunk/stopspam.cpp')
-rw-r--r--stopspam_mod/trunk/stopspam.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp
index 9bcfd08..326d0ca 100644
--- a/stopspam_mod/trunk/stopspam.cpp
+++ b/stopspam_mod/trunk/stopspam.cpp
@@ -2,11 +2,11 @@
extern TCHAR const * defQuestion;
-MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l)
+/*MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l)
{
DBWriteContactSettingByte((HANDLE)w, "CList", "NotOnList", 1);
return 0;
-}
+}*/
MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
{
@@ -22,13 +22,6 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
dbei.pBlob = new BYTE[dbei.cbBlob];
CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei);
- if(DBGetContactSettingWord(hContact, dbei.szModule, "ServerId", 0))
- {
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
- delete dbei.pBlob;
- return 0;
- }
-
// if event is in protocol that is not despammed
if(!ProtoInList(dbei.szModule)) {
delete dbei.pBlob;
@@ -91,12 +84,19 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// if event is in protocol that is not despammed
if(!ProtoInList(dbei->szModule))
{
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ // DBDeleteContactSetting(hContact, "CList", "NotOnList");
// ...let the event go its way
return 0;
}
//do not check excluded contact
+ if(DBGetContactSettingWord(hContact, dbei->szModule, "ServerId", 0))
+ {
+ DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ return 0;
+ }
+
+
if(gbDelNotInList)
if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List")
{
@@ -113,13 +113,13 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
return 0;
}
// if event is not a message, or if the message has been read or sent...
-/* else if(dbei->flags & DBEF_READ || dbei->eventType != EVENTTYPE_MESSAGE)
+ else if(dbei->flags & DBEF_READ || dbei->eventType != EVENTTYPE_MESSAGE || dbei->eventType != EVENTTYPE_FILE || dbei->eventType != EVENTTYPE_URL || dbei->eventType != EVENTTYPE_CONTACTS)
// ...let the event go its way
- return 0; */
- //we want block not only messages, i seen many types other eventtype flood
+ return 0;
+/* //we want block not only messages, i seen many types other eventtype flood
else if(dbei->flags & DBEF_READ)
// ...let the event go its way
- return 0;
+ return 0;*/
//mark contact which we trying to contact for exclude from check
else if((dbei->flags & DBEF_SENT) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)
&& (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude)
@@ -229,8 +229,11 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
// save message from contact
- dbei->flags |= DBEF_READ;
- CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)dbei);
+ if(!gbIgnoreContacts)
+ {
+ dbei->flags |= DBEF_READ;
+ CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)dbei);
+ }
// reject processing of the event
return 1;