/* 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 */ #include "main/main_app_config_values.h" #include "main/main_app_config.h" #include "main/main_session.h" namespace AppConfig { std::optional FragmentLink(not_null session) { using Strings = std::vector; const auto domains = session->appConfig().get( u"whitelisted_domains"_q, std::vector()); const auto proj = [&, domain = u"fragment"_q](const QString &p) { return p.contains(domain); }; const auto it = ranges::find_if(domains, proj); return (it == end(domains)) ? std::nullopt : std::make_optional(*it); } } // namespace AppConfig