From 77a5832f098cb1267405d7336543831462f56ab7 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 2 Apr 2010 22:27:35 +0300 Subject: modified: stopspam.cpp modified: stopspam.rc modified: stopspam_9.vcproj --- stopspam.cpp | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) (limited to 'stopspam.cpp') diff --git a/stopspam.cpp b/stopspam.cpp index a15e604..07b3c3f 100644 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -53,8 +53,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) { // ...send message /*MessageBox( 0, "...send message", "yappp...",MB_OK|MB_ICONQUESTION );*/ - std::string allowService = dbei.szModule; - allowService += PS_AUTHDENY; +// std::string allowService = dbei.szModule; +// allowService += PS_AUTHDENY; if(gbHideContacts) DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1); @@ -67,12 +67,12 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) if(CallProtoService(dbei.szModule, PS_GETSTATUS, 0, 0) == ID_STATUS_INVISIBLE) msg = 0; else if(DBGetContactSettingWord(hContact,dbei.szModule,"ApparentMode",0) == ID_STATUS_OFFLINE) - msg = 0; //is it useful ? + msg = 0; //is it useful ? } if(msg) - int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str())); + // int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str())); + int a = CallContactService(hcntct, PSS_MESSAGE, PREF_UTF, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str())); - //CallProtoService(dbei.szModule,PS_AUTHDENY,(WPARAM)hDbEvent,(LPARAM)GetAuthRepl().c_str()); delete dbei.pBlob; return 1; } @@ -125,33 +125,6 @@ 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) @@ -200,8 +173,10 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) else if(DBGetContactSettingWord(hContact,dbei->szModule,"ApparentMode",0) == ID_STATUS_OFFLINE) msg = 0; //is it useful ? } - - if(gbCaseInsensitive?(!Stricmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))):( !_tcscmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str())))) + if(gbIgnoreURL) + 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"))) + ; + else if(gbCaseInsensitive?(!Stricmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))):( !_tcscmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str())))) { // unhide contact DBDeleteContactSetting(hContact, "CList", "Hidden"); -- cgit v1.2.3