2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Highlight telegram/telegraph/telescope links.

This commit is contained in:
John Preston
2020-11-02 09:34:54 +03:00
parent 4432863612
commit 9592e7dfc8
3 changed files with 10 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_values.h"
#include "core/application.h"
#include "core/local_url_handlers.h"
#include "core/click_handler_types.h"
#include "main/main_session.h"
#include "ui/wrap/slide_wrap.h"
#include "ui/text/text_utilities.h"
@@ -50,7 +50,7 @@ auto PlainUsernameValue(not_null<PeerData*> peer) {
void StripExternalLinks(TextWithEntities &text) {
const auto local = [](const QString &url) {
return Core::TryConvertUrlToLocal(url).startsWith(qstr("tg://"));
return !UrlRequiresConfirmation(QUrl::fromUserInput(url));
};
const auto notLocal = [&](const EntityInText &entity) {
if (entity.type() == EntityType::CustomUrl) {