From fe1b15a7521f8cc1e551f23e1d5932645112c767 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 2 Apr 2010 20:22:09 +0300 Subject: hm.... --- stopspam.cpp | 54 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'stopspam.cpp') diff --git a/stopspam.cpp b/stopspam.cpp index 0e20c2a..a15e604 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 || gbIgnoreURL) + if(gbHandleAuthReq) { if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) { @@ -69,31 +69,6 @@ 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())); @@ -150,6 +125,33 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) if(dbei->flags & DBEF_READ) // ...let the event go its way return 0; + if(dbei->eventType == EVENTTYPE_AUTHREQUEST && 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; + } + } //mark contact which we trying to contact for exclude from check if((dbei->flags & DBEF_SENT) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude) -- cgit v1.2.3