diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-08 18:35:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-08 18:35:02 +0300 |
commit | 0b084cff5bb71a140d5181caa452a95b74ac8103 (patch) | |
tree | b0394812fbed52040485f90a1815892ad4f565fa /src/core | |
parent | 7f1f391faf93d216bfe651131a95d70961f8ffa2 (diff) |
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)
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdmsg/src/chat_options.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
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); |