From 4d4bd94c0e34e2eaedc9d12926f14ccde8e0b69c Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 30 Sep 2009 21:35:51 +0300 Subject: variables support for stopspam (ported from stopspam from koshechka) --- stopspam_mod/trunk/stopspam.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'stopspam_mod/trunk/stopspam.cpp') diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp index e162837..005d67c 100644 --- a/stopspam_mod/trunk/stopspam.cpp +++ b/stopspam_mod/trunk/stopspam.cpp @@ -61,7 +61,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) if(gbSpecialGroup) DBWriteContactSettingTString(hcntct, "CList", "Group", gbSpammersGroup.c_str()); - int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)gbAuthRepl.c_str()); + 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()); delete dbei.pBlob; @@ -155,7 +155,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // if message contains right answer... // if( tstring::npos!=message.find(gbAnswer) ) - if(!wcscmp(message.c_str(), gbAnswer.c_str())) + if(!wcscmp(message.c_str(), (variables_parse(gbAnswer, hContact).c_str()))) { // unhide contact DBDeleteContactSetting(hContact, "CList", "Hidden"); @@ -169,7 +169,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // send congratulation #ifdef _UNICODE - char * buf=mir_utf8encodeW(gbCongratulation.c_str()); + char * buf=mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str()); CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf); mir_free(buf); #else @@ -186,7 +186,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) && (!gbMaxQuestCount || DBGetContactSettingDword(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) ) { // send question - tstring q = _T("StopSpam automatic message:\r\n") + gbQuestion; + tstring q = _T("StopSpam automatic message:\r\n") + variables_parse(gbQuestion, hContact); #ifdef _UNICODE char * buf=mir_utf8encodeW(q.c_str()); -- cgit v1.2.3