summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-13 18:53:33 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-13 18:53:33 +0300
commitc84b89893ca2aa286bacaba93b7e708748348969 (patch)
tree3719b40a0c6115bca59b1ad48e33b8ff3b0676ec /src
parentfa65474aecdff2f17f65a188bea8b2b0be923f4f (diff)
options code cleaning
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/globals.cpp68
-rw-r--r--src/core/stdmsg/src/globals.h11
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp79
-rw-r--r--src/core/stdmsg/src/msglog.cpp14
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp54
-rw-r--r--src/core/stdmsg/src/msgs.cpp12
6 files changed, 112 insertions, 126 deletions
diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp
index e7ae4b7ffa..ff661aeec8 100644
--- a/src/core/stdmsg/src/globals.cpp
+++ b/src/core/stdmsg/src/globals.cpp
@@ -101,47 +101,33 @@ int AvatarChanged(WPARAM hContact, LPARAM lParam)
void ReloadGlobals()
{
- memset(&g_dat.flags, 0, sizeof(g_dat.flags));
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWBUTTONLINE, SRMSGDEFSET_SHOWBUTTONLINE))
- g_dat.flags.bShowButtons = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDBUTTON, SRMSGDEFSET_SENDBUTTON))
- g_dat.flags.bSendButton = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
- g_dat.flags.bShowTyping = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGWIN, SRMSGDEFSET_SHOWTYPINGWIN))
- g_dat.flags.bShowTypingWin = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGNOWIN, SRMSGDEFSET_SHOWTYPINGNOWIN))
- g_dat.flags.bShowTypingTray = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST))
- g_dat.flags.bShowTypingClist = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWLOGICONS, SRMSGDEFSET_SHOWLOGICONS))
- g_dat.flags.bShowIcons = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTIME, SRMSGDEFSET_SHOWTIME))
- g_dat.flags.bShowTime = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_AVATARENABLE, SRMSGDEFSET_AVATARENABLE))
- g_dat.flags.bShowAvatar = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWDATE, SRMSGDEFSET_SHOWDATE))
- g_dat.flags.bShowDate = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSECS, SRMSGDEFSET_SHOWSECS))
- g_dat.flags.bShowSecs = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_HIDENAMES, SRMSGDEFSET_HIDENAMES))
- g_dat.flags.bHideNames = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_CHARCOUNT, SRMSGDEFSET_CHARCOUNT))
- g_dat.flags.bShowReadChar = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER))
- g_dat.flags.bSendOnEnter = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER))
- g_dat.flags.bSendOnDblEnter = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOCLOSE, SRMSGDEFSET_AUTOCLOSE))
- g_dat.flags.bAutoClose = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN))
- g_dat.flags.bAutoMin = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
- g_dat.flags.bTypingUnknown = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_CTRLSUPPORT, SRMSGDEFSET_CTRLSUPPORT))
- g_dat.flags.bCtrlSupport = true;
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWFORMAT, SRMSGDEFSET_SHOWFORMAT))
- g_dat.flags.bShowFormat = true;
+ memset(&g_dat, 0, sizeof(g_dat));
+ g_dat.bShowDate = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWDATE, SRMSGDEFSET_SHOWDATE) != 0;
+ g_dat.bShowTime = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTIME, SRMSGDEFSET_SHOWTIME) != 0;
+ g_dat.bShowSecs = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSECS, SRMSGDEFSET_SHOWSECS) != 0;
+ g_dat.bShowIcons = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWLOGICONS, SRMSGDEFSET_SHOWLOGICONS) != 0;
+ g_dat.bShowAvatar = db_get_b(NULL, SRMMMOD, SRMSGSET_AVATARENABLE, SRMSGDEFSET_AVATARENABLE) != 0;
+ g_dat.bShowButtons = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWBUTTONLINE, SRMSGDEFSET_SHOWBUTTONLINE) != 0;
+ g_dat.bShowTyping = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING) != 0;
+ g_dat.bShowTypingWin = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGWIN, SRMSGDEFSET_SHOWTYPINGWIN) != 0;
+ g_dat.bShowTypingTray = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGNOWIN, SRMSGDEFSET_SHOWTYPINGNOWIN) != 0;
+ g_dat.bShowTypingClist = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST) != 0;
+
+ g_dat.bCascade = db_get_b(NULL, SRMMMOD, SRMSGSET_CASCADE, SRMSGDEFSET_CASCADE) != 0;
+ g_dat.bAutoMin = db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN) != 0;
+ g_dat.bAutoClose = db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOCLOSE, SRMSGDEFSET_AUTOCLOSE) != 0;
+ g_dat.bHideNames = db_get_b(NULL, SRMMMOD, SRMSGSET_HIDENAMES, SRMSGDEFSET_HIDENAMES) != 0;
+ g_dat.bShowFormat = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWFORMAT, SRMSGDEFSET_SHOWFORMAT) != 0;
+ g_dat.bSendButton = db_get_b(NULL, SRMMMOD, SRMSGSET_SENDBUTTON, SRMSGDEFSET_SENDBUTTON) != 0;
+ g_dat.bSendOnEnter = db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER) != 0;
+ g_dat.bCtrlSupport = db_get_b(NULL, SRMMMOD, SRMSGSET_CTRLSUPPORT, SRMSGDEFSET_CTRLSUPPORT) != 0;
+ g_dat.bShowReadChar = db_get_b(NULL, SRMMMOD, SRMSGSET_CHARCOUNT, SRMSGDEFSET_CHARCOUNT) != 0;
+ g_dat.bSendOnDblEnter = db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER) != 0;
+ g_dat.bTypingUnknown = db_get_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN) != 0;
+ g_dat.bDeleteTempCont = db_get_b(NULL, SRMMMOD, SRMSGSET_DELTEMP, SRMSGDEFSET_DELTEMP) != 0;
+ g_dat.bSavePerContact = db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT) != 0;
+ g_dat.bUseStatusWinIcon = db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON) != 0;
+ g_dat.bDoNotStealFocus = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS) != 0;
g_dat.openFlags = db_get_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS);
g_dat.nFlashMax = db_get_b(NULL, SRMMMOD, SRMSGSET_FLASHCOUNT, SRMSGDEFSET_FLASHCOUNT);
diff --git a/src/core/stdmsg/src/globals.h b/src/core/stdmsg/src/globals.h
index 3809eed016..aca1b398f0 100644
--- a/src/core/stdmsg/src/globals.h
+++ b/src/core/stdmsg/src/globals.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef SRMM_GLOBALS_H
#define SRMM_GLOBALS_H
-struct SrmmFlags
+struct GlobalMessageData
{
bool bShowButtons : 1;
bool bSendButton : 1;
@@ -44,11 +44,12 @@ struct SrmmFlags
bool bTypingUnknown : 1;
bool bCtrlSupport : 1;
bool bShowFormat : 1;
-};
+ bool bSavePerContact : 1;
+ bool bUseStatusWinIcon : 1;
+ bool bDoNotStealFocus : 1;
+ bool bCascade : 1;
+ bool bDeleteTempCont : 1;
-struct GlobalMessageData
-{
- SrmmFlags flags;
DWORD openFlags;
DWORD msgTimeout;
DWORD nFlashMax;
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 1f91b2a80c..122e4dea85 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -109,7 +109,7 @@ static void AddToFileList(wchar_t ***pppFiles, int *totalCount, const wchar_t* s
static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus)
{
- if (hwndStatus && g_dat.flags.bShowReadChar) {
+ if (hwndStatus && g_dat.bShowReadChar) {
wchar_t buf[32];
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
@@ -125,7 +125,7 @@ static void ShowTime(SrmmWindowData *dat)
GetSystemTime(&st);
if (dat->wMinute != st.wMinute) {
wchar_t buf[32];
- unsigned i = g_dat.flags.bShowReadChar ? 2 : 1;
+ unsigned i = g_dat.bShowReadChar ? 2 : 1;
TimeZone_PrintDateTime(dat->hTimeZone, L"t", buf, _countof(buf), 0);
SendMessage(dat->hwndStatus, SB_SETTEXT, i, (LPARAM)buf);
@@ -144,11 +144,11 @@ static void SetupStatusBar(HWND hwndDlg, SrmmWindowData *dat)
int cx = rc.right - rc.left;
if (dat->hTimeZone) {
- if (g_dat.flags.bShowReadChar)
+ if (g_dat.bShowReadChar)
statwidths[i++] = cx - SB_TIME_WIDTH - SB_CHAR_WIDTH - icons_width;
statwidths[i++] = cx - SB_TIME_WIDTH - icons_width;
}
- else if (g_dat.flags.bShowReadChar)
+ else if (g_dat.bShowReadChar)
statwidths[i++] = cx - SB_CHAR_WIDTH - icons_width;
statwidths[i++] = cx - icons_width;
@@ -176,7 +176,7 @@ static void SetDialogToType(HWND hwndDlg)
bShow = 0 != db_get_b(dat->hContact, "CList", "NotOnList", 0);
cbd->m_bHidden = !bShow;
}
- else bShow = g_dat.flags.bShowButtons;
+ else bShow = g_dat.bShowButtons;
}
ShowWindow(hwndButton, (bShow) ? SW_SHOW : SW_HIDE);
}
@@ -189,9 +189,9 @@ static void SetDialogToType(HWND hwndDlg)
ShowWindow(GetDlgItem(hwndDlg, IDCANCEL), SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_SPLITTERY), SW_SHOW);
- ShowWindow(GetDlgItem(hwndDlg, IDOK), g_dat.flags.bSendButton ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDOK), g_dat.bSendButton ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwndDlg, IDOK), GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) != 0);
- if (dat->avatarPic == NULL || !g_dat.flags.bShowAvatar)
+ if (dat->avatarPic == NULL || !g_dat.bShowAvatar)
ShowWindow(GetDlgItem(hwndDlg, IDC_AVATAR), SW_HIDE);
SendMessage(hwndDlg, DM_UPDATETITLE, 0, 0);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -243,11 +243,11 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
case WM_KEYDOWN:
if (wParam == VK_RETURN) {
- if (!(GetKeyState(VK_SHIFT) & 0x8000) && ((GetKeyState(VK_CONTROL) & 0x8000) != 0) != g_dat.flags.bSendOnEnter) {
+ if (!(GetKeyState(VK_SHIFT) & 0x8000) && ((GetKeyState(VK_CONTROL) & 0x8000) != 0) != g_dat.bSendOnEnter) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
- if (g_dat.flags.bSendOnDblEnter) {
+ if (g_dat.bSendOnDblEnter) {
if (dat->lastEnterTime + ENTERCLICKTIME < GetTickCount())
dat->lastEnterTime = GetTickCount();
else {
@@ -266,7 +266,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
return 0;
}
- if (wParam == VK_UP && (GetKeyState(VK_CONTROL) & 0x8000) && g_dat.flags.bCtrlSupport && !g_dat.flags.bAutoClose) {
+ if (wParam == VK_UP && (GetKeyState(VK_CONTROL) & 0x8000) && g_dat.bCtrlSupport && !g_dat.bAutoClose) {
if (pdat->cmdList.getCount()) {
if (pdat->cmdListInd < 0) {
pdat->cmdListInd = pdat->cmdList.getCount() - 1;
@@ -281,7 +281,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
return 0;
}
- if (wParam == VK_DOWN && (GetKeyState(VK_CONTROL) & 0x8000) && g_dat.flags.bCtrlSupport && !g_dat.flags.bAutoClose) {
+ if (wParam == VK_DOWN && (GetKeyState(VK_CONTROL) & 0x8000) && g_dat.bCtrlSupport && !g_dat.bAutoClose) {
if (pdat->cmdList.getCount() && pdat->cmdListInd >= 0) {
if (pdat->cmdListInd < (pdat->cmdList.getCount() - 1))
SetEditorText(hwnd, pdat->cmdList[++pdat->cmdListInd]);
@@ -470,7 +470,7 @@ static int MessageDialogResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
switch (urc->wId) {
case IDC_LOG:
- if (!g_dat.flags.bShowButtons)
+ if (!g_dat.bShowButtons)
urc->rcItem.top -= dat->lineHeight;
urc->rcItem.bottom -= dat->splitterPos - dat->originalSplitterPos;
return RD_ANCHORX_WIDTH | RD_ANCHORY_HEIGHT;
@@ -481,13 +481,13 @@ static int MessageDialogResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
return RD_ANCHORX_WIDTH | RD_ANCHORY_BOTTOM;
case IDC_MESSAGE:
- if (!g_dat.flags.bSendButton)
+ if (!g_dat.bSendButton)
urc->rcItem.right = urc->dlgNewSize.cx - urc->rcItem.left;
- if (g_dat.flags.bShowAvatar && dat->avatarPic)
+ if (g_dat.bShowAvatar && dat->avatarPic)
urc->rcItem.left = dat->avatarWidth + 4;
urc->rcItem.top -= dat->splitterPos - dat->originalSplitterPos;
- if (!g_dat.flags.bSendButton)
+ if (!g_dat.bSendButton)
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
return RD_ANCHORX_WIDTH | RD_ANCHORY_BOTTOM;
@@ -506,7 +506,7 @@ static int MessageDialogResize(HWND, LPARAM lParam, UTILRESIZECONTROL *urc)
void ShowAvatar(HWND hwndDlg, SrmmWindowData *dat)
{
- if (g_dat.flags.bShowAvatar) {
+ if (g_dat.bShowAvatar) {
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)dat->getActiveContact(), 0);
if (ace && (INT_PTR)ace != CALLSERVICE_NOTFOUND && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST))
dat->avatarPic = ace->hbmPic;
@@ -551,7 +551,7 @@ static void NotifyTyping(SrmmWindowData *dat, int mode)
if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(dat->hContact, dat->szProto, "ApparentMode", 0) != ID_STATUS_ONLINE)
return;
- if (!g_dat.flags.bTypingUnknown && db_get_b(dat->hContact, "CList", "NotOnList", 0))
+ if (!g_dat.bTypingUnknown && db_get_b(dat->hContact, "CList", "NotOnList", 0))
return;
// End user check
@@ -599,7 +599,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
else
dat->wStatus = ID_STATUS_OFFLINE;
dat->wOldStatus = dat->wStatus;
- dat->splitterPos = (int)db_get_dw(db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT) ? dat->hContact : NULL, SRMMMOD, "splitterPos", (DWORD)-1);
+ dat->splitterPos = (int)db_get_dw(g_dat.bSavePerContact ? dat->hContact : NULL, SRMMMOD, "splitterPos", (DWORD)-1);
dat->cmdListInd = -1;
dat->nTypeMode = PROTOTYPE_SELFTYPING_OFF;
SetTimer(hwndDlg, TIMERID_TYPE, 1000, NULL);
@@ -719,15 +719,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETEVENTMASK, 0, ENM_CHANGE);
{
int flag = newData->noActivate ? RWPF_HIDDEN : 0;
- int savePerContact = db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT);
- if (Utils_RestoreWindowPosition(hwndDlg, savePerContact ? dat->hContact : NULL, SRMMMOD, "", flag)) {
- if (savePerContact) {
+ if (Utils_RestoreWindowPosition(hwndDlg, g_dat.bSavePerContact ? dat->hContact : NULL, SRMMMOD, "", flag)) {
+ if (g_dat.bSavePerContact) {
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMMMOD, "", flag | RWPF_NOMOVE))
SetWindowPos(hwndDlg, 0, 0, 0, 450, 300, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
}
else SetWindowPos(hwndDlg, 0, 0, 0, 450, 300, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW);
}
- if (!savePerContact && db_get_b(NULL, SRMMMOD, SRMSGSET_CASCADE, SRMSGDEFSET_CASCADE))
+ if (!g_dat.bSavePerContact && g_dat.bCascade)
WindowList_Broadcast(pci->hWindowList, DM_CASCADENEWWINDOW, (WPARAM)hwndDlg, (LPARAM)& dat->windowWasCascaded);
}
if (newData->noActivate) {
@@ -790,7 +789,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
break;
case DM_AVATARCALCSIZE:
- if (dat->avatarPic == NULL || !g_dat.flags.bShowAvatar) {
+ if (dat->avatarPic == NULL || !g_dat.bShowAvatar) {
dat->avatarWidth = 50;
dat->avatarHeight = 50;
ShowWindow(GetDlgItem(hwndDlg, IDC_AVATAR), SW_HIDE);
@@ -801,7 +800,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
GetObject(dat->avatarPic, sizeof(bminfo), &bminfo);
dat->avatarWidth = bminfo.bmWidth + 2;
dat->avatarHeight = bminfo.bmHeight + 2;
- if (dat->limitAvatarH&&dat->avatarHeight > dat->limitAvatarH) {
+ if (dat->limitAvatarH && dat->avatarHeight > dat->limitAvatarH) {
dat->avatarWidth = bminfo.bmWidth * dat->limitAvatarH / bminfo.bmHeight + 2;
dat->avatarHeight = dat->limitAvatarH + 2;
}
@@ -812,7 +811,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case DM_UPDATESIZEBAR:
dat->minEditBoxSize.cx = dat->minEditInit.right - dat->minEditInit.left;
dat->minEditBoxSize.cy = dat->minEditInit.bottom - dat->minEditInit.top;
- if (g_dat.flags.bShowAvatar) {
+ if (g_dat.bShowAvatar) {
SendMessage(hwndDlg, DM_AVATARCALCSIZE, 0, 0);
if (dat->avatarPic && dat->minEditBoxSize.cy <= dat->avatarHeight)
dat->minEditBoxSize.cy = dat->avatarHeight;
@@ -846,7 +845,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
break;
case DM_UPDATEWINICON:
- if (db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON)) {
+ if (g_dat.bUseStatusWinIcon) {
Window_FreeIcon_IcoLib(hwndDlg);
if (dat->szProto) {
@@ -943,13 +942,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case DM_UPDATETITLE:
wchar_t newtitle[256];
if (dat->hContact && dat->szProto) {
- int statusIcon = db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON);
-
dat->wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
wchar_t *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
- if (statusIcon)
+ if (g_dat.bUseStatusWinIcon)
mir_snwprintf(newtitle, L"%s - %s", contactName, TranslateT("Message session"));
else
mir_snwprintf(newtitle, L"%s (%s): %s", contactName, szStatus, TranslateT("Message session"));
@@ -965,7 +962,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
return TRUE;
}
}
- if (statusIcon)
+ if (g_dat.bUseStatusWinIcon)
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
}
@@ -1061,7 +1058,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
RedrawWindow(GetDlgItem(hwndDlg, IDOK), NULL, NULL, RDW_INVALIDATE);
RedrawWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), NULL, NULL, RDW_INVALIDATE);
}
- if (g_dat.flags.bShowAvatar && dat->avatarPic)
+ if (g_dat.bShowAvatar && dat->avatarPic)
RedrawWindow(GetDlgItem(hwndDlg, IDC_AVATAR), NULL, NULL, RDW_INVALIDATE);
if (bottomScroll)
@@ -1191,7 +1188,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
else {
SendMessage(hwndDlg, DM_UPDATELASTMESSAGE, 0, 0);
- if (g_dat.flags.bShowTypingWin)
+ if (g_dat.bShowTypingWin)
SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
dat->showTyping = 0;
}
@@ -1207,7 +1204,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)szBuf);
SendMessage(dat->hwndStatus, SB_SETICON, 0, (LPARAM)hTyping);
- if (g_dat.flags.bShowTypingWin && GetForegroundWindow() != hwndDlg) {
+ if (g_dat.bShowTypingWin && GetForegroundWindow() != hwndDlg) {
HICON hIcon = (HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)hTyping);
IcoLib_ReleaseIcon(hIcon);
@@ -1237,7 +1234,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
return TRUE;
}
- if (dis->CtlID == IDC_AVATAR && dat->avatarPic && g_dat.flags.bShowAvatar) {
+ if (dis->CtlID == IDC_AVATAR && dat->avatarPic && g_dat.bShowAvatar) {
HPEN hPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
HPEN hOldPen = (HPEN)SelectObject(dis->hDC, hPen);
Rectangle(dis->hDC, 0, 0, dat->avatarWidth, dat->avatarHeight);
@@ -1294,9 +1291,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SetDlgItemText(hwndDlg, IDC_MESSAGE, L"");
- if (g_dat.flags.bAutoClose)
+ if (g_dat.bAutoClose)
DestroyWindow(hwndDlg);
- else if (g_dat.flags.bAutoMin)
+ else if (g_dat.bAutoMin)
ShowWindow(hwndDlg, SW_MINIMIZE);
}
return TRUE;
@@ -1515,8 +1512,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
NotifyLocalWinEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING);
- bool bSavePerContact = db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT) != 0;
-
// save string from the editor
if (dat->hContact) {
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) + 1;
@@ -1541,15 +1536,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
dat->cmdList.destroy();
WindowList_Remove(pci->hWindowList, hwndDlg);
- db_set_dw(bSavePerContact ? dat->hContact : NULL, SRMMMOD, "splitterPos", dat->splitterPos);
+
+ MCONTACT hContact = (g_dat.bSavePerContact) ? dat->hContact : NULL;
+ db_set_dw(hContact ? dat->hContact : NULL, SRMMMOD, "splitterPos", dat->splitterPos);
if (dat->hFont) {
DeleteObject(dat->hFont);
dat->hFont = NULL;
}
- MCONTACT hContact = (bSavePerContact) ? dat->hContact : NULL;
-
WINDOWPLACEMENT wp = { sizeof(wp) };
GetWindowPlacement(hwndDlg, &wp);
if (!dat->windowWasCascaded) {
@@ -1560,7 +1555,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
db_set_dw(hContact, SRMMMOD, "height", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
NotifyLocalWinEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSE);
- if (dat->hContact && db_get_b(NULL, SRMMMOD, SRMSGSET_DELTEMP, SRMSGDEFSET_DELTEMP))
+ if (dat->hContact && g_dat.bDeleteTempCont)
if (db_get_b(dat->hContact, "CList", "NotOnList", 0))
db_delete_contact(dat->hContact);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index 2a5b8e1d1f..a88a248102 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -84,7 +84,7 @@ static void AppendToBufferWithRTF(CMStringA &buf, const wchar_t *line)
buf.AppendChar('\\');
buf.AppendChar(*line);
}
- else if (*line == '[' && (g_dat.flags.bShowFormat)) {
+ else if (*line == '[' && (g_dat.bShowFormat)) {
int i, found = 0;
for (i = 0; i < _countof(bbcodes); ++i) {
if (line[1] == bbcodes[i][1]) {
@@ -245,21 +245,21 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
buffer.Append("\\rtlch\\ltrch");
}
- if (g_dat.flags.bShowIcons) {
+ if (g_dat.bShowIcons) {
int i = ((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? LOGICON_MSG_OUT : LOGICON_MSG_IN): LOGICON_MSG_NOTICE);
buffer.Append("\\f0\\fs14");
buffer.Append(pLogIconBmpBits[i]);
}
- if (g_dat.flags.bShowTime) {
+ if (g_dat.bShowTime) {
const wchar_t* szFormat;
wchar_t str[64];
- if (g_dat.flags.bShowSecs)
- szFormat = g_dat.flags.bShowDate ? L"d s" : L"s";
+ if (g_dat.bShowSecs)
+ szFormat = g_dat.bShowDate ? L"d s" : L"s";
else
- szFormat = g_dat.flags.bShowDate ? L"d t" : L"t";
+ szFormat = g_dat.bShowDate ? L"d t" : L"t";
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, szFormat, str, _countof(str), 0);
@@ -268,7 +268,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
showColon = 1;
}
- if (!(g_dat.flags.bHideNames) && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) {
+ if (!(g_dat.bHideNames) && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) {
wchar_t *szName;
if (dbei.flags & DBEF_SENT) {
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 3b30ed1acb..2002bce4f5 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -188,40 +188,42 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- {
- DWORD avatarHeight, msgTimeout;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_POPLIST), statusValues, _countof(statusValues), db_get_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS));
- CheckDlgButton(hwndDlg, IDC_DONOTSTEALFOCUS, db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS) ? BST_CHECKED : BST_UNCHECKED);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_POPLIST), statusValues, _countof(statusValues), db_get_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS));
+
+ CheckDlgButton(hwndDlg, IDC_DELTEMP, g_dat.bDeleteTempCont ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOMIN, g_dat.bAutoMin ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CASCADE, g_dat.bCascade ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, g_dat.bAutoClose ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CHARCOUNT, g_dat.bShowReadChar ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STATUSWIN, g_dat.bUseStatusWinIcon ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CTRLSUPPORT, g_dat.bCtrlSupport ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSENDBTN, g_dat.bSendButton ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SENDONENTER, g_dat.bSendOnEnter ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LIMITAVATARH, db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, SRMSGDEFSET_LIMITAVHEIGHT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SENDONDBLENTER, g_dat.bSendOnDblEnter ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AVATARSUPPORT, g_dat.bShowAvatar ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWBUTTONLINE, g_dat.bShowButtons ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SAVEPERCONTACT, g_dat.bSavePerContact ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONOTSTEALFOCUS, g_dat.bDoNotStealFocus ? BST_CHECKED : BST_UNCHECKED);
+ {
+ DWORD avatarHeight = db_get_dw(NULL, SRMMMOD, SRMSGSET_AVHEIGHT, SRMSGDEFSET_AVHEIGHT);
SetDlgItemInt(hwndDlg, IDC_NFLASHES, db_get_b(NULL, SRMMMOD, SRMSGSET_FLASHCOUNT, SRMSGDEFSET_FLASHCOUNT), FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWBUTTONLINE, g_dat.flags.bShowButtons ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOMIN, db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOCLOSE, SRMSGDEFSET_AUTOCLOSE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SAVEPERCONTACT, db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CASCADE, db_get_b(NULL, SRMMMOD, SRMSGSET_CASCADE, SRMSGDEFSET_CASCADE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SENDONENTER, db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SENDONDBLENTER, db_get_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, SRMSGDEFSET_SENDONDBLENTER) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STATUSWIN, db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_AVATARSUPPORT, g_dat.flags.bShowAvatar ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LIMITAVATARH, db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, SRMSGDEFSET_LIMITAVHEIGHT) ? BST_CHECKED : BST_UNCHECKED);
- avatarHeight = db_get_dw(NULL, SRMMMOD, SRMSGSET_AVHEIGHT, SRMSGDEFSET_AVHEIGHT);
SetDlgItemInt(hwndDlg, IDC_AVATARHEIGHT, avatarHeight, FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_LIMITAVATARH), IsDlgButtonChecked(hwndDlg, IDC_AVATARSUPPORT));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_AVATARSUPPORT))
EnableWindow(GetDlgItem(hwndDlg, IDC_AVATARHEIGHT), FALSE);
- else EnableWindow(GetDlgItem(hwndDlg, IDC_AVATARHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_LIMITAVATARH));
- CheckDlgButton(hwndDlg, IDC_SHOWSENDBTN, g_dat.flags.bSendButton ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CHARCOUNT, db_get_b(NULL, SRMMMOD, SRMSGSET_CHARCOUNT, SRMSGDEFSET_CHARCOUNT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CTRLSUPPORT, db_get_b(NULL, SRMMMOD, SRMSGSET_CTRLSUPPORT, SRMSGDEFSET_CTRLSUPPORT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DELTEMP, db_get_b(NULL, SRMMMOD, SRMSGSET_DELTEMP, SRMSGDEFSET_DELTEMP) ? BST_CHECKED : BST_UNCHECKED);
- msgTimeout = db_get_dw(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ else
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AVATARHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_LIMITAVATARH));
+
+ DWORD msgTimeout = db_get_dw(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
SetDlgItemInt(hwndDlg, IDC_SECONDS, msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout / 1000 : SRMSGDEFSET_MSGTIMEOUT / 1000, FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CASCADE), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SAVEPERCONTACT));
- EnableWindow(GetDlgItem(hwndDlg, IDC_CTRLSUPPORT), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
}
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CASCADE), !g_dat.bSavePerContact);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CTRLSUPPORT), !g_dat.bAutoClose);
return TRUE;
+
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_AUTOMIN:
@@ -260,6 +262,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_POPLIST:
@@ -296,6 +299,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
db_set_b(NULL, SRMMMOD, SRMSGSET_AVATARENABLE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATARSUPPORT));
db_set_b(NULL, SRMMMOD, SRMSGSET_LIMITAVHEIGHT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LIMITAVATARH));
+
DWORD avatarHeight = GetDlgItemInt(hwndDlg, IDC_AVATARHEIGHT, NULL, TRUE);
db_set_dw(NULL, SRMMMOD, SRMSGSET_AVHEIGHT, avatarHeight <= 0 ? SRMSGDEFSET_AVHEIGHT : avatarHeight);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index a8ef67cecb..2e66cb9018 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -64,7 +64,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
/* does a window for the contact exist? */
HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
if (hwnd) {
- if (!db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS)) {
+ if (!g_dat.bDoNotStealFocus) {
ShowWindow(hwnd, SW_RESTORE);
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
SetForegroundWindow(hwnd);
@@ -85,7 +85,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
NewMessageWindowLParam newData = { 0 };
newData.hContact = hContact;
- newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS);
+ newData.noActivate = g_dat.bDoNotStealFocus;
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM)&newData);
return 0;
}
@@ -157,7 +157,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
static int TypingMessage(WPARAM hContact, LPARAM lParam)
{
- if (!g_dat.flags.bShowTyping)
+ if (!g_dat.bShowTyping)
return 0;
hContact = db_mc_tryMeta(hContact);
@@ -167,11 +167,11 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
- else if (lParam && g_dat.flags.bShowTypingTray) {
+ else if (lParam && g_dat.bShowTypingTray) {
wchar_t szTip[256];
mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
- if (g_dat.flags.bShowTypingClist) {
+ if (g_dat.bShowTypingClist) {
pcli->pfnRemoveEvent(hContact, 1);
CLISTEVENT cle = {};
@@ -257,7 +257,7 @@ static void RestoreUnreadMessageAlerts(void)
if (autoPopup && !windowAlreadyExists) {
NewMessageWindowLParam newData = { 0 };
newData.hContact = hContact;
- newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS);
+ newData.noActivate = g_dat.bDoNotStealFocus;
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM)& newData);
}
else arEvents.insert(new MSavedEvent(hContact, hDbEvent));