Add live location heading support.

GitOrigin-RevId: 67a1bdad91e82f6e7509f4df8c7f66a00e44ab83
This commit is contained in:
levlam 2020-10-16 23:08:28 +03:00
parent d159ab4f52
commit 6e3eda2aa1
13 changed files with 98 additions and 50 deletions

View File

@ -1578,9 +1578,10 @@ messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageCon
//@description A voice note message @voice_note The voice note description @caption Voice note caption @is_listened True, if at least one of the recipients has listened to the voice note
messageVoiceNote voice_note:voiceNote caption:formattedText is_listened:Bool = MessageContent;
//@description A message with a location @location The location description @live_period Time relative to the message sent date until which the location can be updated, in seconds
//@description A message with a location @location The location description @live_period Time relative to the message send date, for which the location can be updated, in seconds
//@expires_in Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
messageLocation location:location live_period:int32 expires_in:int32 = MessageContent;
//@heading For live locations, a direction in which the location moves, in degrees; 0-360. If 0 the direction is unknown
messageLocation location:location live_period:int32 expires_in:int32 heading:int32 = MessageContent;
//@description A message with information about a venue @venue The venue description
messageVenue venue:venue = MessageContent;
@ -1796,7 +1797,8 @@ inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int
inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent;
//@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; should be between 60 and 86400 for a live location and 0 otherwise
inputMessageLocation location:location live_period:int32 = InputMessageContent;
//@heading For live locations, a direction in which the location moves, in degrees; 0-360. Pass 0 if unknown
inputMessageLocation location:location live_period:int32 heading:int32 = InputMessageContent;
//@description A message with information about a venue @venue Venue to send
inputMessageVenue venue:venue = InputMessageContent;
@ -2126,7 +2128,9 @@ inputInlineQueryResultDocument id:string title:string description:string documen
//@description Represents a game @id Unique identifier of the query result @game_short_name Short name of the game @reply_markup Message reply markup. Must be of type replyMarkupInlineKeyboard or null
inputInlineQueryResultGame id:string game_short_name:string reply_markup:ReplyMarkup = InputInlineQueryResult;
//@description Represents a point on the map @id Unique identifier of the query result @location Location result @live_period Amount of time relative to the message sent time until the location can be updated, in seconds @title Title of the result @thumbnail_url URL of the result thumbnail, if it exists @thumbnail_width Thumbnail width, if known @thumbnail_height Thumbnail height, if known
//@description Represents a point on the map @id Unique identifier of the query result @location Location result
//@live_period Amount of time relative to the message sent time until the location can be updated, in seconds
//@title Title of the result @thumbnail_url URL of the result thumbnail, if it exists @thumbnail_width Thumbnail width, if known @thumbnail_height Thumbnail height, if known
//@reply_markup The message reply markup. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: InputMessageText, InputMessageLocation, InputMessageVenue or InputMessageContact
inputInlineQueryResultLocation id:string location:location live_period:int32 title:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
@ -3820,7 +3824,8 @@ editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_me
//@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side
//@chat_id The chat the message belongs to @message_id Identifier of the message @reply_markup The new message reply markup; for bots only @location New location content of the message; may be null. Pass null to stop sharing the live location
editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location = Message;
//@heading The new direction in which the location moves, in degrees; 0-360. Pass 0 if unknown
editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location heading:int32 = Message;
//@description Edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can't be replaced if the message was set to self-destruct. Media can't be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side
//@chat_id The chat the message belongs to @message_id Identifier of the message @reply_markup The new message reply markup; for bots only @input_message_content New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo
@ -3837,8 +3842,10 @@ editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup =
//@description Edits the text of an inline text or game message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup @input_message_content New text content of the message. Should be of type InputMessageText
editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_message_content:InputMessageContent = Ok;
//@description Edits the content of a live location in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup @location New location content of the message; may be null. Pass null to stop sharing the live location
editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location = Ok;
//@description Edits the content of a live location in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier @reply_markup The new message reply markup
//@location New location content of the message; may be null. Pass null to stop sharing the live location
//@heading The new direction in which the location moves, in degrees; 0-360. Pass 0 if unknown
editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location heading:int32 = Ok;
//@description Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only @inline_message_id Inline message identifier
//@reply_markup The new message reply markup; for bots only @input_message_content New content of the message. Must be one of the following types: InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePhoto or InputMessageVideo

