2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-25 11:47:29 +00:00

55 lines
1.0 KiB
C
Raw Normal View History

/*
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
namespace Iv {
struct Source;
struct Options {
QString saveToFolder;
};
struct Prepared {
2023-12-04 15:48:17 +04:00
QString title;
2023-12-04 23:06:44 +04:00
QByteArray content;
2023-12-05 17:25:26 +04:00
QString url;
2023-12-05 11:54:46 +04:00
QString hash;
std::vector<QByteArray> resources;
base::flat_map<QByteArray, QByteArray> embeds;
2023-12-04 23:06:44 +04:00
base::flat_set<QByteArray> channelIds;
bool rtl = false;
bool hasCode = false;
bool hasEmbeds = false;
};
struct Geo {
float64 lat = 0.;
float64 lon = 0.;
uint64 access = 0;
};
[[nodiscard]] QByteArray GeoPointId(Geo point);
[[nodiscard]] Geo GeoPointFromId(QByteArray data);
class Data final {
public:
Data(const MTPDwebPage &webpage, const MTPPage &page);
~Data();
[[nodiscard]] QString id() const;
void prepare(const Options &options, Fn<void(Prepared)> done) const;
private:
const std::unique_ptr<Source> _source;
};
} // namespace Iv