From 9fc484fbcb154f376584ad8814b816d4a733eb9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Dec 2016 16:30:59 +0300 Subject: ugly custom construction replaced with the kernel API call --- src/core/stdmsg/src/chat_window.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 911c2deef9..b10330eb3b 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -2320,18 +2320,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case IDC_HISTORY: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_HISTORY))) { MODULEINFO *pInfo = pci->MM_FindModule(si->pszModule); - if (pInfo) { - wchar_t szFile[MAX_PATH], szName[MAX_PATH], szFolder[MAX_PATH]; - wcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE); - ValidateFilename(szName); - - mir_snwprintf(szFolder, L"%s\\%s", g_Settings.pszLogDir, szName); - mir_snwprintf(szName, L"%s.log", si->ptszID); - ValidateFilename(szName); - - mir_snwprintf(szFile, L"%s\\%s", szFolder, szName); - ShellExecute(hwndDlg, L"open", szFile, NULL, NULL, SW_SHOW); - } + if (pInfo) + ShellExecute(hwndDlg, NULL, pci->GetChatLogsFilename(si, 0), NULL, NULL, SW_SHOW); } break; -- cgit v1.2.3