diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index a09e5de34..f4900ef0e 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -8149,9 +8149,11 @@ editInlineMessageText inline_message_id:string reply_markup:ReplyMarkup input_me //@inline_message_id Inline message identifier //@reply_markup The new message reply markup; pass null if none //@location New location content of the message; pass null to stop sharing the live location +//@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. +//-Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period //@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown //@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled -editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location heading:int32 proximity_alert_radius:int32 = Ok; +editInlineMessageLiveLocation inline_message_id:string reply_markup:ReplyMarkup location:location live_period:int32 heading:int32 proximity_alert_radius: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 diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 6e57c386b..1605a2120 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -25382,8 +25382,9 @@ 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 &&reply_markup, - tl_object_ptr &&input_location, int32 heading, - int32 proximity_alert_radius, Promise &&promise) { + tl_object_ptr &&input_location, + int32 live_period, int32 heading, int32 proximity_alert_radius, + Promise &&promise) { CHECK(td_->auth_manager_->is_bot()); TRY_RESULT_PROMISE(promise, new_reply_markup, @@ -25403,12 +25404,15 @@ void MessagesManager::edit_inline_message_live_location(const string &inline_mes if (location.empty()) { flags |= telegram_api::inputMediaGeoLive::STOPPED_MASK; } + if (live_period != 0) { + flags |= telegram_api::inputMediaGeoLive::PERIOD_MASK; + } if (heading != 0) { flags |= telegram_api::inputMediaGeoLive::HEADING_MASK; } flags |= telegram_api::inputMediaGeoLive::PROXIMITY_NOTIFICATION_RADIUS_MASK; auto input_media = telegram_api::make_object( - flags, false /*ignored*/, location.get_input_geo_point(), heading, 0, proximity_alert_radius); + flags, false /*ignored*/, location.get_input_geo_point(), heading, live_period, proximity_alert_radius); td_->create_handler(std::move(promise)) ->send(0, std::move(input_bot_inline_message_id), "", vector>(), std::move(input_media), false, get_input_reply_markup(td_->user_manager_.get(), new_reply_markup)); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 9c6b8e762..f71522f8c 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -482,8 +482,8 @@ class MessagesManager final : public Actor { void edit_inline_message_live_location(const string &inline_message_id, tl_object_ptr &&reply_markup, - tl_object_ptr &&input_location, int32 heading, - int32 proximity_alert_radius, Promise &&promise); + tl_object_ptr &&input_location, int32 live_period, + int32 heading, int32 proximity_alert_radius, Promise &&promise); void edit_inline_message_media(const string &inline_message_id, tl_object_ptr &&reply_markup, tl_object_ptr &&input_message_content, diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 2d69a7fb9..2c0bdf072 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -5812,9 +5812,9 @@ void Td::on_request(uint64 id, td_api::editInlineMessageLiveLocation &request) { CHECK_IS_BOT(); CLEAN_INPUT_STRING(request.inline_message_id_); CREATE_OK_REQUEST_PROMISE(); - messages_manager_->edit_inline_message_live_location(request.inline_message_id_, std::move(request.reply_markup_), - std::move(request.location_), request.heading_, - request.proximity_alert_radius_, std::move(promise)); + messages_manager_->edit_inline_message_live_location( + request.inline_message_id_, std::move(request.reply_markup_), std::move(request.location_), request.live_period_, + request.heading_, request.proximity_alert_radius_, std::move(promise)); } void Td::on_request(uint64 id, td_api::editInlineMessageMedia &request) {