From 81d4a61fb79687dc23fb0def97365577acc70117 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 17 Nov 2017 18:11:55 +0300 Subject: fixes #1030 (all IRC commands stopped working) --- plugins/TabSRMM/src/msgdlgutils.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index fab938ac8b..ec48cdd159 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -886,8 +886,12 @@ BOOL CTabBaseDlg::DoRtfToTags(CMStringW &pszText) const if (iCol > 0) { if (isChat()) { - if (mi && mi->bColor) - res.AppendFormat((iInd >= 0) ? L"%%c%u" : L"%%C", iInd); + if (mi && mi->bColor) { + if (iInd >= 0) + res.AppendFormat(L"%%c%u", iInd); + else if (!res.IsEmpty()) + res.Append(L"%%C"); + } } else res.AppendFormat((iInd >= 0) ? (bInsideColor ? L"[/color][color=%s]" : L"[color=%s]") : (bInsideColor ? L"[/color]" : L""), Utils::rtf_clrs[iInd].szName); } @@ -898,7 +902,10 @@ BOOL CTabBaseDlg::DoRtfToTags(CMStringW &pszText) const if (isChat()) { if (mi && mi->bBkgColor) { int iInd = RtfColorToIndex(iNumColors, pIndex, _wtoi(p + 10)); - res.AppendFormat((iInd >= 0) ? L"%%f%u" : L"%%F", iInd); + if (iInd >= 0) + res.AppendFormat(L"%%f%u", iInd); + else if (!res.IsEmpty()) + res.AppendFormat(L"%%F"); } } } -- cgit v1.2.3