Allow HTTP web app links in test DC.

This commit is contained in:
levlam 2022-04-05 18:52:22 +03:00
parent 7e69ef731d
commit 317d267241

View File

@ -450,7 +450,7 @@ static Result<KeyboardButton> get_keyboard_button(tl_object_ptr<td_api::keyboard
if (user_id.is_valid()) {
return Status::Error(400, "Link to a user can't be used in web app URL buttons");
}
auto r_url = LinkManager::check_link(button_type->url_, true, true);
auto r_url = LinkManager::check_link(button_type->url_, true, !G()->is_test_dc());
if (r_url.is_error()) {
return Status::Error(400, "Inline keyboard button web app URL is invalid");
}
@ -572,7 +572,7 @@ static Result<InlineKeyboardButton> get_inline_keyboard_button(tl_object_ptr<td_
if (user_id.is_valid()) {
return Status::Error(400, "Link to a user can't be used in web app URL buttons");
}
auto r_url = LinkManager::check_link(button_type->url_, true, true);
auto r_url = LinkManager::check_link(button_type->url_, true, !G()->is_test_dc());
if (r_url.is_error()) {
return Status::Error(400, "Inline keyboard button web app URL is invalid");
}