Add live_period parameter to editMessageLiveLocation.

This commit is contained in:
levlam 2024-05-04 01:12:16 +03:00
parent 7febd857d6
commit ff01a73df3

View File

@ -10235,6 +10235,7 @@ td::Status Client::process_edit_message_text_query(PromisedQueryPtr &query) {
td::Status Client::process_edit_message_live_location_query(PromisedQueryPtr &query) {
object_ptr<td_api::location> location = nullptr;
int32 live_period = get_integer_arg(query.get(), "live_period", 0);
int32 heading = get_integer_arg(query.get(), "heading", 0);
int32 proximity_alert_radius = get_integer_arg(query.get(), "proximity_alert_radius", 0);
if (query->method() == "editmessagelivelocation") {
@ -10248,25 +10249,25 @@ td::Status Client::process_edit_message_live_location_query(PromisedQueryPtr &qu
TRY_RESULT(inline_message_id, get_inline_message_id(query.get()));
resolve_reply_markup_bot_usernames(
std::move(reply_markup), std::move(query),
[this, inline_message_id = inline_message_id.str(), location = std::move(location), heading,
[this, inline_message_id = inline_message_id.str(), location = std::move(location), live_period, heading,
proximity_alert_radius](object_ptr<td_api::ReplyMarkup> reply_markup, PromisedQueryPtr query) mutable {
send_request(
make_object<td_api::editInlineMessageLiveLocation>(
inline_message_id, std::move(reply_markup), std::move(location), 0, heading, proximity_alert_radius),
send_request(make_object<td_api::editInlineMessageLiveLocation>(inline_message_id, std::move(reply_markup),
std::move(location), live_period, heading,
proximity_alert_radius),
td::make_unique<TdOnEditInlineMessageCallback>(std::move(query)));
});
} else {
resolve_reply_markup_bot_usernames(
std::move(reply_markup), std::move(query),
[this, chat_id = chat_id.str(), message_id, location = std::move(location), heading, proximity_alert_radius](
object_ptr<td_api::ReplyMarkup> reply_markup, PromisedQueryPtr query) mutable {
[this, chat_id = chat_id.str(), message_id, location = std::move(location), live_period, heading,
proximity_alert_radius](object_ptr<td_api::ReplyMarkup> reply_markup, PromisedQueryPtr query) mutable {
check_message(chat_id, message_id, false, AccessRights::Edit, "message to edit", std::move(query),
[this, location = std::move(location), heading, proximity_alert_radius,
[this, location = std::move(location), live_period, heading, proximity_alert_radius,
reply_markup = std::move(reply_markup)](int64 chat_id, int64 message_id,
PromisedQueryPtr query) mutable {
send_request(make_object<td_api::editMessageLiveLocation>(
chat_id, message_id, std::move(reply_markup), std::move(location), 0,
heading, proximity_alert_radius),
chat_id, message_id, std::move(reply_markup), std::move(location),
live_period, heading, proximity_alert_radius),
td::make_unique<TdOnEditMessageCallback>(this, std::move(query)));
});
});