From a991e99b78a5f3c1fbd42e9b6cc4bfc7b30e83b6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 16 Nov 2017 22:26:08 +0300 Subject: TranslateT for global data is a very bad idea --- plugins/StopSpamPlus/src/events.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/StopSpamPlus/src/events.cpp') diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 2810d8d68d..6b5c95a53c 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -132,11 +132,12 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // if message message does not contain infintite talk protection prefix // and question count for this contact is less then maximum - if ((!plSets->InfTalkProtection.Get() || tstring::npos == message.find(infTalkProtPrefix)) + const wchar_t *pwszPrefix = TranslateT("StopSpam automatic message:\r\n"); + if ((!plSets->InfTalkProtection.Get() || tstring::npos == message.find(pwszPrefix)) && (!plSets->MaxQuestCount.Get() || db_get_dw(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get())) { // send question - tstring q = infTalkProtPrefix + variables_parse((tstring)(plSets->Question), hContact); + tstring q = pwszPrefix + variables_parse((tstring)(plSets->Question), hContact); char * buf = mir_utf8encodeW(q.c_str()); -- cgit v1.2.3