summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-04-02 22:27:35 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-04-02 22:27:35 +0300
commit77a5832f098cb1267405d7336543831462f56ab7 (patch)
tree94d39176b208563cdae5723addf95bbf11b00af3
parentfe1b15a7521f8cc1e551f23e1d5932645112c767 (diff)
modified: stopspam.cpp
modified: stopspam.rc modified: stopspam_9.vcproj
-rw-r--r--stopspam.cpp43
-rw-r--r--stopspam.rc3
-rw-r--r--stopspam_9.vcproj2
3 files changed, 11 insertions, 37 deletions
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");
diff --git a/stopspam.rc b/stopspam.rc
index b7e77a5..68bd5ee 100644
--- a/stopspam.rc
+++ b/stopspam.rc
@@ -91,8 +91,7 @@ BEGIN
CONTROL "Add contacts to specified group:",ID_SPECIALGROUP,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,16,196,10
EDITTEXT ID_SPECIALGROUPNAME,217,15,79,12,ES_AUTOHSCROLL
- CONTROL "Ignore Authorization requests with URL",ID_IGNOREURL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,88,287,10
+ CONTROL "Ignore URL in messages",ID_IGNOREURL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,88,287,10
END
diff --git a/stopspam_9.vcproj b/stopspam_9.vcproj
index 5d81d03..219a8f3 100644
--- a/stopspam_9.vcproj
+++ b/stopspam_9.vcproj
@@ -302,7 +302,7 @@
Optimization="3"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="..\..\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STOPSPAM_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1"