From f2912ed143f0add2bbe63fb17efabc048b4f0d8e Mon Sep 17 00:00:00 2001 From: sss Date: Thu, 12 Mar 2009 21:03:28 +0000 Subject: this is some kind of fix ?, hm..., i do not remember now, and too lazy for reading code sorry all ))) git-svn-id: http://172.18.13.13/svn/mim_plugs@9 63852ff1-2cfd-40b9-8011-e561a9d89b1c --- stopspam_mod/branches/0.0.1.5/stopspam.cpp | 14 +++++++++++--- stopspam_mod/branches/0.0.1.5/stopspam.rc | 8 ++++---- stopspam_mod/trunk/stopspam.cpp | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/stopspam_mod/branches/0.0.1.5/stopspam.cpp b/stopspam_mod/branches/0.0.1.5/stopspam.cpp index dc68edb..ff50864 100644 --- a/stopspam_mod/branches/0.0.1.5/stopspam.cpp +++ b/stopspam_mod/branches/0.0.1.5/stopspam.cpp @@ -4,9 +4,6 @@ extern TCHAR const * defQuestion; MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) { - if(gbDelNotInList) - if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List") - CallService(MS_DB_CONTACT_DELETE, (WPARAM)w, 0); DBWriteContactSettingByte((HANDLE)w, "CList", "NotOnList", 1); return 0; } @@ -86,9 +83,20 @@ 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(gbDelNotInList) + if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List") + { + CallService(MS_DB_CONTACT_DELETE, (WPARAM)w, 0); + return 1; + } + else if(DBGetContactSettingByte(hContact, pluginName, "Answered", 0)) return 0; else if(DBGetContactSettingByte(hContact, pluginName, "Excluded", 0)) diff --git a/stopspam_mod/branches/0.0.1.5/stopspam.rc b/stopspam_mod/branches/0.0.1.5/stopspam.rc index ce2c9f9..e7b83fe 100644 --- a/stopspam_mod/branches/0.0.1.5/stopspam.rc +++ b/stopspam_mod/branches/0.0.1.5/stopspam.rc @@ -59,10 +59,10 @@ IDD_MAIN DIALOGEX 0, 0, 309, 219 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - EDITTEXT ID_DESCRIPTION,12,7,290,70,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_TABSTOP - LTEXT "Do not send more than ",IDC_STATIC,14,80,103,12,SS_CENTERIMAGE - EDITTEXT ID_MAXQUESTCOUNT,117,80,30,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT " questions to one contact (0 - for no limit)",IDC_STATIC,147,80,155,12,SS_CENTERIMAGE + EDITTEXT ID_DESCRIPTION,12,7,290,82,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_TABSTOP + LTEXT "Do not send more than ",IDC_STATIC,11,89,87,12,SS_CENTERIMAGE + EDITTEXT ID_MAXQUESTCOUNT,107,89,30,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT " questions to one contact (0 - for no limit)",IDC_STATIC,144,89,155,12,SS_CENTERIMAGE CONTROL "Enable StopSpam-StopSpam infinite talk protection",ID_INFTALKPROT, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,122,270,10 CONTROL "Add contact permanently",ID_ADDPERMANENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,134,270,8 diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp index dc68edb..c04cc6f 100644 --- a/stopspam_mod/trunk/stopspam.cpp +++ b/stopspam_mod/trunk/stopspam.cpp @@ -4,10 +4,7 @@ extern TCHAR const * defQuestion; MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) { - if(gbDelNotInList) - if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List") - CallService(MS_DB_CONTACT_DELETE, (WPARAM)w, 0); - DBWriteContactSettingByte((HANDLE)w, "CList", "NotOnList", 1); + DBWriteContactSettingByte((HANDLE)w, "CList", "NotOnList", 1); return 0; } @@ -86,9 +83,20 @@ 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(gbDelNotInList) + if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List") + { + CallService(MS_DB_CONTACT_DELETE, (WPARAM)w, 0); + return 1; + } + else if(DBGetContactSettingByte(hContact, pluginName, "Answered", 0)) return 0; else if(DBGetContactSettingByte(hContact, pluginName, "Excluded", 0)) -- cgit v1.2.3