diff options
author | Gluzskiy Alexandr <sss123next@gmail.com> | 2010-02-15 06:41:36 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@gmail.com> | 2010-02-15 06:41:36 +0300 |
commit | 02b8498fdb1d06aa8b6f136e2914000d05f29dc2 (patch) | |
tree | 3ecb953f29318f5ba9e12fa3e2b6df1fc74e4881 /stopspam.cpp | |
parent | a5f8c514a5d7da4cd7049d2439182f51d7c1c195 (diff) |
added option for block auth requests with URL (may not work)
Diffstat (limited to 'stopspam.cpp')
-rw-r--r-- | stopspam.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/stopspam.cpp b/stopspam.cpp index a0c821b..0e20c2a 100644 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -27,7 +27,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) }
// event is an auth request
- if(gbHandleAuthReq)
+ if(gbHandleAuthReq || gbIgnoreURL)
{
if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST)
{
@@ -69,6 +69,31 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) else if(DBGetContactSettingWord(hContact,dbei.szModule,"ApparentMode",0) == ID_STATUS_OFFLINE)
msg = 0; //is it useful ?
}
+ if(gbIgnoreURL)
+ {
+ tstring message;
+ if(dbei.flags & DBEF_UTF)
+ {
+ WCHAR* msg_u;
+ char* msg_a = mir_strdup(( char* )dbei.pBlob );
+ mir_utf8decode( msg_a, &msg_u );
+#ifdef _UNICODE
+ message = msg_u;
+#else
+ message = mir_u2a(msg_u);
+#endif
+ }
+ else
+ {
+#ifdef _UNICODE
+ message = mir_a2u((char*)(dbei.pBlob));
+#else
+ message = (char*)(dbei.pBlob);
+#endif
+ }
+ if(!Stricmp(message.c_str(), _T("http:")) || !Stricmp(message.c_str(), _T("www")) || !Stricmp(message.c_str(), _T(".ru")) || !Stricmp(message.c_str(), _T(".com")) || !Stricmp(message.c_str(), _T(".de")) || !Stricmp(message.c_str(), _T(".cz")) || !Stricmp(message.c_str(), _T(".org")) || !Stricmp(message.c_str(), _T(".net")) || !Stricmp(message.c_str(), _T(".su")))
+ return 1;
+ }
if(msg)
int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str()));
|