mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-30 01:08:02 +00:00
Added geolocation support to poll answer media data layer.
This commit is contained in:
@@ -374,6 +374,13 @@ MTPInputMedia PollMediaToMTP(const PollMedia &media) {
|
||||
MTP_int(0),
|
||||
MTP_int(0),
|
||||
MTPstring());
|
||||
} else if (media.geo) {
|
||||
return MTP_inputMediaGeoPoint(
|
||||
MTP_inputGeoPoint(
|
||||
MTP_flags(0),
|
||||
MTP_double(media.geo->lat()),
|
||||
MTP_double(media.geo->lon()),
|
||||
MTPint())); // accuracy_radius
|
||||
}
|
||||
return MTPInputMedia();
|
||||
}
|
||||
@@ -396,6 +403,16 @@ PollMedia PollMediaFromMTP(
|
||||
}, [](const auto &) {
|
||||
});
|
||||
}
|
||||
}, [&](const MTPDmessageMediaGeo &data) {
|
||||
data.vgeo().match([&](const MTPDgeoPoint &point) {
|
||||
result.geo = Data::LocationPoint(point);
|
||||
}, [](const MTPDgeoPointEmpty &) {
|
||||
});
|
||||
}, [&](const MTPDmessageMediaVenue &data) {
|
||||
data.vgeo().match([&](const MTPDgeoPoint &point) {
|
||||
result.geo = Data::LocationPoint(point);
|
||||
}, [](const MTPDgeoPointEmpty &) {
|
||||
});
|
||||
}, [](const auto &) {
|
||||
});
|
||||
return result;
|
||||
@@ -415,6 +432,14 @@ PollMedia PollMediaFromInputMTP(
|
||||
result.document = owner->document(document.vid().v);
|
||||
}, [](const auto &) {
|
||||
});
|
||||
}, [&](const MTPDinputMediaGeoPoint &data) {
|
||||
data.vgeo_point().match([&](const MTPDinputGeoPoint &point) {
|
||||
result.geo.emplace(
|
||||
point.vlat().v,
|
||||
point.vlong().v,
|
||||
Data::LocationPoint::NoAccessHash);
|
||||
}, [](const auto &) {
|
||||
});
|
||||
}, [](const auto &) {
|
||||
});
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user