From bfc1c5dbb931f70267cb7cb2676248ff8191c91b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Oct 2024 10:03:14 +0400 Subject: [PATCH] Migrate location sending to TDLib. --- Telegram/SourceFiles/api/api_sending.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 1606480106d155..bc57c483077c5a 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -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( @@ -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( @@ -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(