diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-27 15:41:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-27 15:41:33 +0300 |
commit | a12898911c304805ffc26b6dcf4583b3ac65a036 (patch) | |
tree | 3243819ad51aa1f4da0e23dccd8e8e9ea03bca48 /plugins/StopSpamPlus/src | |
parent | fc03dc9109a6a38dee7c526d757246ef942e9e32 (diff) |
fix for occasional crash in StopSpam
Diffstat (limited to 'plugins/StopSpamPlus/src')
-rw-r--r-- | plugins/StopSpamPlus/src/events.cpp | 6 | ||||
-rw-r--r-- | plugins/StopSpamPlus/src/options.cpp | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index b56e108d9b..e5875f9407 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -28,15 +28,13 @@ int OnDbEventAdded(WPARAM, LPARAM lParam) //and if I don't sent message to this contact
if (db_get_b(hcntct, "CList", "NotOnList", 0) && !db_get_b(hcntct, MODULENAME, answeredSetting, 0) && !IsExistMyMessage(hcntct)) {
if (!g_sets.HandleAuthReq) {
- char *buf = mir_utf8encodeW(variables_parse(g_sets.AuthRepl, hcntct).c_str());
+ char *buf = mir_utf8encodeW(variables_parse(g_sets.getReply(), hcntct).c_str());
ProtoChainSend(hcntct, PSS_MESSAGE, 0, (LPARAM)buf);
mir_free(buf);
}
// ...send message
- char *AuthRepl = mir_u2a(variables_parse(g_sets.AuthRepl, hcntct).c_str());
- CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)AuthRepl);
- mir_free(AuthRepl);
+ CallProtoService(dbei.szModule, PS_AUTHDENY, hDbEvent, (LPARAM)_T2A(variables_parse(g_sets.getReply(), hcntct).c_str()));
db_set_b(hcntct, "CList", "NotOnList", 1);
db_set_b(hcntct, "CList", "Hidden", 1);
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 2bdc37c4b7..15a05898fb 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -82,14 +82,14 @@ public: void onRestore(CCtrlButton*)
{
- g_plugin.delSetting(g_sets.Answer.GetDBSettingName());
+ g_plugin.delSetting(g_sets.AuthRepl.GetDBSettingName());
g_plugin.delSetting(g_sets.Question.GetDBSettingName());
g_plugin.delSetting(g_sets.Congratulation.GetDBSettingName());
edtQuestion.SetText(g_sets.getQuestion());
- edtAnswer.SetText(g_sets.Answer);
+ edtAnswer.SetText(g_sets.Answer.Default());
edtCongrat.SetText(g_sets.getCongrats());
- edtReply.SetText(g_sets.AuthRepl.Default());
+ edtReply.SetText(g_sets.getReply());
edtDivider.SetText(g_sets.AnswSplitString.Default());
NotifyChange();
|