Binary file not shown.

View File

@ -56,7 +56,7 @@ inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = In
inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;
inputMediaGame#d33f43f3 id:InputGame = InputMedia;
inputMediaInvoice#f4e096c3 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:string = InputMedia;
inputMediaGeoLive#ce4e82fd flags:# stopped:flags.0?true geo_point:InputGeoPoint period:flags.1?int = InputMedia;
inputMediaGeoLive#a22c410e flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:int period:flags.1?int = InputMedia;
inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;
inputMediaDice#e66fbf7b emoticon:string = InputMedia;
@ -141,7 +141,7 @@ messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
messageMediaGame#fdb19008 game:Game = MessageMedia;
messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;
messageMediaGeoLive#7c3c2609 geo:GeoPoint period:int = MessageMedia;
messageMediaGeoLive#c65b8990 geo:GeoPoint heading:int period:int = MessageMedia;
messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
@ -616,7 +616,7 @@ messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;
inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaGeo#c1b15d65 flags:# geo_point:InputGeoPoint period:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaGeo#db94eea4 flags:# geo_point:InputGeoPoint period:int heading:int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
@ -628,7 +628,7 @@ inputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:Input
botInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaGeo#b722de65 flags:# geo:GeoPoint period:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaGeo#cd65660 flags:# geo:GeoPoint period:int heading:int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;
botInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;

Binary file not shown.

View File

@ -257,8 +257,9 @@ Result<tl_object_ptr<telegram_api::InputBotInlineMessage>> InlineQueriesManager:
}
if (constructor_id == td_api::inputMessageLocation::ID) {
TRY_RESULT(location, process_input_message_location(std::move(input_message_content)));
return make_tl_object<telegram_api::inputBotInlineMessageMediaGeo>(flags, location.first.get_input_geo_point(),
location.second, std::move(input_reply_markup));
return make_tl_object<telegram_api::inputBotInlineMessageMediaGeo>(flags, location.location.get_input_geo_point(),
location.live_period, location.heading,
std::move(input_reply_markup));
}
if (constructor_id == td_api::inputMessageVenue::ID) {
TRY_RESULT(venue, process_input_message_venue(std::move(input_message_content)));

View File

@ -106,7 +106,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, const Location &locatio
<< "]";
}
Result<std::pair<Location, int32>> process_input_message_location(
Result<InputMessageLocation> process_input_message_location(
tl_object_ptr<td_api::InputMessageContent> &&input_message_content) {
CHECK(input_message_content != nullptr);
CHECK(input_message_content->get_id() == td_api::inputMessageLocation::ID);
@ -125,7 +125,19 @@ Result<std::pair<Location, int32>> process_input_message_location(
return Status::Error(400, "Wrong live location period specified");
}
return std::make_pair(std::move(location), period);
constexpr int32 MIN_LIVE_LOCATION_HEADING = 1; // degrees, server side limit
constexpr int32 MAX_LIVE_LOCATION_HEADING = 360; // degrees, server side limit
auto heading = input_location->heading_;
if (heading != 0 && (heading < MIN_LIVE_LOCATION_HEADING || heading > MAX_LIVE_LOCATION_HEADING)) {
return Status::Error(400, "Wrong live location heading specified");
}
InputMessageLocation result;
result.location = std::move(location);
result.live_period = period;
result.heading = heading;
return std::move(result);
}
} // namespace td

View File

