summaryrefslogtreecommitdiff
path: root/stopspam.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stopspam.cpp')
-rw-r--r--stopspam.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/stopspam.cpp b/stopspam.cpp
index 07aee1e..e0ee3f6 100644
--- a/stopspam.cpp
+++ b/stopspam.cpp
@@ -49,13 +49,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
DBWriteContactSettingTString(hcntct, "CList", "Group", gbSpammersGroup.c_str());
BYTE msg = 1;
if(gbIgnoreURL){
- TCHAR* EventText = ReqGetText(&dbei); //work only UTF, else return NULL
- if(EventText&&_tcslen(EventText) > 0)
- if(Stristr(EventText, _T("http")) || Stristr(EventText, _T("www")) || Stristr(EventText, _T(".ru")) || Stristr(EventText, _T(".com")) || Stristr(EventText, _T(".de")) || Stristr(EventText, _T(".cz")) || Stristr(EventText, _T(".org")) || Stristr(EventText, _T(".net")) || Stristr(EventText, _T(".su")))
- {
- mir_free(EventText);
- msg=0;
- };
+ TCHAR* EventText = ReqGetText(&dbei); //else return NULL
+ msg=!IsUrlContains(EventText);
mir_free(EventText);
};
if(gbInvisDisable)
@@ -202,13 +197,11 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
}
return 0;
}
-
- if(gbIgnoreURL)
- if((message.find_first_of(_T("http"),0) != std::string::npos) || (message.find_first_of(_T("www"),0) != std::string::npos) || (message.find_first_of(_T(".ru"),0) != std::string::npos) || (message.find_first_of(_T(".com"),0) != std::string::npos) || (message.find_first_of(_T(".de"),0) != std::string::npos) || (message.find_first_of(_T(".cz"),0) != std::string::npos) || (message.find_first_of(_T(".org"),0) != std::string::npos) || (message.find_first_of(_T(".net"),0) != std::string::npos) || (message.find_first_of(_T(".su"),0) != std::string::npos))
- ;
+ // URL contains check
+ msg=(msg&&gbIgnoreURL)?(!IsUrlContains((TCHAR *) message.c_str())):msg;
// if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
- else if(msg)
+ if(msg)
{
if((!gbInfTalkProtection || tstring::npos==message.find(_T("StopSpam automatic message:\r\n")))
&& (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount))