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

Add venues list and chosen place name.

This commit is contained in:
John Preston
2024-07-07 21:01:26 +04:00
parent 8e6d7bb190
commit 310837c9e1
27 changed files with 1066 additions and 141 deletions

View File

@@ -3328,6 +3328,22 @@ void Session::documentApplyFields(
}
}
not_null<DocumentData*> Session::venueIconDocument(const QString &icon) {
const auto i = _venueIcons.find(icon);
if (i != end(_venueIcons)) {
return i->second;
}
const auto result = documentFromWeb(MTP_webDocumentNoProxy(
MTP_string(u"https://ss3.4sqi.net/img/categories_v2/"_q
+ icon
+ u"_64.png"_q),
MTP_int(0),
MTP_string("image/png"),
MTP_vector<MTPDocumentAttribute>()), {}, {});
_venueIcons.emplace(icon, result);
return result;
}
not_null<WebPageData*> Session::webpage(WebPageId id) {
auto i = _webpages.find(id);
if (i == _webpages.cend()) {