summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-18 19:04:48 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-18 19:04:48 +0300
commita33e78824264ed11bde0051914a3d4d1e68d44ed (patch)
treed3d7f470c3a5939c19e88525192b4ebf2afe131d /src/core
parent66aae3c929b110d9621c649ebaeba2e75dc2a1b9 (diff)
fixes #4675 (Не работают кнопки форматирования в StdMsg/Scriver)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp28
-rw-r--r--src/core/stdmsg/src/msgs.cpp5
2 files changed, 17 insertions, 16 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index b7cdfbdc3c..a9a7b46e66 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -314,16 +314,20 @@ void CMsgDialog::onClick_Ok(CCtrlButton *pButton)
if (!pButton->Enabled())
return;
- ptrA msgText(m_message.GetRichTextRtf(true));
- if (msgText == nullptr)
+ ptrA streamOut(m_message.GetRichTextRtf(!m_bSendFormat));
+ if (streamOut == nullptr)
return;
- if (isChat()) {
- CMStringW ptszText(ptrW(mir_utf8decodeW(msgText)));
- DoRtfToTags(ptszText);
- ptszText.Trim();
+ CMStringW wszText(ptrW(mir_utf8decodeW(streamOut)));
+ if (wszText.IsEmpty())
+ return;
+
+ if (m_bSendFormat)
+ DoRtfToTags(wszText);
+ wszText.TrimRight();
- m_cmdList.insert(mir_wstrdup(ptszText));
+ if (isChat()) {
+ m_cmdList.insert(mir_wstrdup(wszText));
m_cmdListInd = -1;
if (m_si->pMI->bAckMsg) {
@@ -332,16 +336,12 @@ void CMsgDialog::onClick_Ok(CCtrlButton *pButton)
}
else m_message.SetText(L"");
- Chat_DoEventHook(m_si, GC_USER_MESSAGE, nullptr, ptszText, 0);
+ Chat_DoEventHook(m_si, GC_USER_MESSAGE, nullptr, wszText, 0);
}
else {
- ptrW temp(mir_utf8decodeW(msgText));
- if (!temp[0])
- return;
-
- int sendId = SendMessageDirect(m_hContact, m_hQuoteEvent, rtrimw(temp));
+ int sendId = SendMessageDirect(m_hContact, m_hQuoteEvent, wszText);
if (sendId) {
- m_cmdList.insert(temp.detach());
+ m_cmdList.insert(wszText.Detach());
m_cmdListInd = -1;
if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON)
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index cba06ad66e..b4583d9020 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -354,8 +354,8 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("View user's history (Ctrl+H)");
g_plugin.addButton(&bbd);
- // chat buttons
- bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID | BBBF_NOREADONLY;
+ // format buttons
+ bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_ISIMBUTTON | BBBF_CREATEBYID | BBBF_NOREADONLY;
bbd.dwButtonID = IDC_SRMM_BOLD;
bbd.dwDefPos = 10;
bbd.hIcon = g_plugin.getIconHandle(IDI_BBOLD);
@@ -391,6 +391,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("Select a background color for the text (Ctrl+L)");
g_plugin.addButton(&bbd);
+ // chat buttons
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_SRMM_CHANMGR;
bbd.dwDefPos = 30;