diff options
author | sss <sss@63852ff1-2cfd-40b9-8011-e561a9d89b1c> | 2009-03-15 00:01:19 +0000 |
---|---|---|
committer | sss <sss@63852ff1-2cfd-40b9-8011-e561a9d89b1c> | 2009-03-15 00:01:19 +0000 |
commit | 8bf6e5947ede1c48bf31e241d23ffd6fc728b683 (patch) | |
tree | e7f6faae345dcb533fab71647f0cbc61ca57d8c6 | |
parent | 4469fe9e91fcc22314cd1ccd30faf557690f7657 (diff) |
optimization, possible crash fixed
git-svn-id: http://172.18.13.13/svn/mim_plugs@12 63852ff1-2cfd-40b9-8011-e561a9d89b1c
-rw-r--r-- | stopspam_mod/trunk/stopspam.cpp | 35 |
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;
|