From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/StopSpamMod/src/globals.h | 2 +- plugins/StopSpamMod/src/init.cpp | 58 +++++++++++++++-------------- plugins/StopSpamMod/src/options.cpp | 70 +++++++++++++++++------------------ plugins/StopSpamMod/src/stdafx.h | 4 +- plugins/StopSpamMod/src/stopspam.cpp | 32 ++++++++-------- plugins/StopSpamMod/src/utilities.cpp | 6 +-- 6 files changed, 87 insertions(+), 85 deletions(-) (limited to 'plugins/StopSpamMod') diff --git a/plugins/StopSpamMod/src/globals.h b/plugins/StopSpamMod/src/globals.h index ae45848eb2..c54341325e 100755 --- a/plugins/StopSpamMod/src/globals.h +++ b/plugins/StopSpamMod/src/globals.h @@ -1,5 +1,5 @@ #pragma once -#define pluginName "StopSpam" //const char* ? +#define MODULENAME "StopSpam" //const char* ? #define PREF_TCHAR2 PREF_UTF diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 99000914c3..c49545056e 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -74,6 +74,10 @@ PLUGININFOEX pluginInfoEx = { {0x94ced94c, 0xa94a, 0x4bb1, {0xac, 0xbd, 0x5c, 0xc6, 0xeb, 0xb6, 0x89, 0xd4}} }; +CMPlugin::CMPlugin() : + PLUGIN(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; @@ -85,33 +89,33 @@ extern wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szMo void InitVars() { - gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"Spammers"); - gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam"); - gbInfTalkProtection = db_get_b(NULL, pluginName, "infTalkProtection", 0); - gbAddPermanent = db_get_b(NULL, pluginName, "addPermanent", 0); - gbMaxQuestCount = db_get_dw(NULL, pluginName, "maxQuestCount", 5); - gbHandleAuthReq = db_get_b(NULL, pluginName, "handleAuthReq", 1); - gbQuestion = DBGetContactSettingStringPAN(NULL, pluginName, "question", TranslateW(defQuestion)); - gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam"); - gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", TranslateW(defCongrats)); - gbAuthRepl = DBGetContactSettingStringPAN(NULL, pluginName, "authrepl", TranslateW(defAuthReply)); - gbSpecialGroup = db_get_b(NULL, pluginName, "SpecialGroup", 0); - gbHideContacts = db_get_b(NULL, pluginName, "HideContacts", 0); - gbIgnoreContacts = db_get_b(NULL, pluginName, "IgnoreContacts", 0); - gbExclude = db_get_b(NULL, pluginName, "ExcludeContacts", 1); - gbDelExcluded = db_get_b(NULL, pluginName, "DelExcluded", 0); - gbDelAllTempory = db_get_b(NULL, pluginName, "DelAllTempory", 0); - gbCaseInsensitive = db_get_b(NULL, pluginName, "CaseInsensitive", 0); - gbRegexMatch = db_get_b(NULL, pluginName, "RegexMatch", 0); - gbInvisDisable = db_get_b(NULL, pluginName, "DisableInInvis", 0); - gbIgnoreURL = db_get_b(NULL, pluginName, "IgnoreURL", 0); - gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"Not Spammers"); - gbAutoAuth = db_get_b(NULL, pluginName, "AutoAuth", 0); - gbAutoAddToServerList = db_get_b(NULL, pluginName, "AutoAddToServerList", 0); - gbAutoReqAuth = db_get_b(NULL, pluginName, "AutoReqAuth", 0); - gbLogToFile = db_get_b(NULL, pluginName, "LogSpamToFile", 0); - gbHistoryLog = db_get_b(NULL, pluginName, "HistoryLog", 0); - gbMathExpression = db_get_b(NULL, pluginName, "MathExpression", 0); + gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"Spammers"); + gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam"); + gbInfTalkProtection = db_get_b(NULL, MODULENAME, "infTalkProtection", 0); + gbAddPermanent = db_get_b(NULL, MODULENAME, "addPermanent", 0); + gbMaxQuestCount = db_get_dw(NULL, MODULENAME, "maxQuestCount", 5); + gbHandleAuthReq = db_get_b(NULL, MODULENAME, "handleAuthReq", 1); + gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion)); + gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam"); + gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats)); + gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply)); + gbSpecialGroup = db_get_b(NULL, MODULENAME, "SpecialGroup", 0); + gbHideContacts = db_get_b(NULL, MODULENAME, "HideContacts", 0); + gbIgnoreContacts = db_get_b(NULL, MODULENAME, "IgnoreContacts", 0); + gbExclude = db_get_b(NULL, MODULENAME, "ExcludeContacts", 1); + gbDelExcluded = db_get_b(NULL, MODULENAME, "DelExcluded", 0); + gbDelAllTempory = db_get_b(NULL, MODULENAME, "DelAllTempory", 0); + gbCaseInsensitive = db_get_b(NULL, MODULENAME, "CaseInsensitive", 0); + gbRegexMatch = db_get_b(NULL, MODULENAME, "RegexMatch", 0); + gbInvisDisable = db_get_b(NULL, MODULENAME, "DisableInInvis", 0); + gbIgnoreURL = db_get_b(NULL, MODULENAME, "IgnoreURL", 0); + gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"Not Spammers"); + gbAutoAuth = db_get_b(NULL, MODULENAME, "AutoAuth", 0); + gbAutoAddToServerList = db_get_b(NULL, MODULENAME, "AutoAddToServerList", 0); + gbAutoReqAuth = db_get_b(NULL, MODULENAME, "AutoReqAuth", 0); + gbLogToFile = db_get_b(NULL, MODULENAME, "LogSpamToFile", 0); + gbHistoryLog = db_get_b(NULL, MODULENAME, "HistoryLog", 0); + gbMathExpression = db_get_b(NULL, MODULENAME, "MathExpression", 0); } static int OnSystemModulesLoaded(WPARAM, LPARAM) diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 1ed210bdc3..9847352c76 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -47,13 +47,13 @@ public: } virtual void OnApply() override { - db_set_dw(NULL, pluginName, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt()); - db_set_b(NULL, pluginName, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState()); - db_set_b(NULL, pluginName, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState()); - db_set_b(NULL, pluginName, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState()); - db_set_b(NULL, pluginName, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState()); - db_set_b(NULL, pluginName, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState()); - db_set_b(NULL, pluginName, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState()); + db_set_dw(NULL, MODULENAME, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt()); + db_set_b(NULL, MODULENAME, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState()); + db_set_b(NULL, MODULENAME, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState()); + db_set_b(NULL, MODULENAME, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState()); + db_set_b(NULL, MODULENAME, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState()); + db_set_b(NULL, MODULENAME, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState()); + db_set_b(NULL, MODULENAME, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState()); } private: CCtrlCheck chk_INFTALKPROT, chk_ADDPERMANENT, chk_HANDLEAUTHREQ, chk_HIDECONTACTS, chk_IGNORESPAMMERS, chk_LOGSPAMTOFILE; @@ -85,14 +85,14 @@ public: } virtual void OnApply() override { - db_set_ws(NULL, pluginName, "question", edit_QUESTION.GetText()); - gbQuestion = DBGetContactSettingStringPAN(NULL, pluginName, "question", TranslateW(defQuestion)); - db_set_ws(NULL, pluginName, "answer", edit_ANSWER.GetText()); - gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam"); - db_set_ws(NULL, pluginName, "authrepl", edit_AUTHREPL.GetText()); - gbAuthRepl = DBGetContactSettingStringPAN(NULL, pluginName, "authrepl", TranslateW(defAuthReply)); - db_set_ws(NULL, pluginName, "congratulation", edit_CONGRATULATION.GetText()); - gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", TranslateW(defCongrats)); + db_set_ws(NULL, MODULENAME, "question", edit_QUESTION.GetText()); + gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion)); + db_set_ws(NULL, MODULENAME, "answer", edit_ANSWER.GetText()); + gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam"); + db_set_ws(NULL, MODULENAME, "authrepl", edit_AUTHREPL.GetText()); + gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply)); + db_set_ws(NULL, MODULENAME, "congratulation", edit_CONGRATULATION.GetText()); + gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats)); } void onClick_RESTOREDEFAULTS(CCtrlButton*) { @@ -143,7 +143,7 @@ public: out << str << "\r\n"; mir_free(str); } - db_set_s(NULL, pluginName, "protoList", out.str().c_str()); + db_set_s(NULL, MODULENAME, "protoList", out.str().c_str()); } void onClick_ADD(CCtrlButton*) { @@ -213,38 +213,38 @@ public: } virtual void OnApply() override { - db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState()); - db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState()); + db_set_b(NULL, MODULENAME, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState()); + db_set_b(NULL, MODULENAME, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState()); { static wstring NewGroupName = edit_SPECIALGROUPNAME.GetText(), CurrentGroupName; - CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"0"); + CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"0"); if (mir_wstrcmp(CurrentGroupName.c_str(), NewGroupName.c_str()) != 0) { bool GroupExist = Clist_GroupExists(NewGroupName.c_str()) != NULL; - db_set_ws(NULL, pluginName, "SpammersGroup", NewGroupName.c_str()); - gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"Spammers"); + db_set_ws(NULL, MODULENAME, "SpammersGroup", NewGroupName.c_str()); + gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"Spammers"); if (!GroupExist && gbSpecialGroup) Clist_GroupCreate(0, gbSpammersGroup.c_str()); } } - db_set_b(NULL, pluginName, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState()); - db_set_b(NULL, pluginName, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState()); - db_set_b(NULL, pluginName, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState()); - db_set_b(NULL, pluginName, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState()); - db_set_b(NULL, pluginName, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState()); + db_set_b(NULL, MODULENAME, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState()); + db_set_b(NULL, MODULENAME, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState()); + db_set_b(NULL, MODULENAME, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState()); + db_set_b(NULL, MODULENAME, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState()); + db_set_b(NULL, MODULENAME, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState()); - db_set_b(NULL, pluginName, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState()); - db_set_b(NULL, pluginName, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState()); - db_set_b(NULL, pluginName, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState()); - db_set_b(NULL, pluginName, "RegexMatch", gbRegexMatch = chk_REGEX.GetState()); - db_set_b(NULL, pluginName, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState()); - db_set_b(NULL, pluginName, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState()); + db_set_b(NULL, MODULENAME, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState()); + db_set_b(NULL, MODULENAME, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState()); + db_set_b(NULL, MODULENAME, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState()); + db_set_b(NULL, MODULENAME, "RegexMatch", gbRegexMatch = chk_REGEX.GetState()); + db_set_b(NULL, MODULENAME, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState()); + db_set_b(NULL, MODULENAME, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState()); { static wstring NewAGroupName = edit_AUTOADDGROUP.GetText(), CurrentAGroupName; - CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"0"); + CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"0"); if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) { bool GroupExist = Clist_GroupExists(NewAGroupName.c_str()) != NULL; - db_set_ws(NULL, pluginName, "AutoAuthGroup", NewAGroupName.c_str()); - gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"Not Spammers"); + db_set_ws(NULL, MODULENAME, "AutoAuthGroup", NewAGroupName.c_str()); + gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"Not Spammers"); if (!GroupExist && gbAutoAddToServerList) Clist_GroupCreate(0, gbAutoAuthGroup.c_str()); } diff --git a/plugins/StopSpamMod/src/stdafx.h b/plugins/StopSpamMod/src/stdafx.h index 1ff0aa6958..d6ccebe6dd 100755 --- a/plugins/StopSpamMod/src/stdafx.h +++ b/plugins/StopSpamMod/src/stdafx.h @@ -37,9 +37,7 @@ using namespace std; struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(pluginName) - {} + CMPlugin(); }; extern HANDLE hStopSpamLogDirH; diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 8eaea7f827..d9da28ef66 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -38,7 +38,7 @@ int OnDbEventAdded(WPARAM hContact, LPARAM hDbEvent) // if request is from unknown or not marked Answered contact int a = db_get_b(hcntct, "CList", "NotOnList", 0); - int b = !db_get_b(hcntct, pluginName, "Answered", 0); + int b = !db_get_b(hcntct, MODULENAME, "Answered", 0); if (a && b) { // ...send message @@ -84,11 +84,11 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) } //do not check excluded contact - if (db_get_b(hContact, pluginName, "Answered", 0)) + if (db_get_b(hContact, MODULENAME, "Answered", 0)) return 0; - if (db_get_b(hContact, pluginName, "Excluded", 0)) { + if (db_get_b(hContact, MODULENAME, "Excluded", 0)) { if (!db_get_b(hContact, "CList", "NotOnList", 0)) - db_unset(hContact, pluginName, "Excluded"); + db_unset(hContact, MODULENAME, "Excluded"); return 0; } //we want block not only messages, i seen many types other eventtype flood @@ -97,8 +97,8 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) return 0; //mark contact which we trying to contact for exclude from check if ((dbei->flags & DBEF_SENT) && db_get_b(hContact, "CList", "NotOnList", 0) - && (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude) { - db_set_b(hContact, pluginName, "Excluded", 1); + && (!gbMaxQuestCount || db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < gbMaxQuestCount) && gbExclude) { + db_set_b(hContact, MODULENAME, "Excluded", 1); return 0; } // if message is from known or marked Answered contact @@ -137,7 +137,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) if (gbMathExpression) { if (boost::algorithm::all(message, boost::is_digit())) { int num = _wtoi(message.c_str()); - int math_answer = db_get_dw(hContact, pluginName, "MathAnswer", 0); + int math_answer = db_get_dw(hContact, MODULENAME, "MathAnswer", 0); if (num && math_answer) answered = (num == math_answer); } @@ -162,10 +162,10 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // unhide contact db_unset(hContact, "CList", "Hidden"); - db_unset(hContact, pluginName, "MathAnswer"); + db_unset(hContact, MODULENAME, "MathAnswer"); // mark contact as Answered - db_set_b(hContact, pluginName, "Answered", 1); + db_set_b(hContact, MODULENAME, "Answered", 1); //add contact permanently if (gbAddPermanent) //do not use this ) @@ -204,7 +204,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) // and question count for this contact is less then maximum if (bSendMsg) { if ((!gbInfTalkProtection || wstring::npos == message.find(L"StopSpam automatic message:\r\n")) - && (!gbMaxQuestCount || db_get_dw(hContact, pluginName, "QuestionCount", 0) < gbMaxQuestCount)) { + && (!gbMaxQuestCount || db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < gbMaxQuestCount)) { // send question wstring q; if (gbInfTalkProtection) @@ -264,7 +264,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) else break; } - db_set_dw(hContact, pluginName, "MathAnswer", math_answer); + db_set_dw(hContact, MODULENAME, "MathAnswer", math_answer); q += variables_parse(tmp_question, hContact); } else @@ -273,8 +273,8 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) ProtoChainSend(hContact, PSS_MESSAGE, 0, ptrA(mir_utf8encodeW(q.c_str()))); // increment question count - DWORD questCount = db_get_dw(hContact, pluginName, "QuestionCount", 0); - db_set_dw(hContact, pluginName, "QuestionCount", questCount + 1); + DWORD questCount = db_get_dw(hContact, MODULENAME, "QuestionCount", 0); + db_set_dw(hContact, MODULENAME, "QuestionCount", questCount + 1); } else { if (gbIgnoreContacts) @@ -288,7 +288,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l) db_set_b(hContact, "CList", "NotOnList", 1); // save first message from contact - if (db_get_dw(hContact, pluginName, "QuestionCount", 0) < 2) { + if (db_get_dw(hContact, MODULENAME, "QuestionCount", 0) < 2) { dbei->flags |= DBEF_READ; db_event_add(hContact, dbei); }; @@ -308,8 +308,8 @@ int OnDbContactSettingChanged(WPARAM w, LPARAM l) if (strcmp(cws->szSetting, "NotOnList")) return 0; if (!cws->value.type) { - db_unset(hContact, pluginName, "Answered"); - db_unset(hContact, pluginName, "QuestionCount"); + db_unset(hContact, MODULENAME, "Answered"); + db_unset(hContact, MODULENAME, "QuestionCount"); } return 0; diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 5cd1e160a6..9b3dddc380 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -56,7 +56,7 @@ wstring &GetDlgItemString(HWND hwnd, int id) std::string &GetProtoList() { static std::string s; - return s = DBGetContactSettingStringPAN_A(NULL, pluginName, "protoList", "ICQ\r\n"); + return s = DBGetContactSettingStringPAN_A(NULL, MODULENAME, "protoList", "ICQ\r\n"); } bool ProtoInList(const char *szProto) @@ -286,7 +286,7 @@ void __cdecl CleanProtocolExclThread(void *param) std::list contacts; for (auto &hContact : Contacts(szProto)) - if (db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, pluginName, "Excluded", 0)) + if (db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, MODULENAME, "Excluded", 0)) contacts.push_back(hContact); Sleep(5000); @@ -321,7 +321,7 @@ void __cdecl CleanThread(void*) void HistoryLog(MCONTACT hContact, char *data, int event_type, int flags) { DBEVENTINFO Event = {}; - Event.szModule = pluginName; + Event.szModule = MODULENAME; Event.eventType = event_type; Event.flags = flags | DBEF_UTF; Event.timestamp = (DWORD)time(0); -- cgit v1.2.3