Skip to content

Commit

Permalink
Rudimentary support for Live Locations
Browse files Browse the repository at this point in the history
  • Loading branch information
leha-bot committed Aug 3, 2018
1 parent 19f1c79 commit e69b337
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Telegram/SourceFiles/history/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,13 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction,
default: badMedia = MediaCheckResult::Unsupported; break;
}
break;
case mtpc_messageMediaGeoLive:
switch (m.vmedia.c_messageMediaGeoLive().vgeo.type()) {
case mtpc_geoPoint: break;
case mtpc_geoPointEmpty: badMedia = MediaCheckResult::Empty; break;
default: badMedia = MediaCheckResult::Unsupported; break;
}
break;
case mtpc_messageMediaPhoto: {
auto &photo = m.vmedia.c_messageMediaPhoto();
if (photo.has_ttl_seconds()) {
Expand Down
6 changes: 6 additions & 0 deletions Telegram/SourceFiles/history/history_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,12 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media) {
_media = std::make_unique<HistoryLocation>(this, LocationCoords(point.c_geoPoint()));
}
} break;
case mtpc_messageMediaGeoLive: {
auto &point = media->c_messageMediaGeoLive().vgeo;
if (point.type() == mtpc_geoPoint) {
_media = std::make_unique<HistoryLocation>(this, LocationCoords(point.c_geoPoint()));
}
} break;
case mtpc_messageMediaVenue: {
auto &d = media->c_messageMediaVenue();
if (d.vgeo.type() == mtpc_geoPoint) {
Expand Down

0 comments on commit e69b337

Please sign in to comment.