summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stopspam_mod/trunk/stopspam.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp
index ad223ae..596e986 100644
--- a/stopspam_mod/trunk/stopspam.cpp
+++ b/stopspam_mod/trunk/stopspam.cpp
@@ -61,9 +61,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
if(gbSpecialGroup)
DBWriteContactSettingTString(hcntct, "CList", "Group", gbSpammersGroup.c_str());
- if(!gbInvisDisable || (gbInvisDisable &&
- ((DBGetContactSettingWord(hContact,dbei.szModule,"ApparentMode",0) != ID_STATUS_OFFLINE) ||
- (CallProtoService(dbei.szModule, PS_GETSTATUS, 0, 0) != ID_STATUS_INVISIBLE))))
+ if(!gbInvisDisable || ((gbInvisDisable && (DBGetContactSettingWord(hContact,dbei.szModule,"ApparentMode",0) != ID_STATUS_OFFLINE)) ||
+ (gbInvisDisable && (CallProtoService(dbei.szModule, PS_GETSTATUS, 0, 0) != ID_STATUS_INVISIBLE))))
int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str()));
//CallProtoService(dbei.szModule,PS_AUTHDENY,(WPARAM)hDbEvent,(LPARAM)GetAuthRepl().c_str());
@@ -158,7 +157,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// if message contains right answer...
// if( tstring::npos!=message.find(gbAnswer) )
- if(gbCaseInsensitive?(stricmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))):( _tcscmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))))
+ int Answered = 0;
+ 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");
@@ -185,32 +185,31 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
// if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
- if( (!gbInfTalkProtection || tstring::npos==message.find(_T("StopSpam automatic message:\r\n")))
- && (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) &&
- (!gbInvisDisable || (gbInvisDisable && ((DBGetContactSettingWord(hContact,dbei->szModule,"ApparentMode",0) != ID_STATUS_OFFLINE) ||
- (CallProtoService(dbei->szModule, PS_GETSTATUS, 0, 0) != ID_STATUS_INVISIBLE))))) //мегажесть ), да да, я знаю, так не кодят...
+ if((!gbInfTalkProtection || tstring::npos==message.find(_T("StopSpam automatic message:\r\n")))
+ && (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount))
{
- // send question
- tstring q = _T("StopSpam automatic message:\r\n") + variables_parse(gbQuestion, hContact);
+ if(!gbInvisDisable || ((gbInvisDisable && (DBGetContactSettingWord(hContact,dbei->szModule,"ApparentMode",0) != ID_STATUS_OFFLINE)) ||
+ (gbInvisDisable && (CallProtoService(dbei->szModule, PS_GETSTATUS, 0, 0) != ID_STATUS_INVISIBLE))))
+ {
+ // send question
+ tstring q = _T("StopSpam automatic message:\r\n") + variables_parse(gbQuestion, hContact);
#ifdef _UNICODE
- char * buf=mir_utf8encodeW(q.c_str());
- CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf);
- mir_free(buf);
+ char * buf=mir_utf8encodeW(q.c_str());
+ CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf);
+ mir_free(buf);
#else
- CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)q.c_str());
+ CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)q.c_str());
#endif
- // increment question count
- DWORD questCount = DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0);
- DBWriteContactSettingDword(hContact, pluginName, "QuestionCount", questCount + 1);
-
+ // increment question count
+ DWORD questCount = DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0);
+ DBWriteContactSettingDword(hContact, pluginName, "QuestionCount", questCount + 1);
+ }
}
else
{
- if (gbDosServiceExist && (!gbInvisDisable || (gbInvisDisable &&
- ((DBGetContactSettingWord(hContact,dbei->szModule,"ApparentMode",0) != ID_STATUS_OFFLINE) ||
- (CallProtoService(dbei->szModule, PS_GETSTATUS, 0, 0) != ID_STATUS_INVISIBLE)))))
+ if (gbDosServiceExist)
{
if(gbDosServiceIntegration)
{