diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-30 18:21:55 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-30 18:21:55 +0300 |
commit | 2cde8069f2d7c2963ae10cca5f520462ac3a4a49 (patch) | |
tree | 2f6e61b2f62b2b1b0673912870e8894d0be0f4ea /plugins/NewStory | |
parent | 3ea151ed7440be73dccc664c0464e0dfc8e72ad0 (diff) |
fixes #4700 (Telegram: не доходят входящие сообщения, содержащие цитату)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 589016b072..bb3c4ecfca 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -204,13 +204,20 @@ static void AppendString(CMStringW &buf, const wchar_t *p, ItemData *pItem) buf.AppendFormat(L"</font>");
}
else if (!wcsncmp(p, L"code]", 5)) {
+ p += 4;
+ buf.AppendFormat(L"<pre>");
+ }
+ else if (!wcsncmp(p, L"/code]", 6)) {
p += 5;
-
- if (auto *p1 = wcsstr(p, L"[/code]")) {
- CMStringW wszUrl(p, int(p1 - p));
- buf.AppendFormat(L"<pre>%s</pre>", wszUrl.c_str());
- p = p1 + 6;
- }
+ buf.AppendFormat(L"</pre>");
+ }
+ else if (!wcsncmp(p, L"quote]", 6)) {
+ p += 5;
+ buf.AppendFormat(L"<div class=\"quote\">");
+ }
+ else if (!wcsncmp(p, L"/quote]", 7)) {
+ p += 6;
+ buf.AppendFormat(L"</div>");
}
else {
buf.AppendChar('[');
@@ -237,8 +244,7 @@ CMStringW ItemData::formatHtml(const wchar_t *pwszStr) str.AppendFormat(L"body {margin: 0px; text-align: left; %s; color: NSText; overflow: auto;}\n", font2html(F.lf, szFont));
str.AppendFormat(L".nick {color: #%06X }\n", color2html(g_colorTable[(dbe.flags & DBEF_SENT) ? COLOR_OUTNICK : COLOR_INNICK].cl));
str.AppendFormat(L".link {color: #%06X }\n", color2html(g_colorTable[COLOR_LINK].cl));
- if (qtext)
- str.AppendFormat(L".quote {border-left: 4px solid #%06X; padding-left: 8px; }\n", color2html(g_colorTable[COLOR_QUOTE].cl));
+ str.AppendFormat(L".quote {border-left: 4px solid #%06X; padding-left: 8px; }\n", color2html(g_colorTable[COLOR_QUOTE].cl));
str.Append(L"</style></head><body class=\"body\">\n");
|