From 0abc2590e4c11f2b852e87640c5c72b817115120 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 30 Sep 2019 12:14:02 +0300 Subject: fix for sending %% in tabSRMM group chats --- plugins/TabSRMM/src/msgdialog.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 7446488f63..dcff6711e9 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -823,15 +823,20 @@ void CMsgDialog::onClick_Ok(CCtrlButton *) return; } - // don't parse text formatting when the message contains curly braces - these are used by the rtf syntax - // and the parser currently cannot handle them properly in the text - XXX needs to be fixed later. - FINDTEXTEX fi = { 0 }; - fi.chrg.cpMin = 0; - fi.chrg.cpMax = -1; - fi.lpstrText = L"{"; - int final_sendformat = m_message.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)& fi) == -1 ? m_SendFormat : 0; - fi.lpstrText = L"}"; - final_sendformat = m_message.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)& fi) == -1 ? final_sendformat : 0; + int final_sendformat; + + if (!isChat()) { + // don't parse text formatting when the message contains curly braces - these are used by the rtf syntax + // and the parser currently cannot handle them properly in the text - XXX needs to be fixed later. + FINDTEXTEX fi = { 0 }; + fi.chrg.cpMin = 0; + fi.chrg.cpMax = -1; + fi.lpstrText = L"{"; + int final_sendformat = m_message.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) == -1 ? m_SendFormat : 0; + fi.lpstrText = L"}"; + final_sendformat = m_message.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) == -1 ? final_sendformat : 0; + } + else final_sendformat = true; if (GetSendButtonState(m_hwnd) == PBS_DISABLED) return; -- cgit v1.2.3