summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msgdialog.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-16 16:40:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-16 16:40:47 +0000
commit9213250ec9491ae5c8a9a6c389a7678eca8de4b7 (patch)
treed9deb1343c937ab522e0a1d50b41199be504b497 /plugins/TabSRMM/src/msgdialog.cpp
parent51c5b6906f9571f17a9905d7f1111baa1f2dc126 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@1956 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/msgdialog.cpp')
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp47
1 files changed, 18 insertions, 29 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 067213082b..b8f0265d73 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1277,13 +1277,9 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct TWindowData *dat = 0;
- HWND hwndTab, hwndContainer;
- struct TContainerData *m_pContainer = 0;
-
- dat = (struct TWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- hwndTab = GetParent(hwndDlg);
+ TContainerData *m_pContainer = 0;
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HWND hwndTab = GetParent(hwndDlg), hwndContainer;
if (dat == 0) {
if (msg == WM_ACTIVATE || msg == WM_SETFOCUS)
@@ -1404,10 +1400,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* consider per-contact message setting overrides
*/
- if (M->GetDword(dat->hContact, "mwmask", 0)) {
+ if (M->GetDword(dat->hContact, "mwmask", 0))
if (dat->hContact)
LoadLocalFlags(hwndDlg, dat);
- }
/*
* allow disabling emoticons per contact (note: currently unused feature)
@@ -1451,9 +1446,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(hwndDlg, DM_LOADBUTTONBARICONS, 0, 0);
if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKBUTTONSNPRESSED].IGNORED &&
- !SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED) {
- isThemed = FALSE;
- }
+ !SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED)
+ isThemed = FALSE;
SendMessage(GetDlgItem(hwndDlg, IDC_ADD), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_CANCELADD), BUTTONSETASFLATBTN, TRUE, 0);
@@ -1476,13 +1470,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SetWindowText(GetDlgItem(hwndDlg, IDC_RETRY), TranslateT("Retry"));
- {
- UINT _ctrls[] = {IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER};
- for (i=0; i < 3; i++) {
- SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASPUSHBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASFLATBTN, FALSE, 0);
- SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASTHEMEDBTN, TRUE, 0);
- }
+ UINT _ctrls[] = {IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER};
+ for (i=0; i < 3; i++) {
+ SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASPUSHBTN, TRUE, 0);
+ SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASFLATBTN, FALSE, 0);
+ SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASTHEMEDBTN, TRUE, 0);
}
SetWindowText(GetDlgItem(hwndDlg, IDC_CANCELSEND), TranslateT("Cancel"));
@@ -1563,24 +1555,19 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
//dat->dwFlags &= ~MWF_INITMODE;
{
- DBEVENTINFO dbei = { 0};
- HANDLE hdbEvent;
-
- dbei.cbSize = sizeof(dbei);
- hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
+ HANDLE hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
if (hdbEvent) {
do {
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
CallService(MS_DB_EVENT_GET, (WPARAM) hdbEvent, (LPARAM) & dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
dat->lastMessage = dbei.timestamp;
DM_UpdateLastMessage(dat);
break;
}
- } while (hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDPREV, (WPARAM) hdbEvent, 0));
+ }
+ while (hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDPREV, (WPARAM) hdbEvent, 0));
}
-
}
SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
@@ -3670,9 +3657,11 @@ quote_from_last:
break;
case WM_DESTROY:
+ if (!dat)
+ break;
+
if (PluginConfig.g_FlashAvatarAvail) {
FLASHAVATAR fa = {0};
-
fa.hContact = dat->hContact;
fa.id = 25367;
fa.cProto = dat->szProto;