From 654fd5f8cc5693b7cd7c47c9a485ff0eb98a71bb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Apr 2024 13:43:23 +0300 Subject: =?UTF-8?q?fixes=20#4348=20(NewStory:=20=D1=82=D0=B0=D0=B1=D1=83?= =?UTF-8?q?=D0=BB=D1=8F=D1=86=D0=B8=D1=8F=20=D0=B2=20=D1=80=D0=B5=D0=B6?= =?UTF-8?q?=D0=B8=D0=BC=D0=B5=20=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82?= =?UTF-8?q?=D1=80=D0=B0=20=D1=81=D1=8A=D0=B5=D0=B4=D0=B0=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F,=20=D0=B0=20=D0=B2=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B5=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/utils.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index faf52c94d0..34201b930d 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . enum class BBCODE { - BOLD, ITALIC, STRIKE, UNDERLINE, URL + BOLD, ITALIC, STRIKE, UNDERLINE, URL, CODE }; struct @@ -30,11 +30,12 @@ struct } static bbCodes[] = { - { BBCODE::BOLD, L"[b]", L"[/b]", 3, 4 }, - { BBCODE::ITALIC, L"[i]", L"[/i]", 3, 4 }, - { BBCODE::STRIKE, L"[s]", L"[/s]", 3, 4 }, - { BBCODE::UNDERLINE, L"[u]", L"[/u]", 3, 4 }, - { BBCODE::URL, L"[url]", L"[/url]", 5, 6 }, + { BBCODE::BOLD, L"[b]", L"[/b]", 3, 4 }, + { BBCODE::ITALIC, L"[i]", L"[/i]", 3, 4 }, + { BBCODE::STRIKE, L"[s]", L"[/s]", 3, 4 }, + { BBCODE::UNDERLINE, L"[u]", L"[/u]", 3, 4 }, + { BBCODE::URL, L"[url]", L"[/url]", 5, 6 }, + { BBCODE::CODE, L"[code]", L"[/code]", 6, 7 }, }; TD::object_ptr formatBbcodes(const char *pszText) @@ -65,6 +66,7 @@ TD::object_ptr formatBbcodes(const char *pszText) TD::object_ptr pNew; switch (it.type) { case BBCODE::URL: pNew = TD::make_object(); break; + case BBCODE::CODE: pNew = TD::make_object(); break; case BBCODE::BOLD: pNew = TD::make_object(); break; case BBCODE::ITALIC: pNew = TD::make_object(); break; case BBCODE::STRIKE: pNew = TD::make_object(); break; @@ -94,6 +96,7 @@ static CMStringA getFormattedText(TD::object_ptr &pText) case TD::textEntityTypeStrikethrough::ID: iCode = 2; break; case TD::textEntityTypeUnderline::ID: iCode = 3; break; case TD::textEntityTypeUrl::ID: iCode = 4; break; + case TD::textEntityTypeCode::ID: iCode = 5; break; default: continue; } -- cgit v1.2.3