@ -18,8 +18,6 @@
#include "td/utils/StringBuilder.h"
#include "td/utils/tl_helpers.h"
#include <utility>
namespace td {
class Location {
@ -111,7 +109,12 @@ bool operator!=(const Location &lhs, const Location &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const Location &location);
Result<std::pair<Location, int32>> process_input_message_location(
struct InputMessageLocation {
Location location;
int32 live_period;
int32 heading;
};
Result<InputMessageLocation> process_input_message_location(
td_api::object_ptr<td_api::InputMessageContent> &&input_message_content) TD_WARN_UNUSED_RESULT;
} // namespace td

View File

@ -565,10 +565,16 @@ class MessageExpiredVideo : public MessageContent {
class MessageLiveLocation : public MessageContent {
public:
Location location;
int32 period;
int32 period = 0;
int32 heading = 0;
MessageLiveLocation() = default;
MessageLiveLocation(Location &&location, int32 period) : location(std::move(location)), period(period) {
MessageLiveLocation(Location &&location, int32 period, int32 heading)
: location(std::move(location)), period(period), heading(heading) {
if (heading < 0 || heading > 360) {
LOG(ERROR) << "Receive wrong heading " << heading;
heading = 0;
}
}
MessageContentType get_type() const override {
@ -731,6 +737,7 @@ static void store(const MessageContent *content, StorerT &storer) {
auto m = static_cast<const MessageLiveLocation *>(content);
store(m->location, storer);
store(m->period, storer);
store(m->heading, storer);
break;
}
case MessageContentType::Location: {
@ -1025,6 +1032,11 @@ static void parse(unique_ptr<MessageContent> &content, ParserT &parser) {
auto m = make_unique<MessageLiveLocation>();
parse(m->location, parser);
parse(m->period, parser);
if (parser.version() >= static_cast<int32>(Version::AddLiveLocationHeading)) {
parse(m->heading, parser);
} else {
m->heading = 0;
}
content = std::move(m);
break;
}
@ -1353,8 +1365,8 @@ InlineMessageContent create_inline_message_content(Td *td, FileId file_id,
case telegram_api::botInlineMessageMediaGeo::ID: {
auto inline_message_geo = move_tl_object_as<telegram_api::botInlineMessageMediaGeo>(inline_message);
if (inline_message_geo->period_ > 0) {
result.message_content =
make_unique<MessageLiveLocation>(Location(inline_message_geo->geo_), inline_message_geo->period_);
result.message_content = make_unique<MessageLiveLocation>(
Location(inline_message_geo->geo_), inline_message_geo->period_, inline_message_geo->heading_);
} else {
result.message_content = make_unique<MessageLocation>(Location(inline_message_geo->geo_));
}
@ -1614,10 +1626,11 @@ static Result<InputMessageContent> create_input_message_content(
}
case td_api::inputMessageLocation::ID: {
TRY_RESULT(location, process_input_message_location(std::move(input_message_content)));
if (location.second == 0) {
content = make_unique<MessageLocation>(std::move(location.first));
if (location.live_period == 0) {
content = make_unique<MessageLocation>(std::move(location.location));
} else {
content = make_unique<MessageLiveLocation>(std::move(location.first), location.second);
content =
make_unique<MessageLiveLocation>(std::move(location.location), location.live_period, location.heading);
}
break;
}
@ -2212,7 +2225,7 @@ static tl_object_ptr<telegram_api::InputMedia> get_input_media_impl(
auto m = static_cast<const MessageLiveLocation *>(content);
int32 flags = telegram_api::inputMediaGeoLive::PERIOD_MASK;
return make_tl_object<telegram_api::inputMediaGeoLive>(flags, false /*ignored*/,
m->location.get_input_geo_point(), m->period);
m->location.get_input_geo_point(), m->heading, m->period);
}
case MessageContentType::Location: {
auto m = static_cast<const MessageLocation *>(content);
@ -2805,7 +2818,7 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo
if (old_->location != new_->location) {
need_update = true;
}
if (old_->period != new_->period) {
if (old_->period != new_->period || old_->heading != new_->heading) {
need_update = true;
}
if (old_->location.get_access_hash() != new_->location.get_access_hash()) {
@ -3820,17 +3833,17 @@ unique_ptr<MessageContent> get_message_content(Td *td, FormattedText message,
}
case telegram_api::messageMediaGeoLive::ID: {
auto message_geo_point_live = move_tl_object_as<telegram_api::messageMediaGeoLive>(media);
int32 period = message_geo_point_live->period_;
auto location = Location(std::move(message_geo_point_live->geo_));
if (location.empty()) {
break;
}
int32 period = message_geo_point_live->period_;
if (period <= 0) {
LOG(ERROR) << "Receive wrong live location period = " << period;
return make_unique<MessageLocation>(std::move(location));
}
return make_unique<MessageLiveLocation>(std::move(location), period);
return make_unique<MessageLiveLocation>(std::move(location), period, message_geo_point_live->heading_);
}
case telegram_api::messageMediaVenue::ID: {
auto message_venue = move_tl_object_as<telegram_api::messageMediaVenue>(media);
@ -4393,12 +4406,13 @@ tl_object_ptr<td_api::MessageContent> get_message_content_object(const MessageCo
case MessageContentType::LiveLocation: {
const MessageLiveLocation *m = static_cast<const MessageLiveLocation *>(content);
auto passed = max(G()->unix_time_cached() - message_date, 0);
return make_tl_object<td_api::messageLocation>(m->location.get_location_object(), m->period,
max(0, m->period - passed));
auto expires_in = max(0, m->period - passed);
auto heading = expires_in == 0 ? 0 : m->heading;
return make_tl_object<td_api::messageLocation>(m->location.get_location_object(), m->period, expires_in, heading);
}
case MessageContentType::Location: {
const MessageLocation *m = static_cast<const MessageLocation *>(content);
return make_tl_object<td_api::messageLocation>(m->location.get_location_object(), 0, 0);
return make_tl_object<td_api::messageLocation>(m->location.get_location_object(), 0, 0, 0);
}
case MessageContentType::Photo: {
const MessagePhoto *m = static_cast<const MessagePhoto *>(content);

View File

@ -23867,7 +23867,7 @@ void MessagesManager::edit_message_text(FullMessageId full_message_id,
void MessagesManager::edit_message_live_location(FullMessageId full_message_id,
tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::location> &&input_location,
tl_object_ptr<td_api::location> &&input_location, int32 heading,
Promise<Unit> &&promise) {
LOG(INFO) << "Begin to edit live location of " << full_message_id;
auto dialog_id = full_message_id.get_dialog_id();
@ -23914,8 +23914,8 @@ void MessagesManager::edit_message_live_location(FullMessageId full_message_id,
if (location.empty()) {
flags |= telegram_api::inputMediaGeoLive::STOPPED_MASK;
}
auto input_media = telegram_api::make_object<telegram_api::inputMediaGeoLive>(flags, false /*ignored*/,
location.get_input_geo_point(), 0);
auto input_media = telegram_api::make_object<telegram_api::inputMediaGeoLive>(
flags, false /*ignored*/, location.get_input_geo_point(), heading, 0);
send_closure(td_->create_net_actor<EditMessageActor>(std::move(promise)), &EditMessageActor::send, 0, dialog_id,
m->message_id, string(), vector<tl_object_ptr<telegram_api::MessageEntity>>(), std::move(input_media),
std::move(input_reply_markup), get_message_schedule_date(m),
@ -24228,7 +24228,7 @@ void MessagesManager::edit_inline_message_text(const string &inline_message_id,
void MessagesManager::edit_inline_message_live_location(const string &inline_message_id,
tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::location> &&input_location,
tl_object_ptr<td_api::location> &&input_location, int32 heading,
Promise<Unit> &&promise) {
if (!td_->auth_manager_->is_bot()) {
return promise.set_error(Status::Error(3, "Method is available only for bots"));
@ -24253,8 +24253,8 @@ void MessagesManager::edit_inline_message_live_location(const string &inline_mes
if (location.empty()) {
flags |= telegram_api::inputMediaGeoLive::STOPPED_MASK;
}
auto input_media = telegram_api::make_object<telegram_api::inputMediaGeoLive>(flags, false /*ignored*/,
location.get_input_geo_point(), 0);
auto input_media = telegram_api::make_object<telegram_api::inputMediaGeoLive>(
flags, false /*ignored*/, location.get_input_geo_point(), heading, 0);
td_->create_handler<EditInlineMessageQuery>(std::move(promise))
->send(0, std::move(input_bot_inline_message_id), "", vector<tl_object_ptr<telegram_api::MessageEntity>>(),
std::move(input_media), get_input_reply_markup(r_new_reply_markup.ok()));

View File

@ -434,7 +434,8 @@ class MessagesManager : public Actor {
tl_object_ptr<td_api::InputMessageContent> &&input_message_content, Promise<Unit> &&promise);
void edit_message_live_location(FullMessageId full_message_id, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::location> &&input_location, Promise<Unit> &&promise);
tl_object_ptr<td_api::location> &&input_location, int32 heading,
Promise<Unit> &&promise);
void edit_message_media(FullMessageId full_message_id, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::InputMessageContent> &&input_message_content, Promise<Unit> &&promise);
@ -451,7 +452,8 @@ class MessagesManager : public Actor {
void edit_inline_message_live_location(const string &inline_message_id,
tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::location> &&input_location, Promise<Unit> &&promise);
tl_object_ptr<td_api::location> &&input_location, int32 heading,
Promise<Unit> &&promise);
void edit_inline_message_media(const string &inline_message_id, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::InputMessageContent> &&input_message_content,

View File

@ -1201,10 +1201,11 @@ class EditMessageLiveLocationRequest : public RequestOnceActor {
FullMessageId full_message_id_;
tl_object_ptr<td_api::ReplyMarkup> reply_markup_;
tl_object_ptr<td_api::location> location_;
int32 heading_;
void do_run(Promise<Unit> &&promise) override {
td->messages_manager_->edit_message_live_location(full_message_id_, std::move(reply_markup_), std::move(location_),
std::move(promise));
heading_, std::move(promise));
}
void do_send_result() override {
@ -1214,11 +1215,12 @@ class EditMessageLiveLocationRequest : public RequestOnceActor {
public:
EditMessageLiveLocationRequest(ActorShared<Td> td, uint64 request_id, int64 dialog_id, int64 message_id,
tl_object_ptr<td_api::ReplyMarkup> reply_markup,
tl_object_ptr<td_api::location> location)
tl_object_ptr<td_api::location> location, int32 heading)
: RequestOnceActor(std::move(td), request_id)
, full_message_id_(DialogId(dialog_id), MessageId(message_id))
, reply_markup_(std::move(reply_markup))
, location_(std::move(location)) {
, location_(std::move(location))
, heading_(heading) {
}
};
@ -5728,7 +5730,7 @@ void Td::on_request(uint64 id, td_api::editMessageText &request) {
void Td::on_request(uint64 id, td_api::editMessageLiveLocation &request) {
CREATE_REQUEST(EditMessageLiveLocationRequest, request.chat_id_, request.message_id_,
std::move(request.reply_markup_), std::move(request.location_));
std::move(request.reply_markup_), std::move(request.location_), request.heading_);
}
void Td::on_request(uint64 id, td_api::editMessageMedia &request) {
@ -5761,7 +5763,7 @@ void Td::on_request(uint64 id, td_api::editInlineMessageLiveLocation &request) {
CREATE_OK_REQUEST_PROMISE();
messages_manager_->edit_inline_message_live_location(std::move(request.inline_message_id_),
std::move(request.reply_markup_), std::move(request.location_),
std::move(promise));
request.heading_, std::move(promise));
}
void Td::on_request(uint64 id, td_api::editInlineMessageMedia &request) {

View File

@ -40,6 +40,7 @@ enum class Version : int32 {
AddAnimationStickers,
AddDialogPhotoHasAnimation,
AddPhotoProgressiveSizes,
AddLiveLocationHeading,
Next
};

View File

@ -3128,11 +3128,14 @@ class CliClient final : public Actor {
string message_id;
string latitude;
string longitude;
string heading;
std::tie(chat_id, args) = split(args);
std::tie(message_id, args) = split(args);
std::tie(latitude, longitude) = split(args);
std::tie(latitude, args) = split(args);
std::tie(longitude, heading) = split(args);
send_request(td_api::make_object<td_api::editMessageLiveLocation>(as_chat_id(chat_id), as_message_id(message_id),
nullptr, as_location(latitude, longitude)));
nullptr, as_location(latitude, longitude),
to_integer<int32>(heading)));
} else if (op == "emss") {
string chat_id;
string message_id;
@ -3386,18 +3389,21 @@ class CliClient final : public Actor {
string longitude;
std::tie(latitude, longitude) = split(args);
send_message(chat_id, td_api::make_object<td_api::inputMessageLocation>(as_location(latitude, longitude), 0));
send_message(chat_id, td_api::make_object<td_api::inputMessageLocation>(as_location(latitude, longitude), 0, 0));
} else if (op == "sll") {
string chat_id;
string period;
string heading;
string latitude;
string longitude;
std::tie(chat_id, args) = split(args);
std::tie(period, args) = split(args);
std::tie(heading, args) = split(args);
std::tie(latitude, longitude) = split(args);
send_message(chat_id, td_api::make_object<td_api::inputMessageLocation>(as_location(latitude, longitude),
to_integer<int32>(period)));
send_message(chat_id,
td_api::make_object<td_api::inputMessageLocation>(
as_location(latitude, longitude), to_integer<int32>(period), to_integer<int32>(heading)));
} else if (op == "spoll" || op == "spollm" || op == "spollp" || op == "squiz") {
string chat_id;
string question;