From 0b084cff5bb71a140d5181caa452a95b74ac8103 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 Dec 2018 18:35:02 +0300 Subject: chats: - Chat_GetGroup & Chat_SetGroup functions added to stop the zoo with chat default group name; - fixes #1655 (custom chat group name doesn't work in Discord) --- src/core/stdmsg/src/chat_options.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 932ca3f07b..91a6d735c5 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -200,16 +200,6 @@ HANDLE GetIconHandle(const char *pszIcoLibName) return IcoLib_GetIconHandle(szTemp); } -static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefault) -{ - DBVARIANT dbv; - if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) { - replaceStrW(*ppPointer, dbv.pwszVal); - db_free(&dbv); - } - else replaceStrW(*ppPointer, pszDefault); -} - ///////////////////////////////////////////////////////////////////////////////////////// // General options @@ -475,10 +465,7 @@ public: spin4.SetRange(255, 10); spin4.SetPosition(db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12)); - wchar_t* pszGroup = nullptr; - InitSetting(&pszGroup, "AddToGroup", L"Chat rooms"); - edtGroup.SetText(pszGroup); - mir_free(pszGroup); + edtGroup.SetText(ptrW(Chat_GetGroup())); wchar_t szTemp[MAX_PATH]; PathToRelativeW(g_Settings.pszLogDir, szTemp); @@ -539,7 +526,7 @@ public: else db_unset(0, CHAT_MODULE, "HeaderOutgoing"); - db_set_ws(0, CHAT_MODULE, "AddToGroup", ptrW(rtrimw(edtGroup.GetText()))); + Chat_SetGroup(ptrW(rtrimw(edtGroup.GetText()))); g_Settings.bHighlightEnabled = chkHighlight.GetState(); db_set_b(0, CHAT_MODULE, "HighlightEnabled", g_Settings.bHighlightEnabled); -- cgit v1.2.3