Skip to content

Commit

Permalink
Migrate location sending to TDLib.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 16, 2024
1 parent 9b706df commit bfc1c5d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Telegram/SourceFiles/api/api_sending.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,14 @@ bool SendDice(MessageToSend &message) {
}

void SendLocation(SendAction action, float64 lat, float64 lon) {
SendPreparedMessage(
action,
tl_inputMessageLocation(
tl_location(tl_double(lat), tl_double(lon), tl_double(0)),
tl_int32(0), // live_period
tl_int32(0), // heading
tl_int32(0))); // proximity_alert_radius
#if 0 // mtp
SendSimpleMedia(
action,
MTP_inputMediaGeoPoint(
Expand All @@ -797,9 +805,23 @@ void SendLocation(SendAction action, float64 lat, float64 lon) {
MTP_double(lat),
MTP_double(lon),
MTPint()))); // accuracy_radius
#endif
}

void SendVenue(SendAction action, Data::InputVenue venue) {
SendPreparedMessage(
action,
tl_inputMessageVenue(tl_venue(
tl_location(
tl_double(venue.lat),
tl_double(venue.lon),
tl_double(0)),
tl_string(venue.title),
tl_string(venue.address),
tl_string(venue.provider),
tl_string(venue.id),
tl_string(venue.venueType))));
#if 0 // mtp
SendSimpleMedia(
action,
MTP_inputMediaVenue(
Expand All @@ -813,6 +835,7 @@ void SendVenue(SendAction action, Data::InputVenue venue) {
MTP_string(venue.provider),
MTP_string(venue.id),
MTP_string(venue.venueType)));
#endif
}

void FillMessagePostFlags(
Expand Down

0 comments on commit bfc1c5d

Please sign in to comment.