diff options
Diffstat (limited to 'plugins/TabSRMM/src/msgdlgutils.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 21924f7c9a..267374f850 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -885,17 +885,23 @@ BOOL CTabBaseDlg::DoRtfToTags(CMStringW &pszText) const if (iCol > 0) {
if (!isChat())
res.AppendFormat((iInd >= 0) ? (bInsideColor ? L"[/color][color=%s]" : L"[color=%s]") : (bInsideColor ? L"[/color]" : L""), Utils::rtf_clrs[iInd].szName);
- // else
- // res.AppendFormat((iInd >= 0) ? L"%%c%02u" : L"%%C", iInd);
+ else {
+ MODULEINFO *mi = pci->MM_FindModule(m_si->pszModule);
+ if (mi && mi->bColor)
+ res.AppendFormat((iInd >= 0) ? L"%%c%u" : L"%%C", iInd);
+ }
}
bInsideColor = iInd >= 0;
}
- else if (!wcsncmp(p, L"\\highlight", 10)) { //background color
- /* if (isChat()) {
- int iInd = RtfColorToIndex(iNumColors, pIndex, _wtoi(p + 10));
- res.AppendFormat((iInd >= 0) ? L"%%f%02u" : L"%%F", iInd);
- } */
+ else if (!wcsncmp(p, L"\\highlight", 10)) { // background color
+ if (isChat()) {
+ MODULEINFO *mi = pci->MM_FindModule(m_si->pszModule);
+ if (mi && mi->bBkgColor) {
+ int iInd = RtfColorToIndex(iNumColors, pIndex, _wtoi(p + 10));
+ res.AppendFormat((iInd >= 0) ? L"%%f%u" : L"%%F", iInd);
+ }
+ }
}
else if (!wcsncmp(p, L"\\line", 5)) { // soft line break;
res.AppendChar('\n');
@@ -980,6 +986,13 @@ BOOL CTabBaseDlg::DoRtfToTags(CMStringW &pszText) const p++;
break;
+ case '%': // double % for stupid chat engine
+ if (isChat())
+ res.Append(L"%%");
+ else
+ res.AppendChar(*p++);
+ break;
+
default: // other text that should not be touched
res.AppendChar(*p++);
break;
|