summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-30 18:21:55 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-30 18:21:55 +0300
commit2cde8069f2d7c2963ae10cca5f520462ac3a4a49 (patch)
tree2f6e61b2f62b2b1b0673912870e8894d0be0f4ea /protocols/Telegram
parent3ea151ed7440be73dccc664c0464e0dfc8e72ad0 (diff)
fixes #4700 (Telegram: не доходят входящие сообщения, содержащие цитату)
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/utils.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index c823896051..c1a648e35b 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
enum class BBCODE
{
- BOLD, ITALIC, STRIKE, UNDERLINE, URL, CODE
+ BOLD, ITALIC, STRIKE, UNDERLINE, URL, CODE, QUOTE
};
struct
@@ -30,12 +30,13 @@ 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::CODE, L"[code]", L"[/code]", 6, 7 },
+ { 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 },
+ { BBCODE::QUOTE, L"[quote]", L"[/quote]", 7, 8 },
};
TD::object_ptr<TD::formattedText> formatBbcodes(const char *pszText)
@@ -68,6 +69,7 @@ TD::object_ptr<TD::formattedText> formatBbcodes(const char *pszText)
case BBCODE::URL: pNew = TD::make_object<TD::textEntityTypeUrl>(); break;
case BBCODE::CODE: pNew = TD::make_object<TD::textEntityTypeCode>(); break;
case BBCODE::BOLD: pNew = TD::make_object<TD::textEntityTypeBold>(); break;
+ case BBCODE::QUOTE: pNew = TD::make_object<TD::textEntityTypeBlockQuote>(); break;
case BBCODE::ITALIC: pNew = TD::make_object<TD::textEntityTypeItalic>(); break;
case BBCODE::STRIKE: pNew = TD::make_object<TD::textEntityTypeStrikethrough>(); break;
case BBCODE::UNDERLINE: pNew = TD::make_object<TD::textEntityTypeUnderline>(); break;
@@ -95,6 +97,7 @@ CMStringA CTelegramProto::GetFormattedText(TD::object_ptr<TD::formattedText> &pT
case TD::textEntityTypeStrikethrough::ID: iCode = 2; break;
case TD::textEntityTypeUnderline::ID: iCode = 3; break;
case TD::textEntityTypeCode::ID: iCode = 5; break;
+ case TD::textEntityTypeBlockQuote::ID: iCode = 6; break;
case TD::textEntityTypeUrl::ID:
if (!m_bUrlPreview)
continue;