ZaStoGram_desktop/Telegram/SourceFiles/zsg_naive/zsg_naive_links.h
loop-uh 3b0b6bc3af Naive: ссылки naive+https://user:pass@host:port#имя кликабельны и добавляют прокси
MarkNaiveLinks (zsg_naive/) превращает такую ссылку в один Url-сущность при сборке
текста сообщения (общий разбор текста принимал хост за почту), TryConvertUrlToLocal
переводит клик в tg://naive и открывает окно подтверждения прокси; вставка из буфера
тоже понимает такие ссылки.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-27 07:00:09 -05:00

22 lines
841 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/text/text_entity.h"
namespace Zsg::Naive {
// A NaiveProxy link, naive+https://user:pass@host:port#name, is not a link
// to the generic text parser: it does not know the '+' of the scheme and
// takes the host after user:pass@ for an e-mail domain. This finds such
// links in a message text and makes each one a single Url entity (replacing
// whatever the server or the parser made of its pieces), so it is clickable;
// Core::TryConvertUrlToLocal turns the click into the proxy confirmation box.
void MarkNaiveLinks(TextWithEntities &text);
} // namespace Zsg::Naive