Full support and build fix.

This commit is contained in:
John Preston
2025-12-18 22:25:12 +04:00
parent 53324d5494
commit 28434f4bee
136 changed files with 681 additions and 692 deletions

View File

@@ -991,7 +991,7 @@ void WebViewInstance::resolveApp(
const auto already = _session->data().findBotApp(_bot->id, appname);
_requestId = _session->api().request(MTPmessages_GetBotApp(
MTP_inputBotAppShortName(
_bot->inputUser,
_bot->inputUser(),
MTP_string(appname)),
MTP_long(already ? already->hash : 0)
)).done([=](const MTPmessages_BotApp &result) {
@@ -1142,15 +1142,15 @@ void WebViewInstance::requestButton() {
| (action.replyTo ? Flag::f_reply_to : Flag(0))
| (action.options.sendAs ? Flag::f_send_as : Flag(0))
| (action.options.silent ? Flag::f_silent : Flag(0))),
action.history->peer->input,
_bot->inputUser,
action.history->peer->input(),
_bot->inputUser(),
MTP_bytes(_button.url),
MTP_string(_button.startCommand),
MTP_dataJSON(MTP_bytes(botThemeParams().json)),
MTP_string("tdesktop"),
action.mtpReplyTo(),
(action.options.sendAs
? action.options.sendAs->input
? action.options.sendAs->input()
: MTP_inputPeerEmpty())
)).done([=](const MTPWebViewResult &result) {
const auto &data = result.data();
@@ -1181,7 +1181,7 @@ void WebViewInstance::requestSimple() {
? Flag()
: Flag::f_start_param))
: Flag::f_url)),
_bot->inputUser,
_bot->inputUser(),
MTP_bytes(_button.url),
MTP_string(_button.startCommand),
MTP_dataJSON(MTP_bytes(botThemeParams().json)),
@@ -1211,8 +1211,8 @@ void WebViewInstance::requestMain() {
? Flag::f_compact
: Flag(0))
: Flag(0))),
_context.action->history->peer->input,
_bot->inputUser,
_context.action->history->peer->input(),
_bot->inputUser(),
MTP_string(_button.startCommand),
MTP_dataJSON(MTP_bytes(botThemeParams().json)),
MTP_string("tdesktop")
@@ -1241,7 +1241,7 @@ void WebViewInstance::requestApp(bool allowWrite) {
| (allowWrite ? Flag::f_write_allowed : Flag(0));
_requestId = _session->api().request(MTPmessages_RequestAppWebView(
MTP_flags(flags),
_context.action->history->peer->input,
_context.action->history->peer->input(),
MTP_inputBotAppID(MTP_long(app->id), MTP_long(app->accessHash)),
MTP_string(_appStartParam),
MTP_dataJSON(MTP_bytes(botThemeParams().json)),
@@ -1450,12 +1450,12 @@ void WebViewInstance::started(uint64 queryId) {
| (action.replyTo ? Flag::f_reply_to : Flag(0))
| (action.options.sendAs ? Flag::f_send_as : Flag(0))
| (action.options.silent ? Flag::f_silent : Flag(0))),
action.history->peer->input,
_bot->inputUser,
action.history->peer->input(),
_bot->inputUser(),
MTP_long(queryId),
action.mtpReplyTo(),
(action.options.sendAs
? action.options.sendAs->input
? action.options.sendAs->input()
: MTP_inputPeerEmpty())
)).done([=] {
_prolongId = 0;
@@ -1678,7 +1678,7 @@ void WebViewInstance::botSendData(QByteArray data) {
}
_dataSent = true;
_session->api().request(MTPmessages_SendWebViewData(
_bot->inputUser,
_bot->inputUser(),
MTP_long(base::RandomValue<uint64>()),
MTP_string(_button.text),
MTP_bytes(data)
@@ -1721,7 +1721,7 @@ void WebViewInstance::botSwitchInlineQuery(
void WebViewInstance::botCheckWriteAccess(Fn<void(bool allowed)> callback) {
_session->api().request(MTPbots_CanSendMessage(
_bot->inputUser
_bot->inputUser()
)).done([=](const MTPBool &result) {
callback(mtpIsTrue(result));
}).fail([=] {
@@ -1731,7 +1731,7 @@ void WebViewInstance::botCheckWriteAccess(Fn<void(bool allowed)> callback) {
void WebViewInstance::botAllowWriteAccess(Fn<void(bool allowed)> callback) {
_session->api().request(MTPbots_AllowSendMessage(
_bot->inputUser
_bot->inputUser()
)).done([session = _session, callback](const MTPUpdates &result) {
session->api().applyUpdates(result);
callback(true);
@@ -1768,7 +1768,7 @@ void WebViewInstance::botRequestEmojiStatusAccess(
const auto session = &bot->session();
bot->botInfo->canManageEmojiStatus = true;
session->api().request(MTPbots_ToggleUserEmojiStatusPermission(
bot->inputUser,
bot->inputUser(),
MTP_bool(true)
)).done([=] {
callback(true);
@@ -1806,7 +1806,7 @@ void WebViewInstance::botInvokeCustomMethod(
Ui::BotWebView::CustomMethodRequest request) {
const auto callback = request.callback;
_session->api().request(MTPbots_InvokeWebViewCustomMethod(
_bot->inputUser,
_bot->inputUser(),
MTP_string(request.method),
MTP_dataJSON(MTP_bytes(request.params))
)).done([=](const MTPDataJSON &result) {
@@ -1828,7 +1828,7 @@ void WebViewInstance::botSendPreparedMessage(
return;
}
_session->api().request(MTPmessages_GetPreparedInlineMessage(
bot->inputUser,
bot->inputUser(),
MTP_string(request.id)
)).done([=](const MTPmessages_PreparedInlineMessage &result) {
const auto panel = weak.get();
@@ -2019,7 +2019,7 @@ void WebViewInstance::botDownloadFile(
callback(true);
};
_session->api().request(MTPbots_CheckDownloadFileParams(
_bot->inputUser,
_bot->inputUser(),
MTP_string(request.name),
MTP_string(request.url)
)).done([=] {
@@ -2335,7 +2335,7 @@ void AttachWebView::requestAddToMenu(
}
process.requestId = _session->api().request(
MTPmessages_GetAttachMenuBot(bot->inputUser)
MTPmessages_GetAttachMenuBot(bot->inputUser())
).done([=](const MTPAttachMenuBotsBot &result) {
_addToMenu[bot].requestId = 0;
const auto &data = result.data();
@@ -2548,7 +2548,7 @@ void AttachWebView::toggleInMenu(
MTP_flags((state == ToggledState::AllowedToWrite)
? Flag::f_write_allowed
: Flag()),
bot->inputUser,
bot->inputUser(),
MTP_bool(state != ToggledState::Removed)
)).done([=] {
_requestId = 0;

View File

@@ -465,8 +465,8 @@ void Widget::onInlineRequest() {
_requesting.fire(true);
_inlineRequestId = _api.request(MTPmessages_GetInlineBotResults(
MTP_flags(0),
_inlineBot->inputUser,
_inlineQueryPeer->input,
_inlineBot->inputUser(),
_inlineQueryPeer->input(),
MTPInputGeoPoint(),
MTP_string(_inlineQuery),
MTP_string(nextOffset)