diff options
author | George Hazan <ghazan@miranda.im> | 2017-11-16 21:58:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-11-16 21:58:06 +0300 |
commit | 52592007b35811a902ead1d9999a558880178e10 (patch) | |
tree | 7e0e9e72a2d4f0244efbe524479170bb00d33875 /plugins/StopSpamPlus/src/options.cpp | |
parent | 67aa28cc9441ad4aca94a1ecbfe97f5b497061b2 (diff) |
fixes #1034 (StopSpam: wrong codepage)
Diffstat (limited to 'plugins/StopSpamPlus/src/options.cpp')
-rw-r--r-- | plugins/StopSpamPlus/src/options.cpp | 123 |
1 files changed, 53 insertions, 70 deletions
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 2fcf6eeb47..5f70f6a8d6 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -1,17 +1,14 @@ #include "stdafx.h"
-wchar_t * pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
-wchar_t const * infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
-char const * answeredSetting = "Answered";
-char const * questCountSetting = "QuestionCount";
+wchar_t *pluginDescription = TranslateT("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
+wchar_t const *infTalkProtPrefix = TranslateT("StopSpam automatic message:\r\n");
+char const *answeredSetting = "Answered";
+char const *questCountSetting = "QuestionCount";
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
-
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
- {
SetDlgItemText(hwnd, ID_DESCRIPTION, pluginDescription);
TranslateDialogDefault(hwnd);
SetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, plSets->MaxQuestCount.Get(), FALSE);
@@ -21,32 +18,25 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) CheckDlgButton(hwnd, ID_NOTCASESENS, plSets->AnswNotCaseSens.Get() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, ID_REMOVE_TMP_ALL, plSets->RemTmpAll.Get() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, ID_HISTORY_LOG, plSets->HistLog.Get() ? BST_CHECKED : BST_UNCHECKED);
- }
- return TRUE;
- case WM_COMMAND:{
- switch (LOWORD(wParam))
- {
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
case ID_MAXQUESTCOUNT:
- {
if (EN_CHANGE != HIWORD(wParam) || (HWND)lParam != GetFocus())
return FALSE;
break;
- }
+
case ID_DESCRIPTION:
- {
return FALSE;
}
- }
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
+ break;
+
case WM_NOTIFY:
- {
NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
- {
+ switch (nmhdr->code) {
case PSN_APPLY:
- {
plSets->MaxQuestCount = GetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, nullptr, FALSE);
plSets->InfTalkProtection = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_INFTALKPROT));
plSets->AddPermanent = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_ADDPERMANENT));
@@ -54,11 +44,9 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) plSets->AnswNotCaseSens = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_NOTCASESENS));
plSets->RemTmpAll = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_REMOVE_TMP_ALL));
plSets->HistLog = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_HISTORY_LOG));
+ return TRUE;
}
- return TRUE;
- }
- }
- break;
+ break;
}
return FALSE;
}
@@ -66,10 +54,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
- {
TranslateDialogDefault(hwnd);
SetDlgItemString(hwnd, ID_QUESTION, plSets->Question.Get());
SetDlgItemString(hwnd, ID_ANSWER, plSets->Answer.Get());
@@ -78,54 +64,51 @@ INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetDlgItemString(hwnd, ID_DIVIDER, plSets->AnswSplitString.Get());
variables_skin_helpbutton(hwnd, IDC_VARS);
ServiceExists(MS_VARS_FORMATSTRING) ? EnableWindow(GetDlgItem(hwnd, IDC_VARS), 1) : EnableWindow(GetDlgItem(hwnd, IDC_VARS), 0);
- }
- return TRUE;
+ return TRUE;
+
case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case ID_QUESTION:
- case ID_ANSWER:
- case ID_AUTHREPL:
- case ID_CONGRATULATION:
- case ID_DIVIDER:
{
- if (EN_CHANGE != HIWORD(wParam) || (HWND)lParam != GetFocus())
- return FALSE;
- break;
- }
- case ID_RESTOREDEFAULTS:
- SetDlgItemString(hwnd, ID_QUESTION, plSets->Question.GetDefault());
- SetDlgItemString(hwnd, ID_ANSWER, plSets->Answer.GetDefault());
- SetDlgItemString(hwnd, ID_CONGRATULATION, plSets->Congratulation.GetDefault());
- SetDlgItemString(hwnd, ID_AUTHREPL, plSets->AuthRepl.GetDefault());
- SetDlgItemString(hwnd, ID_DIVIDER, plSets->AnswSplitString.GetDefault());
+ switch (LOWORD(wParam)) {
+ case ID_QUESTION:
+ case ID_ANSWER:
+ case ID_AUTHREPL:
+ case ID_CONGRATULATION:
+ case ID_DIVIDER:
+ if (EN_CHANGE != HIWORD(wParam) || (HWND)lParam != GetFocus())
+ return FALSE;
+ break;
+
+ case ID_RESTOREDEFAULTS:
+ SetDlgItemString(hwnd, ID_QUESTION, plSets->Question.GetDefault());
+ SetDlgItemString(hwnd, ID_ANSWER, plSets->Answer.GetDefault());
+ SetDlgItemString(hwnd, ID_CONGRATULATION, plSets->Congratulation.GetDefault());
+ SetDlgItemString(hwnd, ID_AUTHREPL, plSets->AuthRepl.GetDefault());
+ SetDlgItemString(hwnd, ID_DIVIDER, plSets->AnswSplitString.GetDefault());
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ return TRUE;
+
+ case IDC_VARS:
+ variables_showhelp(hwnd, msg, VHF_FULLDLG | VHF_SETLASTSUBJECT, nullptr, nullptr);
+ return TRUE;
+ }
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- return TRUE;
- case IDC_VARS:
- variables_showhelp(hwnd, msg, VHF_FULLDLG | VHF_SETLASTSUBJECT, nullptr, nullptr);
- return TRUE;
}
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- break;
+ break;
+
case WM_NOTIFY:
- {
NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
- {
+ switch (nmhdr->code) {
case PSN_APPLY:
- {
- plSets->Question = GetDlgItemString(hwnd, ID_QUESTION);
- plSets->Answer = GetDlgItemString(hwnd, ID_ANSWER);
- plSets->AuthRepl = GetDlgItemString(hwnd, ID_AUTHREPL);
- plSets->Congratulation = GetDlgItemString(hwnd, ID_CONGRATULATION);
- plSets->AnswSplitString = GetDlgItemString(hwnd, ID_DIVIDER);
- }
- return TRUE;
+ {
+ plSets->Question = GetDlgItemString(hwnd, ID_QUESTION);
+ plSets->Answer = GetDlgItemString(hwnd, ID_ANSWER);
+ plSets->AuthRepl = GetDlgItemString(hwnd, ID_AUTHREPL);
+ plSets->Congratulation = GetDlgItemString(hwnd, ID_CONGRATULATION);
+ plSets->AnswSplitString = GetDlgItemString(hwnd, ID_DIVIDER);
+ }
+ return TRUE;
}
- }
- break;
+ break;
}
return FALSE;
}
|