2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Fix collectible channel links.

This commit is contained in:
John Preston
2024-04-04 17:45:15 +04:00
parent b31d43cbed
commit 9464f4b095
3 changed files with 23 additions and 9 deletions

View File

@@ -1147,14 +1147,15 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
auto linkText = LinkValue(
_peer,
true
) | rpl::map([=](const QString &link) {
return link.isEmpty()
) | rpl::map([=](const LinkWithUrl &link) {
const auto text = link.text;
return text.isEmpty()
? TextWithEntities()
: Ui::Text::Link(
(link.startsWith(u"https://"_q)
? link.mid(u"https://"_q.size())
: link) + addToLink,
link + addToLink);
(text.startsWith(u"https://"_q)
? text.mid(u"https://"_q.size())
: text) + addToLink,
(addToLink.isEmpty() ? link.url : (text + addToLink)));
});
auto linkLine = addInfoOneLine(
(topicRootId