MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / ParseWeatherArea

Function ParseWeatherArea

Telegram/SourceFiles/data/data_story.cpp:173–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173[[nodiscard]] auto ParseWeatherArea(const MTPMediaArea &area)
174-> std::optional<WeatherArea> {
175 auto result = std::optional<WeatherArea>();
176 area.match([&](const MTPDmediaAreaVenue &data) {
177 }, [&](const MTPDmediaAreaGeoPoint &data) {
178 }, [&](const MTPDmediaAreaSuggestedReaction &data) {
179 }, [&](const MTPDmediaAreaChannelPost &data) {
180 }, [&](const MTPDmediaAreaUrl &data) {
181 }, [&](const MTPDmediaAreaWeather &data) {
182 result.emplace(WeatherArea{
183 .area = ParseArea(data.vcoordinates()),
184 .emoji = qs(data.vemoji()),
185 .color = Ui::Color32FromSerialized(data.vcolor().v),
186 .millicelsius = int(1000. * std::clamp(
187 data.vtemperature_c().v,
188 -274.,
189 1'000'000.)),
190 });
191 }, [&](const MTPDmediaAreaStarGift &data) {
192 }, [&](const MTPDinputMediaAreaChannelPost &data) {
193 LOG(("API Error: Unexpected inputMediaAreaChannelPost from API."));
194 }, [&](const MTPDinputMediaAreaVenue &data) {
195 LOG(("API Error: Unexpected inputMediaAreaVenue from API."));
196 });
197 return result;
198}
199
200[[nodiscard]] PeerData *RepostSourcePeer(
201 not_null<Session*> owner,

Callers 1

applyFieldsMethod · 0.85

Calls 4

ParseAreaFunction · 0.85
qsFunction · 0.85
Color32FromSerializedFunction · 0.85
emplaceMethod · 0.80

Tested by

no test coverage detected