summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-07-29 14:41:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-07-29 14:41:50 +0300
commitb0ca575398780db4dc14f94100c4484b5d9c1bfa (patch)
tree1ff6241eab68f24077f7308d396ebc5a6aa3ae8b /plugins/TabSRMM
parent07464892e2e68bf816fa0f96590a812ec67b75f3 (diff)
.
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/chat_main.cpp11
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp6
3 files changed, 16 insertions, 11 deletions
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp
index 61a77f5c49..371443c74a 100644
--- a/plugins/TabSRMM/src/chat_main.cpp
+++ b/plugins/TabSRMM/src/chat_main.cpp
@@ -104,9 +104,9 @@ static void OnLoadSettings()
g_Settings.bContactStatusFirst = M.GetBool(CHAT_MODULE, "ContactStatusFirst", false);
g_Settings.bNewLineAfterNames = M.GetBool(CHAT_MODULE, "NewlineAfterNames", false);
- g_Settings.bUseCommaAsColon = M.GetBool(CHAT_MODULE, "UseCommaAsColon", false);
replaceStrW(g_Settings.pszLogDir, M.getChatLogPath());
+ replaceStrW(g_Settings.pwszAutoText, db_get_wsa(0, CHAT_MODULE, "TextAutocomplete"));
g_Settings.LogIconSize = (g_Settings.bScaleIcons) ? 12 : 16;
@@ -350,6 +350,15 @@ static SESSION_INFO* SM_CreateSession()
// load the module
int Chat_Load()
{
+ if (M.GetBool(CHAT_MODULE, "UseCommaAsColon", false)) {
+ db_unset(0, CHAT_MODULE, "UseCommaAsColon");
+ db_set_ws(0, CHAT_MODULE, "TextAutocomplete", L",");
+ }
+ if (M.GetBool(CHAT_MODULE, "AddColonToAutoComplete", false)) {
+ db_unset(0, CHAT_MODULE, "AddColonToAutoComplete");
+ db_set_ws(0, CHAT_MODULE, "TextAutocomplete", L":");
+ }
+
CheckUpdate();
Utils::RTF_CTableInit();
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 3c39fd5db8..9533808d2b 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1030,8 +1030,8 @@ void CMsgDialog::onDblClick_List(CCtrlListBox *pList)
if (g_Settings.bDoubleClick4Privat ? bShift : !bShift) {
int selStart = LOWORD(m_message.SendMsg(EM_GETSEL, 0, 0));
CMStringW tszName(ui->pszNick);
- if (selStart == 0)
- tszName.AppendChar(g_Settings.bUseCommaAsColon ? ',' : ':');
+ if (selStart == 0 && mir_wstrlen(g_Settings.pwszAutoText))
+ tszName.Append(g_Settings.pwszAutoText);
tszName.AppendChar(' ');
m_message.SendMsg(EM_REPLACESEL, FALSE, (LPARAM)tszName.GetString());
@@ -2422,10 +2422,8 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
buf.Insert(0, ' ');
}
else {// in the beginning of the message window
- if (g_Settings.bUseCommaAsColon)
- buf.AppendChar(',');
- else if (g_Settings.bAddColonToAutoComplete)
- buf.AppendChar(':');
+ if (mir_wstrlen(g_Settings.pwszAutoText))
+ buf.Append(g_Settings.pwszAutoText);
}
if (chr.cpMax != -1) {
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index a7b9823c25..0950593edb 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -1924,10 +1924,8 @@ LBL_SkipEnd:
CMStringW szReplace;
if (!isRoom && !isTopic && start == 0) {
szReplace = pszName;
- if (g_Settings.bUseCommaAsColon)
- szReplace.AppendChar(',');
- else if (g_Settings.bAddColonToAutoComplete)
- szReplace.AppendChar(':');
+ if (mir_wstrlen(g_Settings.pwszAutoText))
+ szReplace.Append(g_Settings.pwszAutoText);
szReplace.AppendChar(' ');
m_wszSearchResult = szReplace.Detach();
pszName = m_wszSearchResult;