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

@@ -57,8 +57,8 @@ void ConnectStarRef(
Fn<void(ConnectedBot)> done,
Fn<void(const QString &)> fail) {
bot->session().api().request(MTPpayments_ConnectStarRefBot(
peer->input,
bot->inputUser
peer->input(),
bot->inputUser()
)).done([=](const MTPpayments_ConnectedStarRefBots &result) {
const auto parsed = Parse(&bot->session(), result);
if (parsed.empty()) {
@@ -973,7 +973,7 @@ void UpdateProgram(
MTP_flags((program.commission > 0 && program.durationMonths > 0)
? Flag::f_duration_months
: Flag()),
bot->inputUser,
bot->inputUser(),
MTP_int(program.commission),
MTP_int(program.durationMonths)
)).done([=](const MTPStarRefProgram &result) {

View File

@@ -270,8 +270,8 @@ void Resolve(
not_null<UserData*> bot,
Fn<void(std::optional<ConnectedBotState>)> done) {
peer->session().api().request(MTPpayments_GetConnectedStarRefBot(
peer->input,
bot->inputUser
peer->input(),
bot->inputUser()
)).done([=](const MTPpayments_ConnectedStarRefBots &result) {
const auto parsed = Parse(&peer->session(), result);
if (parsed.empty()) {
@@ -358,7 +358,7 @@ void ListController::loadMoreRows() {
MTP_flags(Flag()
| (_offsetDate ? Flag::f_offset_date : Flag())
| (_offsetThing.isEmpty() ? Flag() : Flag::f_offset_link)),
_peer->input,
_peer->input(),
MTP_int(_offsetDate),
MTP_string(_offsetThing),
MTP_int(kPerPage))
@@ -390,7 +390,7 @@ void ListController::loadMoreRows() {
: (_sort == SuggestedSort::Date)
? Flag::f_order_by_date
: Flag()),
_peer->input,
_peer->input(),
MTP_string(_offsetThing),
MTP_int(kPerPage))
).done([=](const MTPpayments_SuggestedStarRefBots &result) {
@@ -595,7 +595,7 @@ void RevokeLink(
Fn<void()> revoked) {
peer->session().api().request(MTPpayments_EditConnectedStarRefBot(
MTP_flags(MTPpayments_EditConnectedStarRefBot::Flag::f_revoked),
peer->input,
peer->input(),
MTP_string(link)
)).done([=] {
controller->showToast({

View File

@@ -98,7 +98,7 @@ void ListController::loadMoreRows() {
return;
}
_preloadRequestId = _api.request(MTPmessages_GetCommonChats(
_user->inputUser,
_user->inputUser(),
MTP_long(peerIsChat(_preloadGroupId)
? peerToChat(_preloadGroupId).bare
: peerToChannel(_preloadGroupId).bare),

View File

@@ -106,7 +106,7 @@ void EditCollectionBox(
using Flag = MTPpayments_UpdateStarGiftCollection::Flag;
session->api().request(MTPpayments_UpdateStarGiftCollection(
MTP_flags(Flag::f_title),
peer->input,
peer->input(),
MTP_int(id),
MTP_string(text),
MTPVector<MTPInputSavedStarGift>(),
@@ -115,7 +115,7 @@ void EditCollectionBox(
)).done(done).fail(fail).send();
} else {
session->api().request(MTPpayments_CreateStarGiftCollection(
peer->input,
peer->input(),
MTP_string(text),
MTP_vector<MTPInputSavedStarGift>(ids)
)).done(done).fail(fail).send();

View File

@@ -406,7 +406,7 @@ void InnerWidget::loadCollections() {
return;
}
_api.request(MTPpayments_GetStarGiftCollections(
_peer->input,
_peer->input(),
MTP_long(Api::CountHash(_collections
| ranges::views::transform(&Data::GiftCollection::hash)))
)).done([=](const MTPpayments_StarGiftCollections &result) {
@@ -642,7 +642,7 @@ void InnerWidget::loadMore() {
| (filter.skipSaved ? Flag::f_exclude_saved : Flag())
| (filter.skipUnsaved ? Flag::f_exclude_unsaved : Flag())
| (collectionId ? Flag::f_collection_id : Flag())),
_peer->input,
_peer->input(),
MTP_int(collectionId),
MTP_string(filterChanged ? QString() : _offset),
MTP_int(kPerPage)
@@ -1042,7 +1042,7 @@ void InnerWidget::editCollectionName(int id) {
void InnerWidget::confirmDeleteCollection(int id) {
const auto done = [=](Fn<void()> close) {
_window->session().api().request(
MTPpayments_DeleteStarGiftCollection(_peer->input, MTP_int(id))
MTPpayments_DeleteStarGiftCollection(_peer->input(), MTP_int(id))
).send();
collectionRemoved(id);
close();
@@ -1095,7 +1095,7 @@ void InnerWidget::addGiftToCollection(
_window->session().api().request(
MTPpayments_UpdateStarGiftCollection(
MTP_flags(Flag::f_add_stargift),
_peer->input,
_peer->input(),
MTP_int(collectionId),
MTPstring(),
MTPVector<MTPInputSavedStarGift>(),
@@ -1433,7 +1433,7 @@ void InnerWidget::editCollectionGifts(int id) {
| (remove.isEmpty()
? Flag()
: Flag::f_delete_stargift)),
_peer->input,
_peer->input(),
MTP_int(id),
MTPstring(),
MTP_vector<MTPInputSavedStarGift>(remove),
@@ -1588,7 +1588,7 @@ void InnerWidget::removeGiftFromCollection(
_window->session().api().request(
MTPpayments_UpdateStarGiftCollection(
MTP_flags(Flag::f_delete_stargift),
_peer->input,
_peer->input(),
MTP_int(collectionId),
MTPstring(),
MTP_vector<MTPInputSavedStarGift>({
@@ -1897,7 +1897,7 @@ void InnerWidget::flushCollectionReorder() {
}
_api.request(MTPpayments_ReorderStarGiftCollections(
_peer->input,
_peer->input(),
MTP_vector<MTPint>(order)
)).fail([show = _window->uiShow()](const MTP::Error &error) {
show->showToast(error.type());
@@ -2276,7 +2276,7 @@ void InnerWidget::requestReorder(int fromIndex, int toIndex) {
_api.request(
MTPpayments_UpdateStarGiftCollection(
MTP_flags(MTPpayments_UpdateStarGiftCollection::Flag::f_order),
_peer->input,
_peer->input(),
MTP_int(collectionId),
MTPstring(),
MTPVector<MTPInputSavedStarGift>(),
@@ -2560,7 +2560,7 @@ void Widget::setupNotifyCheckbox(int wasBottomHeight, bool enabled) {
using Flag = MTPpayments_ToggleChatStarGiftNotifications::Flag;
api->request(MTPpayments_ToggleChatStarGiftNotifications(
MTP_flags(checked ? Flag::f_enabled : Flag()),
_inner->peer()->input
_inner->peer()->input()
)).send();
if (checked) {
show->showToast(tr::lng_peer_gifts_notify_enabled(tr::now));

View File

@@ -200,7 +200,7 @@ void ListController::loadMoreRows() {
const auto limit = _offset.isEmpty() ? kFirstPage : kPerPage;
_loadRequestId = _api.request(MTPmessages_GetPollVotes(
MTP_flags(flags),
item->history()->peer->input,
item->history()->peer->input(),
MTP_int(item->id),
MTP_bytes(_option),
MTP_string(_offset),

View File

@@ -721,7 +721,7 @@ void DeleteContactNote(
not_null<UserData*> user,
Fn<void(const QString &)> showError = nullptr) {
user->session().api().request(MTPcontacts_UpdateContactNote(
user->inputUser,
user->inputUser(),
MTP_textWithEntities(MTP_string(), MTP_vector<MTPMessageEntity>())
)).done([=] {
user->setNote(TextWithEntities());
@@ -1296,9 +1296,9 @@ void ReportReactionBox(
}
}
data.group->session().api().request(MTPmessages_ReportReaction(
data.group->input,
data.group->input(),
MTP_int(data.messageId.bare),
participant->input
participant->input()
)).done(crl::guard(controller, [=] {
controller->showToast(tr::lng_report_thanks(tr::now));
})).send();
@@ -2153,7 +2153,7 @@ void DetailsFiller::setupBotPermissions() {
user->botInfo->canManageEmojiStatus = allowed;
const auto session = &user->session();
session->api().request(MTPbots_ToggleUserEmojiStatusPermission(
user->inputUser,
user->inputUser(),
MTP_bool(allowed)
)).send();
}, emoji->lifetime());

View File

@@ -168,7 +168,7 @@ void EditAlbumBox::prepare() {
| (remove.isEmpty()
? Flag()
: Flag::f_delete_stories)),
changes.peer->input,
changes.peer->input(),
MTP_int(changes.albumId),
MTPstring(),
MTP_vector<MTPint>(remove),
@@ -1118,7 +1118,7 @@ void InnerWidget::flushAlbumReorder() {
}
_reorderRequestId = _api->request(MTPstories_ReorderAlbums(
_peer->input,
_peer->input(),
MTP_vector<MTPint>(order)
)).done([=] {
_reorderRequestId = 0;