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.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp
index 326d0ca..bfee2f5 100644
--- a/stopspam_mod/trunk/stopspam.cpp
+++ b/stopspam_mod/trunk/stopspam.cpp
@@ -1,12 +1,10 @@
#include "headers.h"
-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)
{
@@ -47,7 +45,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
// if request is from unknown or not marked Answered contact
-
+
int a = DBGetContactSettingByte(hcntct, "CList", "NotOnList", 0);
int b = !DBGetContactSettingByte(hcntct, pluginName, "Answered", 0);
@@ -84,19 +82,17 @@ 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");
// ...let the event go its way
return 0;
}
//do not check excluded contact
- if(DBGetContactSettingWord(hContact, dbei->szModule, "ServerId", 0))
+/* 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")
{
@@ -104,35 +100,35 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
return 1;
}
- else if(DBGetContactSettingByte(hContact, pluginName, "Answered", 0))
+ if(DBGetContactSettingByte(hContact, pluginName, "Answered", 0))
return 0;
- else if(DBGetContactSettingByte(hContact, pluginName, "Excluded", 0))
+ if(DBGetContactSettingByte(hContact, pluginName, "Excluded", 0))
{
if(!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
DBDeleteContactSetting(hContact, pluginName, "Excluded");
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 || dbei->eventType != EVENTTYPE_FILE || dbei->eventType != EVENTTYPE_URL || dbei->eventType != EVENTTYPE_CONTACTS)
+/* 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
- else if(dbei->flags & DBEF_READ)
+ return 0; */
+ //we want block not only messages, i seen many types other eventtype flood
+ 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)
+ if((dbei->flags & DBEF_SENT) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)
&& (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude)
{
DBWriteContactSettingByte(hContact, pluginName, "Excluded", 1);
return 0;
}
// if message is from known or marked Answered contact
- else if(!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if(!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
// ...let the event go its way
return 0;
// if message is corrupted or empty it cannot be an answer.
- else if(!dbei->cbBlob || !dbei->pBlob)
+ if(!dbei->cbBlob || !dbei->pBlob)
// reject processing of the event
return 1;
@@ -219,7 +215,6 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
if(gbIgnoreContacts)
{
DBWriteContactSettingDword(hContact, "Ignore", "Mask1", 0x0000007F);
- return 1;
}
}
if(gbHideContacts)
@@ -246,7 +241,7 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l)
DBCONTACTWRITESETTING * cws = (DBCONTACTWRITESETTING*)l;
// if CList/NotOnList is being deleted then remove answeredSetting
- if(strcmp(cws->szModule, "CList"))
+ if(strcmp(cws->szModule, pluginName))
return 0;
if(strcmp(cws->szSetting, "NotOnList"))
return 0;