From c93680973f803dde52de0669d05671ea4afe0cb3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 12 Oct 2024 21:40:16 +0300 Subject: =?UTF-8?q?fixes=20#4727=20(Telegram:=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82=D1=80=20=D1=81=D1=81?= =?UTF-8?q?=D1=8B=D0=BB=D0=BE=D0=BA=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=B8=D1=82=20=D0=BB=D0=B8=D1=88=D0=BD=D1=8E=D1=8E=20=D0=B8?= =?UTF-8?q?=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D1=8E=20=D0=B8?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6=D0=B8?= =?UTF-8?q?=D1=82=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B7=D0=BD=D1=83=D1=8E)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/utils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 9ef0809d38..b0a71e8fcb 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -773,12 +773,15 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg if (auto *pWeb = pText->link_preview_.get()) { CMStringA szDescr; - if (!pWeb->display_url_.empty()) - szDescr.AppendFormat("[b]%s[/b]\r\n", pWeb->display_url_.c_str()); - if (!pWeb->site_name_.empty()) szDescr.AppendFormat("%s\r\n", pWeb->site_name_.c_str()); + if (!pWeb->title_.empty()) + szDescr.AppendFormat("[b]%s[/b]\r\n", pWeb->title_.c_str()); + + if (auto szText = GetFormattedText(pWeb->description_)) + szDescr.AppendFormat("%s\r\n", szText.c_str()); + if (pWeb->type_->get_id() == TD::linkPreviewTypePhoto::ID) { auto *pPhoto = ((TD::linkPreviewTypePhoto *)pWeb->type_.get())->photo_.get(); const TD::photoSize *pSize = nullptr; @@ -793,9 +796,6 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg szDescr.AppendFormat("[img=%s][/img]\r\n", szText.c_str()); } - if (auto szText = GetFormattedText(pWeb->description_)) - szDescr.AppendFormat("%s\r\n", szText.c_str()); - if (!szDescr.IsEmpty()) ret += "\r\n[quote]" + szDescr.Trim() + "[/quote]"; } -- cgit v1.2.3