From 6ed0f28f9288a76e479b916f2e579b1a61ac47fd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 18 Jan 2024 14:20:19 +0300 Subject: Srmm_IsCustomLogUsed should take the 'forGroupchats' parameter into consideration --- include/m_srmm_int.h | 2 +- libs/win32/mir_app.lib | Bin 290260 -> 290270 bytes libs/win64/mir_app.lib | Bin 289972 -> 289982 bytes plugins/Scriver/src/chat_options.cpp | 2 +- plugins/Scriver/src/msgoptions.cpp | 2 +- plugins/TabSRMM/src/chat_options.cpp | 2 +- plugins/TabSRMM/src/msgoptions.cpp | 2 +- plugins/TabSRMM/src/userprefs.cpp | 2 +- src/core/stdmsg/src/chat_options.cpp | 2 +- src/core/stdmsg/src/msgoptions.cpp | 2 +- src/mir_app/src/mir_app.def | 2 +- src/mir_app/src/mir_app64.def | 2 +- src/mir_app/src/srmm_log.cpp | 5 ++++- 13 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 547f4f096a..712039e7d7 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -151,7 +151,7 @@ typedef CSrmmLogWindow *(MIR_CDECL *pfnSrmmLogCreator)(CMsgDialog &pDlg); MIR_APP_DLL(HANDLE) RegisterSrmmLog(CMPlugin *pPlugin, const char *pszShortName, const wchar_t *pwszScreenName, pfnSrmmLogCreator fnBuilder); MIR_APP_DLL(void) UnregisterSrmmLog(HANDLE); -MIR_APP_DLL(bool) Srmm_IsCustomLogUsed(); +MIR_APP_DLL(bool) Srmm_IsCustomLogUsed(bool forGroupChats); ///////////////////////////////////////////////////////////////////////////////////////// // SRMM log window class diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index c5b56d9a15..52671be255 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index 0f536676ed..6eac23f154 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp index 2c1a041325..8785129a98 100644 --- a/plugins/Scriver/src/chat_options.cpp +++ b/plugins/Scriver/src/chat_options.cpp @@ -363,7 +363,7 @@ void ChatOptInitialize(WPARAM wParam) odp.szTab.a = LPGEN("General"); g_plugin.addOptions(wParam, &odp); - if (!Chat::bEnableCustomLogs) { + if (!Srmm_IsCustomLogUsed(true)) { odp.pDialog = new CLogOptsDlg(); odp.szTab.a = LPGEN("Log formatting"); g_plugin.addOptions(wParam, &odp); diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 9e60d96540..2ff219b29b 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -805,7 +805,7 @@ int OptInitialise(WPARAM wParam, LPARAM) odp.szTab.a = LPGEN("Layout"); g_plugin.addOptions(wParam, &odp); - odp.pDialog = new CLogOptionsDlg(Srmm_IsCustomLogUsed() ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); + odp.pDialog = new CLogOptionsDlg(Srmm_IsCustomLogUsed(false) ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); odp.szTab.a = LPGEN("Event log"); g_plugin.addOptions(wParam, &odp); diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 3f35dcfcf3..26ef4e6dad 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -895,7 +895,7 @@ void Chat_Options(WPARAM wParam) odp.pDialog = new CChatSettingsDlg(); g_plugin.addOptions(wParam, &odp); - if (!Chat::bEnableCustomLogs) { + if (!Srmm_IsCustomLogUsed(true)) { odp.szTab.a = LPGEN("Log formatting"); odp.pDialog = new CChatLogOptionDlg(); g_plugin.addOptions(wParam, &odp); diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 29d2285231..cd9af60eec 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -1489,7 +1489,7 @@ int OptInitialise(WPARAM wParam, LPARAM lParam) g_plugin.addOptions(wParam, &odp); odp.szTab.a = LPGEN("Message log"); - odp.pDialog = new COptLogDlg(Srmm_IsCustomLogUsed() ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); + odp.pDialog = new COptLogDlg(Srmm_IsCustomLogUsed(false) ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); g_plugin.addOptions(wParam, &odp); odp.szTab.a = LPGEN("Advanced tweaks"); diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index f8f8705b9b..12f7e7b275 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -327,7 +327,7 @@ public: SetCaption(szBuffer); m_tab.AddPage(TranslateT("General"), nullptr, new CUserPrefsOptDlg(m_hContact)); - if (!Srmm_IsCustomLogUsed()) + if (!Srmm_IsCustomLogUsed(Contact::IsGroupChat(m_hContact))) m_tab.AddPage(TranslateT("Message Log"), nullptr, new CUserPrefsLogDlg(m_hContact)); return true; } diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index a2354b48a2..2518807485 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -332,7 +332,7 @@ int ChatOptionsInitialize(WPARAM wParam) odp.pDialog = new COptMainDlg(); g_plugin.addOptions(wParam, &odp); - if (!Chat::bEnableCustomLogs) { + if (!Srmm_IsCustomLogUsed(true)) { odp.position = 910000001; odp.szTab.a = LPGEN("Chat log"); odp.pDialog = new COptLogDlg(); diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 2f9bd7e906..a3206d7e05 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -572,7 +572,7 @@ int OptInitialise(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp); odp.szTab.a = LPGEN("Messaging log"); - odp.pDialog = new COptionLogDlg(Srmm_IsCustomLogUsed() ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); + odp.pDialog = new COptionLogDlg(Srmm_IsCustomLogUsed(false) ? IDD_OPT_MSGHIST : IDD_OPT_MSGLOG); g_plugin.addOptions(wParam, &odp); odp.szTab.a = LPGEN("Typing notify"); diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 9a82e8e1f0..20d41c159c 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -886,7 +886,7 @@ Clist_GroupSaveExpanded @1003 NONAME ??1MAsyncObject@@UAE@XZ @1017 NONAME ??_7MAsyncObject@@6B@ @1018 NONAME ?bEnableCustomLogs@Chat@@3V?$CMOption@_N@@A @1019 NONAME -?Srmm_IsCustomLogUsed@@YG_NXZ @1020 NONAME +?Srmm_IsCustomLogUsed@@YG_N_N@Z @1020 NONAME ?IconFlashTime@Clist@@3V?$CMOption@I@@A @1021 NONAME ?Srmm_Quote@@YG?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@PB_WH@Z @1022 NONAME ?SetMessageText@CSrmmBaseDialog@@QAEXPB_W_N@Z @1023 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 64227040f5..5761132572 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -886,7 +886,7 @@ Clist_GroupSaveExpanded @1003 NONAME ??1MAsyncObject@@UEAA@XZ @1017 NONAME ??_7MAsyncObject@@6B@ @1018 NONAME ?bEnableCustomLogs@Chat@@3V?$CMOption@_N@@A @1019 NONAME -?Srmm_IsCustomLogUsed@@YA_NXZ @1020 NONAME +?Srmm_IsCustomLogUsed@@YA_N_N@Z @1020 NONAME ?IconFlashTime@Clist@@3V?$CMOption@I@@A @1021 NONAME ?Srmm_Quote@@YA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@PEB_WH@Z @1022 NONAME ?SetMessageText@CSrmmBaseDialog@@QEAAXPEB_W_N@Z @1023 NONAME diff --git a/src/mir_app/src/srmm_log.cpp b/src/mir_app/src/srmm_log.cpp index 61dd70601c..aaf466264b 100644 --- a/src/mir_app/src/srmm_log.cpp +++ b/src/mir_app/src/srmm_log.cpp @@ -85,8 +85,11 @@ MIR_APP_DLL(SrmmLogWindowClass *) Srmm_GetWindowClass(CMsgDialog *pDlg) return nullptr; // shall never happen } -MIR_APP_DLL(bool) Srmm_IsCustomLogUsed() +MIR_APP_DLL(bool) Srmm_IsCustomLogUsed(bool forGroupChats) { + if (forGroupChats && !Chat::bEnableCustomLogs) + return false; + return mir_strcmp(g_logger, "built-in") != 0; } -- cgit v1.2.3