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 /plugins/TabSRMM/src/chat_options.cpp | |
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 'plugins/TabSRMM/src/chat_options.cpp')
-rw-r--r-- | plugins/TabSRMM/src/chat_options.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index e6329e9ce7..3b973cc1b2 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -535,6 +535,7 @@ class CChatSettingsDlg : public CChatBaseOptionDlg HTREEITEM hListHeading2 = nullptr;
CCtrlTreeView treeCheck;
+ CCtrlEdit edtGroup;
HTREEITEM InsertBranch(wchar_t* pszDescr, BOOL bExpanded)
{
@@ -594,6 +595,7 @@ class CChatSettingsDlg : public CChatBaseOptionDlg public:
CChatSettingsDlg() :
CChatBaseOptionDlg(IDD_OPTIONS1),
+ edtGroup(this, IDC_GROUP),
treeCheck(this, IDC_CHECKBOXES)
{}
@@ -610,21 +612,13 @@ public: FillBranch(hListHeading1, branch1, _countof(branch1), 0x0000);
FillBranch(hListHeading2, branch2, _countof(branch2), 0x0000);
- ptrW pszGroup(db_get_wsa(0, CHAT_MODULE, "AddToGroup"));
- SetDlgItemText(m_hwnd, IDC_GROUP, (pszGroup != nullptr) ? pszGroup : TranslateT("Chat rooms"));
+ edtGroup.SetText(ptrW(Chat_GetGroup()));
return true;
}
bool OnApply() override
{
- int iLen = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_GROUP));
- if (iLen > 0) {
- wchar_t *pszText = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t));
- GetDlgItemText(m_hwnd, IDC_GROUP, pszText, iLen + 1);
- db_set_ws(0, CHAT_MODULE, "AddToGroup", pszText);
- mir_free(pszText);
- }
- else db_set_ws(0, CHAT_MODULE, "AddToGroup", L"");
+ Chat_SetGroup(ptrW(edtGroup.GetText()));
SaveBranch(branch1, _countof(branch1));
SaveBranch(branch2, _countof(branch2));
|