summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src/utils.cpp')
-rw-r--r--protocols/Telegram/src/utils.cpp12
1 files changed, 6 insertions, 6 deletions
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]";
}