summaryrefslogtreecommitdiff
path: root/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-27 13:50:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-27 13:50:53 +0000
commit5f8a607f900a42e27bf166b86185001aadf3e9f2 (patch)
tree6c69f5caebc55e84437ddc23013fada0a69af397 /plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
parent5e0f2fb896d874f9b7f5c069a90de64305089542 (diff)
more fun:
- MS_AWAYMSG_GETSTATUSMSGW/T is present in any MIID_SRAWAY plugin, so there's no need to check its existence; - therefore MS_AWAYMSG_GETSTATUSMSG considered useless, cause it has no references git-svn-id: http://svn.miranda-ng.org/main/trunk@8293 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp')
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
index 5de614c838..ec254d3203 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp
@@ -122,23 +122,15 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
settings[last]->msg = ( char* )realloc(settings[last]->msg, len+1);
SendDlgItemMessageA(hwndDlg, IDC_STATUSMSG, WM_GETTEXT, (LPARAM)(len+1), (WPARAM)settings[last]->msg);
}
+
if (i != -1) {
if (settings[i]->msg != NULL)
SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg);
- else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) {
- TCHAR *msg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)settings[i]->status, 0);
- if (msg != NULL) {
- SetDlgItemText(hwndDlg, IDC_STATUSMSG, msg);
- mir_free(msg);
- }
- }
- else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSG)) {
- char *msg = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM)settings[i]->status, 0);
- if (msg != NULL) {
- SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, msg);
- mir_free(msg);
- }
+ else {
+ ptrT msg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, settings[i]->status, 0));
+ SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : _T(""));
}
+
if (settings[i]->useCustom) {
EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), TRUE);
@@ -150,7 +142,8 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE);
CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, TRUE);
CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, FALSE);
- } }
+ }
+ }
last = i;
}
break;